gl860.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* @file gl860.h
  2. * @author Olivier LORIN, tiré du pilote Syntek par Nicolas VIVIEN
  3. * @date 2009-08-27
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GL860_DEV_H
  19. #define GL860_DEV_H
  20. #include <linux/version.h>
  21. #include "gspca.h"
  22. #define MODULE_NAME "gspca_gl860"
  23. #define DRIVER_VERSION "0.9d10"
  24. #define ctrl_in gl860_RTx
  25. #define ctrl_out gl860_RTx
  26. #define ID_MI1320 1
  27. #define ID_OV2640 2
  28. #define ID_OV9655 4
  29. #define ID_MI2020 8
  30. #define ID_MI2020b 16
  31. #define _MI1320_ (((struct sd *) gspca_dev)->sensor == ID_MI1320)
  32. #define _MI2020_ (((struct sd *) gspca_dev)->sensor == ID_MI2020)
  33. #define _MI2020b_ (((struct sd *) gspca_dev)->sensor == ID_MI2020b)
  34. #define _MI2020c_ 0
  35. #define _OV2640_ (((struct sd *) gspca_dev)->sensor == ID_OV2640)
  36. #define _OV9655_ (((struct sd *) gspca_dev)->sensor == ID_OV9655)
  37. #define IMAGE_640 0
  38. #define IMAGE_800 1
  39. #define IMAGE_1280 2
  40. #define IMAGE_1600 3
  41. struct sd_gl860 {
  42. u16 backlight;
  43. u16 brightness;
  44. u16 sharpness;
  45. u16 contrast;
  46. u16 gamma;
  47. u16 hue;
  48. u16 saturation;
  49. u16 whitebal;
  50. u8 mirror;
  51. u8 flip;
  52. u8 AC50Hz;
  53. };
  54. /* Specific webcam descriptor */
  55. struct sd {
  56. struct gspca_dev gspca_dev; /* !! must be the first item */
  57. struct sd_gl860 vcur;
  58. struct sd_gl860 vold;
  59. struct sd_gl860 vmax;
  60. int (*dev_configure_alt) (struct gspca_dev *);
  61. int (*dev_init_at_startup)(struct gspca_dev *);
  62. int (*dev_init_pre_alt) (struct gspca_dev *);
  63. void (*dev_post_unset_alt) (struct gspca_dev *);
  64. int (*dev_camera_settings)(struct gspca_dev *);
  65. u8 swapRB;
  66. u8 mirrorMask;
  67. u8 sensor;
  68. s32 nbIm;
  69. s32 nbRightUp;
  70. u8 waitSet;
  71. };
  72. struct validx {
  73. u16 val;
  74. u16 idx;
  75. };
  76. struct idxdata {
  77. u8 idx;
  78. u8 data[3];
  79. };
  80. int fetch_validx(struct gspca_dev *gspca_dev, struct validx *tbl, int len);
  81. int keep_on_fetching_validx(struct gspca_dev *gspca_dev, struct validx *tbl,
  82. int len, int n);
  83. void fetch_idxdata(struct gspca_dev *gspca_dev, struct idxdata *tbl, int len);
  84. int gl860_RTx(struct gspca_dev *gspca_dev,
  85. unsigned char pref, u32 req, u16 val, u16 index,
  86. s32 len, void *pdata);
  87. void mi1320_init_settings(struct gspca_dev *);
  88. void ov2640_init_settings(struct gspca_dev *);
  89. void ov9655_init_settings(struct gspca_dev *);
  90. void mi2020_init_settings(struct gspca_dev *);
  91. #endif