aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2008-12-30 15:06:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:40 -0400
commite17cc08c2f0d714715c8c737899a6b9732c868b2 (patch)
tree4dae8c7400437704614110d640e5574d3247c37c /drivers/media
parent74cadfe1314f4cc6060dcfa5cea9ef13c6a824fd (diff)
V4L/DVB (11414): gspca - m5602-mt9m111: Move v4l2 controls to main sensor file.
Move over the v4l2 controls to the sensor specific source file. Remove the now redundant sensor struct member. Signed-off-by: Erik Andrén <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_mt9m111.c44
-rw-r--r--drivers/media/video/gspca/m5602/m5602_mt9m111.h41
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.c107
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.h103
-rw-r--r--drivers/media/video/gspca/m5602/m5602_po1030.c82
-rw-r--r--drivers/media/video/gspca/m5602/m5602_po1030.h82
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.c58
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k4aa.h56
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k83a.c70
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k83a.h69
-rw-r--r--drivers/media/video/gspca/m5602/m5602_sensor.h2
11 files changed, 353 insertions, 361 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/drivers/media/video/gspca/m5602/m5602_mt9m111.c
index 5b57fb1eb4d0..7d3f9e348ef4 100644
--- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c
+++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c
@@ -31,6 +31,48 @@ static struct v4l2_pix_format mt9m111_modes[] = {
31 } 31 }
32}; 32};
33 33
34const static struct ctrl mt9m111_ctrls[] = {
35 {
36 {
37 .id = V4L2_CID_VFLIP,
38 .type = V4L2_CTRL_TYPE_BOOLEAN,
39 .name = "vertical flip",
40 .minimum = 0,
41 .maximum = 1,
42 .step = 1,
43 .default_value = 0
44 },
45 .set = mt9m111_set_vflip,
46 .get = mt9m111_get_vflip
47 }, {
48 {
49 .id = V4L2_CID_HFLIP,
50 .type = V4L2_CTRL_TYPE_BOOLEAN,
51 .name = "horizontal flip",
52 .minimum = 0,
53 .maximum = 1,
54 .step = 1,
55 .default_value = 0
56 },
57 .set = mt9m111_set_hflip,
58 .get = mt9m111_get_hflip
59 }, {
60 {
61 .id = V4L2_CID_GAIN,
62 .type = V4L2_CTRL_TYPE_INTEGER,
63 .name = "gain",
64 .minimum = 0,
65 .maximum = (INITIAL_MAX_GAIN - 1) * 2 * 2 * 2,
66 .step = 1,
67 .default_value = DEFAULT_GAIN,
68 .flags = V4L2_CTRL_FLAG_SLIDER
69 },
70 .set = mt9m111_set_gain,
71 .get = mt9m111_get_gain
72 }
73};
74
75
34static void mt9m111_dump_registers(struct sd *sd); 76static void mt9m111_dump_registers(struct sd *sd);
35 77
36int mt9m111_probe(struct sd *sd) 78int mt9m111_probe(struct sd *sd)
@@ -77,7 +119,7 @@ int mt9m111_probe(struct sd *sd)
77sensor_found: 119sensor_found:
78 sd->gspca_dev.cam.cam_mode = mt9m111_modes; 120 sd->gspca_dev.cam.cam_mode = mt9m111_modes;
79 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(mt9m111_modes); 121 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(mt9m111_modes);
80 sd->desc->ctrls = mt9m111.ctrls; 122 sd->desc->ctrls = mt9m111_ctrls;
81 sd->desc->nctrls = ARRAY_SIZE(mt9m111_ctrls); 123 sd->desc->nctrls = ARRAY_SIZE(mt9m111_ctrls);
82 return 0; 124 return 0;
83} 125}
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.h b/drivers/media/video/gspca/m5602/m5602_mt9m111.h
index ff3809f28e41..cb04d8fefeda 100644
--- a/drivers/media/video/gspca/m5602/m5602_mt9m111.h
+++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.h
@@ -94,47 +94,6 @@ int mt9m111_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
94int mt9m111_get_gain(struct gspca_dev *gspca_dev, __s32 *val); 94int mt9m111_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
95int mt9m111_set_gain(struct gspca_dev *gspca_dev, __s32 val); 95int mt9m111_set_gain(struct gspca_dev *gspca_dev, __s32 val);
96 96
97const static struct ctrl mt9m111_ctrls[] = {
98 {
99 {
100 .id = V4L2_CID_VFLIP,
101 .type = V4L2_CTRL_TYPE_BOOLEAN,
102 .name = "vertical flip",
103 .minimum = 0,
104 .maximum = 1,
105 .step = 1,
106 .default_value = 0
107 },
108 .set = mt9m111_set_vflip,
109 .get = mt9m111_get_vflip
110 }, {
111 {
112 .id = V4L2_CID_HFLIP,
113 .type = V4L2_CTRL_TYPE_BOOLEAN,
114 .name = "horizontal flip",
115 .minimum = 0,
116 .maximum = 1,
117 .step = 1,
118 .default_value = 0
119 },
120 .set = mt9m111_set_hflip,
121 .get = mt9m111_get_hflip
122 }, {
123 {
124 .id = V4L2_CID_GAIN,
125 .type = V4L2_CTRL_TYPE_INTEGER,
126 .name = "gain",
127 .minimum = 0,
128 .maximum = (INITIAL_MAX_GAIN - 1) * 2 * 2 * 2,
129 .step = 1,
130 .default_value = DEFAULT_GAIN,
131 .flags = V4L2_CTRL_FLAG_SLIDER
132 },
133 .set = mt9m111_set_gain,
134 .get = mt9m111_get_gain
135 }
136};
137
138static struct m5602_sensor mt9m111 = { 97static struct m5602_sensor mt9m111 = {
139 .name = "MT9M111", 98 .name = "MT9M111",
140 99
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 130a29c7c532..d1ca2556769a 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -68,6 +68,108 @@ static
68 { } 68 { }
69}; 69};
70 70
71const static struct ctrl ov9650_ctrls[] = {
72 {
73 {
74 .id = V4L2_CID_EXPOSURE,
75 .type = V4L2_CTRL_TYPE_INTEGER,
76 .name = "exposure",
77 .minimum = 0x00,
78 .maximum = 0xffff,
79 .step = 0x1,
80 .default_value = EXPOSURE_DEFAULT,
81 .flags = V4L2_CTRL_FLAG_SLIDER
82 },
83 .set = ov9650_set_exposure,
84 .get = ov9650_get_exposure
85 }, {
86 {
87 .id = V4L2_CID_GAIN,
88 .type = V4L2_CTRL_TYPE_INTEGER,
89 .name = "gain",
90 .minimum = 0x00,
91 .maximum = 0x3ff,
92 .step = 0x1,
93 .default_value = GAIN_DEFAULT,
94 .flags = V4L2_CTRL_FLAG_SLIDER
95 },
96 .set = ov9650_set_gain,
97 .get = ov9650_get_gain
98 }, {
99 {
100 .type = V4L2_CTRL_TYPE_INTEGER,
101 .name = "red balance",
102 .minimum = 0x00,
103 .maximum = 0xff,
104 .step = 0x1,
105 .default_value = RED_GAIN_DEFAULT,
106 .flags = V4L2_CTRL_FLAG_SLIDER
107 },
108 .set = ov9650_set_red_balance,
109 .get = ov9650_get_red_balance
110 }, {
111 {
112 .type = V4L2_CTRL_TYPE_INTEGER,
113 .name = "blue balance",
114 .minimum = 0x00,
115 .maximum = 0xff,
116 .step = 0x1,
117 .default_value = BLUE_GAIN_DEFAULT,
118 .flags = V4L2_CTRL_FLAG_SLIDER
119 },
120 .set = ov9650_set_blue_balance,
121 .get = ov9650_get_blue_balance
122 }, {
123 {
124 .id = V4L2_CID_HFLIP,
125 .type = V4L2_CTRL_TYPE_BOOLEAN,
126 .name = "horizontal flip",
127 .minimum = 0,
128 .maximum = 1,
129 .step = 1,
130 .default_value = 0
131 },
132 .set = ov9650_set_hflip,
133 .get = ov9650_get_hflip
134 }, {
135 {
136 .id = V4L2_CID_VFLIP,
137 .type = V4L2_CTRL_TYPE_BOOLEAN,
138 .name = "vertical flip",
139 .minimum = 0,
140 .maximum = 1,
141 .step = 1,
142 .default_value = 0
143 },
144 .set = ov9650_set_vflip,
145 .get = ov9650_get_vflip
146 }, {
147 {
148 .id = V4L2_CID_AUTO_WHITE_BALANCE,
149 .type = V4L2_CTRL_TYPE_BOOLEAN,
150 .name = "auto white balance",
151 .minimum = 0,
152 .maximum = 1,
153 .step = 1,
154 .default_value = 0
155 },
156 .set = ov9650_set_auto_white_balance,
157 .get = ov9650_get_auto_white_balance
158 }, {
159 {
160 .id = V4L2_CID_AUTOGAIN,
161 .type = V4L2_CTRL_TYPE_BOOLEAN,
162 .name = "auto gain control",
163 .minimum = 0,
164 .maximum = 1,
165 .step = 1,
166 .default_value = 0
167 },
168 .set = ov9650_set_auto_gain,
169 .get = ov9650_get_auto_gain
170 }
171};
172
71static struct v4l2_pix_format ov9650_modes[] = { 173static struct v4l2_pix_format ov9650_modes[] = {
72 { 174 {
73 176, 175 176,
@@ -154,12 +256,9 @@ int ov9650_probe(struct sd *sd)
154 return -ENODEV; 256 return -ENODEV;
155 257
156sensor_found: 258sensor_found:
157// sd->gspca_dev.cam.cam_mode = ov9650.modes;
158// sd->gspca_dev.cam.nmodes = ov9650.nmodes;
159 sd->gspca_dev.cam.cam_mode = ov9650_modes; 259 sd->gspca_dev.cam.cam_mode = ov9650_modes;
160 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(ov9650_modes); 260 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(ov9650_modes);
161 261 sd->desc->ctrls = ov9650_ctrls;
162 sd->desc->ctrls = ov9650.ctrls;
163 sd->desc->nctrls = ARRAY_SIZE(ov9650_ctrls); 262 sd->desc->nctrls = ARRAY_SIZE(ov9650_ctrls);
164 return 0; 263 return 0;
165} 264}
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.h b/drivers/media/video/gspca/m5602/m5602_ov9650.h
index fb8fe56c4f10..6bfe7a9c8414 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.h
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.h
@@ -156,108 +156,6 @@ int ov9650_set_auto_white_balance(struct gspca_dev *gspca_dev, __s32 val);
156int ov9650_get_auto_gain(struct gspca_dev *gspca_dev, __s32 *val); 156int ov9650_get_auto_gain(struct gspca_dev *gspca_dev, __s32 *val);
157int ov9650_set_auto_gain(struct gspca_dev *gspca_dev, __s32 val); 157int ov9650_set_auto_gain(struct gspca_dev *gspca_dev, __s32 val);
158 158
159static struct ctrl ov9650_ctrls[] = {
160 {
161 {
162 .id = V4L2_CID_EXPOSURE,
163 .type = V4L2_CTRL_TYPE_INTEGER,
164 .name = "exposure",
165 .minimum = 0x00,
166 .maximum = 0xffff,
167 .step = 0x1,
168 .default_value = EXPOSURE_DEFAULT,
169 .flags = V4L2_CTRL_FLAG_SLIDER
170 },
171 .set = ov9650_set_exposure,
172 .get = ov9650_get_exposure
173 }, {
174 {
175 .id = V4L2_CID_GAIN,
176 .type = V4L2_CTRL_TYPE_INTEGER,
177 .name = "gain",
178 .minimum = 0x00,
179 .maximum = 0x3ff,
180 .step = 0x1,
181 .default_value = GAIN_DEFAULT,
182 .flags = V4L2_CTRL_FLAG_SLIDER
183 },
184 .set = ov9650_set_gain,
185 .get = ov9650_get_gain
186 }, {
187 {
188 .type = V4L2_CTRL_TYPE_INTEGER,
189 .name = "red balance",
190 .minimum = 0x00,
191 .maximum = 0xff,
192 .step = 0x1,
193 .default_value = RED_GAIN_DEFAULT,
194 .flags = V4L2_CTRL_FLAG_SLIDER
195 },
196 .set = ov9650_set_red_balance,
197 .get = ov9650_get_red_balance
198 }, {
199 {
200 .type = V4L2_CTRL_TYPE_INTEGER,
201 .name = "blue balance",
202 .minimum = 0x00,
203 .maximum = 0xff,
204 .step = 0x1,
205 .default_value = BLUE_GAIN_DEFAULT,
206 .flags = V4L2_CTRL_FLAG_SLIDER
207 },
208 .set = ov9650_set_blue_balance,
209 .get = ov9650_get_blue_balance
210 }, {
211 {
212 .id = V4L2_CID_HFLIP,
213 .type = V4L2_CTRL_TYPE_BOOLEAN,
214 .name = "horizontal flip",
215 .minimum = 0,
216 .maximum = 1,
217 .step = 1,
218 .default_value = 0
219 },
220 .set = ov9650_set_hflip,
221 .get = ov9650_get_hflip
222 }, {
223 {
224 .id = V4L2_CID_VFLIP,
225 .type = V4L2_CTRL_TYPE_BOOLEAN,
226 .name = "vertical flip",
227 .minimum = 0,
228 .maximum = 1,
229 .step = 1,
230 .default_value = 0
231 },
232 .set = ov9650_set_vflip,
233 .get = ov9650_get_vflip
234 }, {
235 {
236 .id = V4L2_CID_AUTO_WHITE_BALANCE,
237 .type = V4L2_CTRL_TYPE_BOOLEAN,
238 .name = "auto white balance",
239 .minimum = 0,
240 .maximum = 1,
241 .step = 1,
242 .default_value = 0
243 },
244 .set = ov9650_set_auto_white_balance,
245 .get = ov9650_get_auto_white_balance
246 }, {
247 {
248 .id = V4L2_CID_AUTOGAIN,
249 .type = V4L2_CTRL_TYPE_BOOLEAN,
250 .name = "auto gain control",
251 .minimum = 0,
252 .maximum = 1,
253 .step = 1,
254 .default_value = 0
255 },
256 .set = ov9650_set_auto_gain,
257 .get = ov9650_get_auto_gain
258 }
259};
260
261static struct m5602_sensor ov9650 = { 159static struct m5602_sensor ov9650 = {
262 .name = "OV9650", 160 .name = "OV9650",
263 .i2c_slave_id = 0x60, 161 .i2c_slave_id = 0x60,
@@ -267,7 +165,6 @@ static struct m5602_sensor ov9650 = {
267 .start = ov9650_start, 165 .start = ov9650_start,
268 .stop = ov9650_stop, 166 .stop = ov9650_stop,
269 .power_down = ov9650_power_down, 167 .power_down = ov9650_power_down,
270 .ctrls = ov9650_ctrls
271}; 168};
272 169
273static const unsigned char preinit_ov9650[][3] = 170static const unsigned char preinit_ov9650[][3] =
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.c b/drivers/media/video/gspca/m5602/m5602_po1030.c
index 716b359e7a90..eaddf488bad1 100644
--- a/drivers/media/video/gspca/m5602/m5602_po1030.c
+++ b/drivers/media/video/gspca/m5602/m5602_po1030.c
@@ -31,6 +31,86 @@ static struct v4l2_pix_format po1030_modes[] = {
31 } 31 }
32}; 32};
33 33
34const static struct ctrl po1030_ctrls[] = {
35 {
36 {
37 .id = V4L2_CID_GAIN,
38 .type = V4L2_CTRL_TYPE_INTEGER,
39 .name = "gain",
40 .minimum = 0x00,
41 .maximum = 0x4f,
42 .step = 0x1,
43 .default_value = PO1030_GLOBAL_GAIN_DEFAULT,
44 .flags = V4L2_CTRL_FLAG_SLIDER
45 },
46 .set = po1030_set_gain,
47 .get = po1030_get_gain
48 }, {
49 {
50 .id = V4L2_CID_EXPOSURE,
51 .type = V4L2_CTRL_TYPE_INTEGER,
52 .name = "exposure",
53 .minimum = 0x00,
54 .maximum = 0x02ff,
55 .step = 0x1,
56 .default_value = PO1030_EXPOSURE_DEFAULT,
57 .flags = V4L2_CTRL_FLAG_SLIDER
58 },
59 .set = po1030_set_exposure,
60 .get = po1030_get_exposure
61 }, {
62 {
63 .id = V4L2_CID_RED_BALANCE,
64 .type = V4L2_CTRL_TYPE_INTEGER,
65 .name = "red balance",
66 .minimum = 0x00,
67 .maximum = 0xff,
68 .step = 0x1,
69 .default_value = PO1030_RED_GAIN_DEFAULT,
70 .flags = V4L2_CTRL_FLAG_SLIDER
71 },
72 .set = po1030_set_red_balance,
73 .get = po1030_get_red_balance
74 }, {
75 {
76 .id = V4L2_CID_BLUE_BALANCE,
77 .type = V4L2_CTRL_TYPE_INTEGER,
78 .name = "blue balance",
79 .minimum = 0x00,
80 .maximum = 0xff,
81 .step = 0x1,
82 .default_value = PO1030_BLUE_GAIN_DEFAULT,
83 .flags = V4L2_CTRL_FLAG_SLIDER
84 },
85 .set = po1030_set_blue_balance,
86 .get = po1030_get_blue_balance
87 }, {
88 {
89 .id = V4L2_CID_HFLIP,
90 .type = V4L2_CTRL_TYPE_BOOLEAN,
91 .name = "horizontal flip",
92 .minimum = 0,
93 .maximum = 1,
94 .step = 1,
95 .default_value = 0,
96 },
97 .set = po1030_set_hflip,
98 .get = po1030_get_hflip
99 }, {
100 {
101 .id = V4L2_CID_VFLIP,
102 .type = V4L2_CTRL_TYPE_BOOLEAN,
103 .name = "vertical flip",
104 .minimum = 0,
105 .maximum = 1,
106 .step = 1,
107 .default_value = 0,
108 },
109 .set = po1030_set_vflip,
110 .get = po1030_get_vflip
111 }
112};
113
34static void po1030_dump_registers(struct sd *sd); 114static void po1030_dump_registers(struct sd *sd);
35 115
36int po1030_probe(struct sd *sd) 116int po1030_probe(struct sd *sd)
@@ -74,7 +154,7 @@ int po1030_probe(struct sd *sd)
74sensor_found: 154sensor_found:
75 sd->gspca_dev.cam.cam_mode = po1030_modes; 155 sd->gspca_dev.cam.cam_mode = po1030_modes;
76 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(po1030_modes); 156 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(po1030_modes);
77 sd->desc->ctrls = po1030.ctrls; 157 sd->desc->ctrls = po1030_ctrls;
78 sd->desc->nctrls = ARRAY_SIZE(po1030_ctrls); 158 sd->desc->nctrls = ARRAY_SIZE(po1030_ctrls);
79 return 0; 159 return 0;
80} 160}
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.h b/drivers/media/video/gspca/m5602/m5602_po1030.h
index b28ab2e85a54..e68ae88965a0 100644
--- a/drivers/media/video/gspca/m5602/m5602_po1030.h
+++ b/drivers/media/video/gspca/m5602/m5602_po1030.h
@@ -141,86 +141,6 @@ int po1030_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
141int po1030_get_vflip(struct gspca_dev *gspca_dev, __s32 *val); 141int po1030_get_vflip(struct gspca_dev *gspca_dev, __s32 *val);
142int po1030_set_vflip(struct gspca_dev *gspca_dev, __s32 val); 142int po1030_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
143 143
144static struct ctrl po1030_ctrls[] = {
145 {
146 {
147 .id = V4L2_CID_GAIN,
148 .type = V4L2_CTRL_TYPE_INTEGER,
149 .name = "gain",
150 .minimum = 0x00,
151 .maximum = 0x4f,
152 .step = 0x1,
153 .default_value = PO1030_GLOBAL_GAIN_DEFAULT,
154 .flags = V4L2_CTRL_FLAG_SLIDER
155 },
156 .set = po1030_set_gain,
157 .get = po1030_get_gain
158 }, {
159 {
160 .id = V4L2_CID_EXPOSURE,
161 .type = V4L2_CTRL_TYPE_INTEGER,
162 .name = "exposure",
163 .minimum = 0x00,
164 .maximum = 0x02ff,
165 .step = 0x1,
166 .default_value = PO1030_EXPOSURE_DEFAULT,
167 .flags = V4L2_CTRL_FLAG_SLIDER
168 },
169 .set = po1030_set_exposure,
170 .get = po1030_get_exposure
171 }, {
172 {
173 .id = V4L2_CID_RED_BALANCE,
174 .type = V4L2_CTRL_TYPE_INTEGER,
175 .name = "red balance",
176 .minimum = 0x00,
177 .maximum = 0xff,
178 .step = 0x1,
179 .default_value = PO1030_RED_GAIN_DEFAULT,
180 .flags = V4L2_CTRL_FLAG_SLIDER
181 },
182 .set = po1030_set_red_balance,
183 .get = po1030_get_red_balance
184 }, {
185 {
186 .id = V4L2_CID_BLUE_BALANCE,
187 .type = V4L2_CTRL_TYPE_INTEGER,
188 .name = "blue balance",
189 .minimum = 0x00,
190 .maximum = 0xff,
191 .step = 0x1,
192 .default_value = PO1030_BLUE_GAIN_DEFAULT,
193 .flags = V4L2_CTRL_FLAG_SLIDER
194 },
195 .set = po1030_set_blue_balance,
196 .get = po1030_get_blue_balance
197 }, {
198 {
199 .id = V4L2_CID_HFLIP,
200 .type = V4L2_CTRL_TYPE_BOOLEAN,
201 .name = "horizontal flip",
202 .minimum = 0,
203 .maximum = 1,
204 .step = 1,
205 .default_value = 0,
206 },
207 .set = po1030_set_hflip,
208 .get = po1030_get_hflip
209 }, {
210 {
211 .id = V4L2_CID_VFLIP,
212 .type = V4L2_CTRL_TYPE_BOOLEAN,
213 .name = "vertical flip",
214 .minimum = 0,
215 .maximum = 1,
216 .step = 1,
217 .default_value = 0,
218 },
219 .set = po1030_set_vflip,
220 .get = po1030_get_vflip
221 }
222};
223
224static struct m5602_sensor po1030 = { 144static struct m5602_sensor po1030 = {
225 .name = "PO1030", 145 .name = "PO1030",
226 146
@@ -230,8 +150,6 @@ static struct m5602_sensor po1030 = {
230 .probe = po1030_probe, 150 .probe = po1030_probe,
231 .init = po1030_init, 151 .init = po1030_init,
232 .power_down = po1030_power_down, 152 .power_down = po1030_power_down,
233
234 .ctrls = po1030_ctrls,
235}; 153};
236 154
237static const unsigned char preinit_po1030[][3] = 155static const unsigned char preinit_po1030[][3] =
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
index 40ef9ae76482..4306d596056d 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.c
@@ -64,6 +64,62 @@ static struct v4l2_pix_format s5k4aa_modes[] = {
64 } 64 }
65}; 65};
66 66
67const static struct ctrl s5k4aa_ctrls[] = {
68 {
69 {
70 .id = V4L2_CID_VFLIP,
71 .type = V4L2_CTRL_TYPE_BOOLEAN,
72 .name = "vertical flip",
73 .minimum = 0,
74 .maximum = 1,
75 .step = 1,
76 .default_value = 0
77 },
78 .set = s5k4aa_set_vflip,
79 .get = s5k4aa_get_vflip
80
81 }, {
82 {
83 .id = V4L2_CID_HFLIP,
84 .type = V4L2_CTRL_TYPE_BOOLEAN,
85 .name = "horizontal flip",
86 .minimum = 0,
87 .maximum = 1,
88 .step = 1,
89 .default_value = 0
90 },
91 .set = s5k4aa_set_hflip,
92 .get = s5k4aa_get_hflip
93
94 }, {
95 {
96 .id = V4L2_CID_GAIN,
97 .type = V4L2_CTRL_TYPE_INTEGER,
98 .name = "Gain",
99 .minimum = 0,
100 .maximum = 127,
101 .step = 1,
102 .default_value = 0xa0,
103 .flags = V4L2_CTRL_FLAG_SLIDER
104 },
105 .set = s5k4aa_set_gain,
106 .get = s5k4aa_get_gain
107 }, {
108 {
109 .id = V4L2_CID_EXPOSURE,
110 .type = V4L2_CTRL_TYPE_INTEGER,
111 .name = "Exposure",
112 .minimum = 13,
113 .maximum = 0xfff,
114 .step = 1,
115 .default_value = 0x100,
116 .flags = V4L2_CTRL_FLAG_SLIDER
117 },
118 .set = s5k4aa_set_exposure,
119 .get = s5k4aa_get_exposure
120 }
121};
122
67static void s5k4aa_dump_registers(struct sd *sd); 123static void s5k4aa_dump_registers(struct sd *sd);
68 124
69int s5k4aa_probe(struct sd *sd) 125int s5k4aa_probe(struct sd *sd)
@@ -131,7 +187,7 @@ int s5k4aa_probe(struct sd *sd)
131sensor_found: 187sensor_found:
132 sd->gspca_dev.cam.cam_mode = s5k4aa_modes; 188 sd->gspca_dev.cam.cam_mode = s5k4aa_modes;
133 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k4aa_modes); 189 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k4aa_modes);
134 sd->desc->ctrls = s5k4aa.ctrls; 190 sd->desc->ctrls = s5k4aa_ctrls;
135 sd->desc->nctrls = ARRAY_SIZE(s5k4aa_ctrls); 191 sd->desc->nctrls = ARRAY_SIZE(s5k4aa_ctrls);
136 return 0; 192 return 0;
137} 193}
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k4aa.h b/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
index 0f0c6dff1eef..ec96c8e052a8 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
+++ b/drivers/media/video/gspca/m5602/m5602_s5k4aa.h
@@ -77,61 +77,6 @@ int s5k4aa_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
77int s5k4aa_get_gain(struct gspca_dev *gspca_dev, __s32 *val); 77int s5k4aa_get_gain(struct gspca_dev *gspca_dev, __s32 *val);
78int s5k4aa_set_gain(struct gspca_dev *gspca_dev, __s32 val); 78int s5k4aa_set_gain(struct gspca_dev *gspca_dev, __s32 val);
79 79
80static struct ctrl s5k4aa_ctrls[] = {
81 {
82 {
83 .id = V4L2_CID_VFLIP,
84 .type = V4L2_CTRL_TYPE_BOOLEAN,
85 .name = "vertical flip",
86 .minimum = 0,
87 .maximum = 1,
88 .step = 1,
89 .default_value = 0
90 },
91 .set = s5k4aa_set_vflip,
92 .get = s5k4aa_get_vflip
93
94 }, {
95 {
96 .id = V4L2_CID_HFLIP,
97 .type = V4L2_CTRL_TYPE_BOOLEAN,
98 .name = "horizontal flip",
99 .minimum = 0,
100 .maximum = 1,
101 .step = 1,
102 .default_value = 0
103 },
104 .set = s5k4aa_set_hflip,
105 .get = s5k4aa_get_hflip
106
107 }, {
108 {
109 .id = V4L2_CID_GAIN,
110 .type = V4L2_CTRL_TYPE_INTEGER,
111 .name = "Gain",
112 .minimum = 0,
113 .maximum = 127,
114 .step = 1,
115 .default_value = 0xa0,
116 .flags = V4L2_CTRL_FLAG_SLIDER
117 },
118 .set = s5k4aa_set_gain,
119 .get = s5k4aa_get_gain
120 }, {
121 {
122 .id = V4L2_CID_EXPOSURE,
123 .type = V4L2_CTRL_TYPE_INTEGER,
124 .name = "Exposure",
125 .minimum = 13,
126 .maximum = 0xfff,
127 .step = 1,
128 .default_value = 0x100,
129 .flags = V4L2_CTRL_FLAG_SLIDER
130 },
131 .set = s5k4aa_set_exposure,
132 .get = s5k4aa_get_exposure
133 }
134};
135 80
136static struct m5602_sensor s5k4aa = { 81static struct m5602_sensor s5k4aa = {
137 .name = "S5K4AA", 82 .name = "S5K4AA",
@@ -141,7 +86,6 @@ static struct m5602_sensor s5k4aa = {
141 .power_down = s5k4aa_power_down, 86 .power_down = s5k4aa_power_down,
142 .i2c_slave_id = 0x5a, 87 .i2c_slave_id = 0x5a,
143 .i2c_regW = 2, 88 .i2c_regW = 2,
144 .ctrls = s5k4aa_ctrls,
145}; 89};
146 90
147static const unsigned char preinit_s5k4aa[][4] = 91static const unsigned char preinit_s5k4aa[][4] =
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/drivers/media/video/gspca/m5602/m5602_s5k83a.c
index fcc8c3752c75..42c86aa4dc8d 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k83a.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k83a.c
@@ -32,6 +32,74 @@ static struct v4l2_pix_format s5k83a_modes[] = {
32 } 32 }
33}; 33};
34 34
35const static struct ctrl s5k83a_ctrls[] = {
36 {
37 {
38 .id = V4L2_CID_BRIGHTNESS,
39 .type = V4L2_CTRL_TYPE_INTEGER,
40 .name = "brightness",
41 .minimum = 0x00,
42 .maximum = 0xff,
43 .step = 0x01,
44 .default_value = S5K83A_DEFAULT_BRIGHTNESS,
45 .flags = V4L2_CTRL_FLAG_SLIDER
46 },
47 .set = s5k83a_set_brightness,
48 .get = s5k83a_get_brightness
49
50 }, {
51 {
52 .id = V4L2_CID_WHITENESS,
53 .type = V4L2_CTRL_TYPE_INTEGER,
54 .name = "whiteness",
55 .minimum = 0x00,
56 .maximum = 0xff,
57 .step = 0x01,
58 .default_value = S5K83A_DEFAULT_WHITENESS,
59 .flags = V4L2_CTRL_FLAG_SLIDER
60 },
61 .set = s5k83a_set_whiteness,
62 .get = s5k83a_get_whiteness,
63 }, {
64 {
65 .id = V4L2_CID_GAIN,
66 .type = V4L2_CTRL_TYPE_INTEGER,
67 .name = "gain",
68 .minimum = 0x00,
69 .maximum = S5K83A_MAXIMUM_GAIN,
70 .step = 0x01,
71 .default_value = S5K83A_DEFAULT_GAIN,
72 .flags = V4L2_CTRL_FLAG_SLIDER
73 },
74 .set = s5k83a_set_gain,
75 .get = s5k83a_get_gain
76 }, {
77 {
78 .id = V4L2_CID_HFLIP,
79 .type = V4L2_CTRL_TYPE_BOOLEAN,
80 .name = "horizontal flip",
81 .minimum = 0,
82 .maximum = 1,
83 .step = 1,
84 .default_value = 0
85 },
86 .set = s5k83a_set_hflip,
87 .get = s5k83a_get_hflip
88 }, {
89 {
90 .id = V4L2_CID_VFLIP,
91 .type = V4L2_CTRL_TYPE_BOOLEAN,
92 .name = "vertical flip",
93 .minimum = 0,
94 .maximum = 1,
95 .step = 1,
96 .default_value = 0
97 },
98 .set = s5k83a_set_vflip,
99 .get = s5k83a_get_vflip
100 }
101};
102
35static void s5k83a_dump_registers(struct sd *sd); 103static void s5k83a_dump_registers(struct sd *sd);
36 104
37int s5k83a_probe(struct sd *sd) 105int s5k83a_probe(struct sd *sd)
@@ -79,7 +147,7 @@ int s5k83a_probe(struct sd *sd)
79sensor_found: 147sensor_found:
80 sd->gspca_dev.cam.cam_mode = s5k83a_modes; 148 sd->gspca_dev.cam.cam_mode = s5k83a_modes;
81 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k83a_modes); 149 sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k83a_modes);
82 sd->desc->ctrls = s5k83a.ctrls; 150 sd->desc->ctrls = s5k83a_ctrls;
83 sd->desc->nctrls = ARRAY_SIZE(s5k83a_ctrls); 151 sd->desc->nctrls = ARRAY_SIZE(s5k83a_ctrls);
84 return 0; 152 return 0;
85} 153}
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.h b/drivers/media/video/gspca/m5602/m5602_s5k83a.h
index d56eb4c5ee31..9b9450fbd3dc 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k83a.h
+++ b/drivers/media/video/gspca/m5602/m5602_s5k83a.h
@@ -61,74 +61,6 @@ int s5k83a_set_vflip(struct gspca_dev *gspca_dev, __s32 val);
61int s5k83a_get_hflip(struct gspca_dev *gspca_dev, __s32 *val); 61int s5k83a_get_hflip(struct gspca_dev *gspca_dev, __s32 *val);
62int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val); 62int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val);
63 63
64static struct ctrl s5k83a_ctrls[] = {
65 {
66 {
67 .id = V4L2_CID_BRIGHTNESS,
68 .type = V4L2_CTRL_TYPE_INTEGER,
69 .name = "brightness",
70 .minimum = 0x00,
71 .maximum = 0xff,
72 .step = 0x01,
73 .default_value = S5K83A_DEFAULT_BRIGHTNESS,
74 .flags = V4L2_CTRL_FLAG_SLIDER
75 },
76 .set = s5k83a_set_brightness,
77 .get = s5k83a_get_brightness
78
79 }, {
80 {
81 .id = V4L2_CID_WHITENESS,
82 .type = V4L2_CTRL_TYPE_INTEGER,
83 .name = "whiteness",
84 .minimum = 0x00,
85 .maximum = 0xff,
86 .step = 0x01,
87 .default_value = S5K83A_DEFAULT_WHITENESS,
88 .flags = V4L2_CTRL_FLAG_SLIDER
89 },
90 .set = s5k83a_set_whiteness,
91 .get = s5k83a_get_whiteness,
92 }, {
93 {
94 .id = V4L2_CID_GAIN,
95 .type = V4L2_CTRL_TYPE_INTEGER,
96 .name = "gain",
97 .minimum = 0x00,
98 .maximum = S5K83A_MAXIMUM_GAIN,
99 .step = 0x01,
100 .default_value = S5K83A_DEFAULT_GAIN,
101 .flags = V4L2_CTRL_FLAG_SLIDER
102 },
103 .set = s5k83a_set_gain,
104 .get = s5k83a_get_gain
105 }, {
106 {
107 .id = V4L2_CID_HFLIP,
108 .type = V4L2_CTRL_TYPE_BOOLEAN,
109 .name = "horizontal flip",
110 .minimum = 0,
111 .maximum = 1,
112 .step = 1,
113 .default_value = 0
114 },
115 .set = s5k83a_set_hflip,
116 .get = s5k83a_get_hflip
117 }, {
118 {
119 .id = V4L2_CID_VFLIP,
120 .type = V4L2_CTRL_TYPE_BOOLEAN,
121 .name = "vertical flip",
122 .minimum = 0,
123 .maximum = 1,
124 .step = 1,
125 .default_value = 0
126 },
127 .set = s5k83a_set_vflip,
128 .get = s5k83a_get_vflip
129 }
130};
131
132static struct m5602_sensor s5k83a = { 64static struct m5602_sensor s5k83a = {
133 .name = "S5K83A", 65 .name = "S5K83A",
134 .probe = s5k83a_probe, 66 .probe = s5k83a_probe,
@@ -138,7 +70,6 @@ static struct m5602_sensor s5k83a = {
138 .power_down = s5k83a_power_down, 70 .power_down = s5k83a_power_down,
139 .i2c_slave_id = 0x5a, 71 .i2c_slave_id = 0x5a,
140 .i2c_regW = 2, 72 .i2c_regW = 2,
141 .ctrls = s5k83a_ctrls,
142}; 73};
143 74
144static const unsigned char preinit_s5k83a[][4] = 75static const unsigned char preinit_s5k83a[][4] =
diff --git a/drivers/media/video/gspca/m5602/m5602_sensor.h b/drivers/media/video/gspca/m5602/m5602_sensor.h
index 3fd92d370d0a..b3e82af65066 100644
--- a/drivers/media/video/gspca/m5602/m5602_sensor.h
+++ b/drivers/media/video/gspca/m5602/m5602_sensor.h
@@ -64,8 +64,6 @@ struct m5602_sensor {
64 64
65 /* Performs a power down sequence */ 65 /* Performs a power down sequence */
66 int (*power_down)(struct sd *sd); 66 int (*power_down)(struct sd *sd);
67
68 const struct ctrl *ctrls;
69}; 67};
70 68
71#endif 69#endif