1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef GL860_DEV_H
20#define GL860_DEV_H
21
22#include "gspca.h"
23
24#define MODULE_NAME "gspca_gl860"
25#define DRIVER_VERSION "0.9d10"
26
27#define ctrl_in gl860_RTx
28#define ctrl_out gl860_RTx
29
30#define ID_MI1320 1
31#define ID_OV2640 2
32#define ID_OV9655 4
33#define ID_MI2020 8
34
35#define _MI1320_ (((struct sd *) gspca_dev)->sensor == ID_MI1320)
36#define _MI2020_ (((struct sd *) gspca_dev)->sensor == ID_MI2020)
37#define _OV2640_ (((struct sd *) gspca_dev)->sensor == ID_OV2640)
38#define _OV9655_ (((struct sd *) gspca_dev)->sensor == ID_OV9655)
39
40#define IMAGE_640 0
41#define IMAGE_800 1
42#define IMAGE_1280 2
43#define IMAGE_1600 3
44
45struct sd_gl860 {
46 u16 backlight;
47 u16 brightness;
48 u16 sharpness;
49 u16 contrast;
50 u16 gamma;
51 u16 hue;
52 u16 saturation;
53 u16 whitebal;
54 u8 mirror;
55 u8 flip;
56 u8 AC50Hz;
57};
58
59
60struct sd {
61 struct gspca_dev gspca_dev;
62
63 struct sd_gl860 vcur;
64 struct sd_gl860 vold;
65 struct sd_gl860 vmax;
66
67 int (*dev_configure_alt) (struct gspca_dev *);
68 int (*dev_init_at_startup)(struct gspca_dev *);
69 int (*dev_init_pre_alt) (struct gspca_dev *);
70 void (*dev_post_unset_alt) (struct gspca_dev *);
71 int (*dev_camera_settings)(struct gspca_dev *);
72
73 u8 swapRB;
74 u8 mirrorMask;
75 u8 sensor;
76 s32 nbIm;
77 s32 nbRightUp;
78 u8 waitSet;
79};
80
81struct validx {
82 u16 val;
83 u16 idx;
84};
85
86struct idxdata {
87 u8 idx;
88 u8 data[3];
89};
90
91int fetch_validx(struct gspca_dev *gspca_dev, struct validx *tbl, int len);
92int keep_on_fetching_validx(struct gspca_dev *gspca_dev, struct validx *tbl,
93 int len, int n);
94void fetch_idxdata(struct gspca_dev *gspca_dev, struct idxdata *tbl, int len);
95
96int gl860_RTx(struct gspca_dev *gspca_dev,
97 unsigned char pref, u32 req, u16 val, u16 index,
98 s32 len, void *pdata);
99
100void mi1320_init_settings(struct gspca_dev *);
101void ov2640_init_settings(struct gspca_dev *);
102void ov9655_init_settings(struct gspca_dev *);
103void mi2020_init_settings(struct gspca_dev *);
104
105#endif
106