gl860.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 <linux/version.h>
  22. #include "gspca.h"
  23. #define MODULE_NAME "gspca_gl860"
  24. #define DRIVER_VERSION "0.9d10"
  25. #define ctrl_in gl860_RTx
  26. #define ctrl_out gl860_RTx
  27. #define ID_MI1320 1
  28. #define ID_OV2640 2
  29. #define ID_OV9655 4
  30. #define ID_MI2020 8
  31. #define ID_MI2020b 16
  32. #define _MI1320_ (((struct sd *) gspca_dev)->sensor == ID_MI1320)
  33. #define _MI2020_ (((struct sd *) gspca_dev)->sensor == ID_MI2020)
  34. #define _MI2020b_ (((struct sd *) gspca_dev)->sensor == ID_MI2020b)
  35. #define _MI2020c_ 0
  36. #define _OV2640_ (((struct sd *) gspca_dev)->sensor == ID_OV2640)
  37. #define _OV9655_ (((struct sd *) gspca_dev)->sensor == ID_OV9655)
  38. #define IMAGE_640 0
  39. #define IMAGE_800 1
  40. #define IMAGE_1280 2
  41. #define IMAGE_1600 3
  42. struct sd_gl860 {
  43. u16 backlight;
  44. u16 brightness;
  45. u16 sharpness;
  46. u16 contrast;
  47. u16 gamma;
  48. u16 hue;
  49. u16 saturation;
  50. u16 whitebal;
  51. u8 mirror;
  52. u8 flip;
  53. u8 AC50Hz;
  54. };
  55. /* Specific webcam descriptor */
  56. struct sd {
  57. struct gspca_dev gspca_dev; /* !! must be the first item */
  58. struct sd_gl860 vcur;
  59. struct sd_gl860 vold;
  60. struct sd_gl860 vmax;
  61. int (*dev_configure_alt) (struct gspca_dev *);
  62. int (*dev_init_at_startup)(struct gspca_dev *);
  63. int (*dev_init_pre_alt) (struct gspca_dev *);
  64. void (*dev_post_unset_alt) (struct gspca_dev *);
  65. int (*dev_camera_settings)(struct gspca_dev *);
  66. u8 swapRB;
  67. u8 mirrorMask;
  68. u8 sensor;
  69. s32 nbIm;
  70. s32 nbRightUp;
  71. u8 waitSet;
  72. };
  73. struct validx {
  74. u16 val;
  75. u16 idx;
  76. };
  77. struct idxdata {
  78. u8 idx;
  79. u8 data[3];
  80. };
  81. int fetch_validx(struct gspca_dev *gspca_dev, struct validx *tbl, int len);
  82. int keep_on_fetching_validx(struct gspca_dev *gspca_dev, struct validx *tbl,
  83. int len, int n);
  84. void fetch_idxdata(struct gspca_dev *gspca_dev, struct idxdata *tbl, int len);
  85. int gl860_RTx(struct gspca_dev *gspca_dev,
  86. unsigned char pref, u32 req, u16 val, u16 index,
  87. s32 len, void *pdata);
  88. void mi1320_init_settings(struct gspca_dev *);
  89. void ov2640_init_settings(struct gspca_dev *);
  90. void ov9655_init_settings(struct gspca_dev *);
  91. void mi2020_init_settings(struct gspca_dev *);
  92. #endif