aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorErik Andrén <erik.andren@gmail.com>2008-11-27 11:54:13 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:39:57 -0500
commit6b9c0a2aad5a64ee7eb605e35bc761d901782d25 (patch)
tree695f10d321b2e8be6ca7e2ce0a5fee34af0d1b2c /drivers/media
parent62e856dc2fa49d3fc0b5d0b7b315236ea49c5f34 (diff)
V4L/DVB (10027): m5602: convert the s5k83a sensor to use the common function
Convert the s5k83a sensor to use the common read_sensor function 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_s5k83a.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/drivers/media/video/gspca/m5602/m5602_s5k83a.c
index 3723030744f4..811766b32693 100644
--- a/drivers/media/video/gspca/m5602/m5602_s5k83a.c
+++ b/drivers/media/video/gspca/m5602/m5602_s5k83a.c
@@ -51,10 +51,10 @@ int s5k83a_probe(struct sd *sd)
51 /* We don't know what register (if any) that contain the product id 51 /* We don't know what register (if any) that contain the product id
52 * Just pick the first addresses that seem to produce the same results 52 * Just pick the first addresses that seem to produce the same results
53 * on multiple machines */ 53 * on multiple machines */
54 if (s5k83a_read_sensor(sd, 0x00, &prod_id, 1)) 54 if (m5602_read_sensor(sd, 0x00, &prod_id, 1))
55 return -ENODEV; 55 return -ENODEV;
56 56
57 if (s5k83a_read_sensor(sd, 0x01, &ver_id, 1)) 57 if (m5602_read_sensor(sd, 0x01, &ver_id, 1))
58 return -ENODEV; 58 return -ENODEV;
59 59
60 if ((prod_id == 0xff) || (ver_id == 0xff)) 60 if ((prod_id == 0xff) || (ver_id == 0xff))
@@ -154,14 +154,14 @@ void s5k83a_dump_registers(struct sd *sd)
154{ 154{
155 int address; 155 int address;
156 u8 page, old_page; 156 u8 page, old_page;
157 s5k83a_read_sensor(sd, S5K83A_PAGE_MAP, &old_page, 1); 157 m5602_read_sensor(sd, S5K83A_PAGE_MAP, &old_page, 1);
158 158
159 for (page = 0; page < 16; page++) { 159 for (page = 0; page < 16; page++) {
160 m5602_write_sensor(sd, S5K83A_PAGE_MAP, &page, 1); 160 m5602_write_sensor(sd, S5K83A_PAGE_MAP, &page, 1);
161 info("Dumping the s5k83a register state for page 0x%x", page); 161 info("Dumping the s5k83a register state for page 0x%x", page);
162 for (address = 0; address <= 0xff; address++) { 162 for (address = 0; address <= 0xff; address++) {
163 u8 val = 0; 163 u8 val = 0;
164 s5k83a_read_sensor(sd, address, &val, 1); 164 m5602_read_sensor(sd, address, &val, 1);
165 info("register 0x%x contains 0x%x", 165 info("register 0x%x contains 0x%x",
166 address, val); 166 address, val);
167 } 167 }
@@ -175,9 +175,9 @@ void s5k83a_dump_registers(struct sd *sd)
175 for (address = 0; address <= 0xff; address++) { 175 for (address = 0; address <= 0xff; address++) {
176 u8 old_val, ctrl_val, test_val = 0xff; 176 u8 old_val, ctrl_val, test_val = 0xff;
177 177
178 s5k83a_read_sensor(sd, address, &old_val, 1); 178 m5602_read_sensor(sd, address, &old_val, 1);
179 m5602_write_sensor(sd, address, &test_val, 1); 179 m5602_write_sensor(sd, address, &test_val, 1);
180 s5k83a_read_sensor(sd, address, &ctrl_val, 1); 180 m5602_read_sensor(sd, address, &ctrl_val, 1);
181 181
182 if (ctrl_val == test_val) 182 if (ctrl_val == test_val)
183 info("register 0x%x is writeable", address); 183 info("register 0x%x is writeable", address);
@@ -198,7 +198,7 @@ int s5k83a_get_brightness(struct gspca_dev *gspca_dev, __s32 *val)
198 u8 data[2]; 198 u8 data[2];
199 struct sd *sd = (struct sd *) gspca_dev; 199 struct sd *sd = (struct sd *) gspca_dev;
200 200
201 err = s5k83a_read_sensor(sd, S5K83A_BRIGHTNESS, data, 2); 201 err = m5602_read_sensor(sd, S5K83A_BRIGHTNESS, data, 2);
202 if (err < 0) 202 if (err < 0)
203 goto out; 203 goto out;
204 204
@@ -243,7 +243,7 @@ int s5k83a_get_whiteness(struct gspca_dev *gspca_dev, __s32 *val)
243 u8 data; 243 u8 data;
244 struct sd *sd = (struct sd *) gspca_dev; 244 struct sd *sd = (struct sd *) gspca_dev;
245 245
246 err = s5k83a_read_sensor(sd, S5K83A_WHITENESS, &data, 1); 246 err = m5602_read_sensor(sd, S5K83A_WHITENESS, &data, 1);
247 if (err < 0) 247 if (err < 0)
248 goto out; 248 goto out;
249 249
@@ -271,7 +271,7 @@ int s5k83a_get_gain(struct gspca_dev *gspca_dev, __s32 *val)
271 u8 data[2]; 271 u8 data[2];
272 struct sd *sd = (struct sd *) gspca_dev; 272 struct sd *sd = (struct sd *) gspca_dev;
273 273
274 err = s5k83a_read_sensor(sd, S5K83A_GAIN, data, 2); 274 err = m5602_read_sensor(sd, S5K83A_GAIN, data, 2);
275 if (err < 0) 275 if (err < 0)
276 goto out; 276 goto out;
277 277
@@ -308,7 +308,7 @@ int s5k83a_get_vflip(struct gspca_dev *gspca_dev, __s32 *val)
308 if (err < 0) 308 if (err < 0)
309 goto out; 309 goto out;
310 310
311 err = s5k83a_read_sensor(sd, S5K83A_FLIP, data, 1); 311 err = m5602_read_sensor(sd, S5K83A_FLIP, data, 1);
312 *val = (data[0] | 0x40) ? 1 : 0; 312 *val = (data[0] | 0x40) ? 1 : 0;
313 313
314out: 314out:
@@ -326,7 +326,7 @@ int s5k83a_set_vflip(struct gspca_dev *gspca_dev, __s32 val)
326 if (err < 0) 326 if (err < 0)
327 goto out; 327 goto out;
328 328
329 err = s5k83a_read_sensor(sd, S5K83A_FLIP, data, 1); 329 err = m5602_read_sensor(sd, S5K83A_FLIP, data, 1);
330 if (err < 0) 330 if (err < 0)
331 goto out; 331 goto out;
332 332
@@ -355,7 +355,7 @@ int s5k83a_get_hflip(struct gspca_dev *gspca_dev, __s32 *val)
355 if (err < 0) 355 if (err < 0)
356 goto out; 356 goto out;
357 357
358 err = s5k83a_read_sensor(sd, S5K83A_FLIP, data, 1); 358 err = m5602_read_sensor(sd, S5K83A_FLIP, data, 1);
359 *val = (data[0] | 0x80) ? 1 : 0; 359 *val = (data[0] | 0x80) ? 1 : 0;
360 360
361out: 361out:
@@ -373,7 +373,7 @@ int s5k83a_set_hflip(struct gspca_dev *gspca_dev, __s32 val)
373 if (err < 0) 373 if (err < 0)
374 goto out; 374 goto out;
375 375
376 err = s5k83a_read_sensor(sd, S5K83A_FLIP, data, 1); 376 err = m5602_read_sensor(sd, S5K83A_FLIP, data, 1);
377 if (err < 0) 377 if (err < 0)
378 goto out; 378 goto out;
379 379