gl860.h 2.7 KB

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