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