diff options
author | Erik Andrén <erik.andren@gmail.com> | 2008-11-27 11:48:33 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:39:55 -0500 |
commit | 4f93c450e8320d906ae50c75f2c8696516b5ccf3 (patch) | |
tree | 8b5543a5e4ed7702764c572fb47bba0d0edb8d0e /drivers/media | |
parent | 2f5ded9b99fa2cfa86a0f08993a932c1e6b47560 (diff) |
V4L/DVB (10023): m5602: Convert the mt9m111 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_mt9m111.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/drivers/media/video/gspca/m5602/m5602_mt9m111.c index ae3b62ab4525..0a4158f57ad3 100644 --- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c +++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c | |||
@@ -51,7 +51,7 @@ int mt9m111_probe(struct sd *sd) | |||
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | if (mt9m111_read_sensor(sd, MT9M111_SC_CHIPVER, data, 2)) | 54 | if (m5602_read_sensor(sd, MT9M111_SC_CHIPVER, data, 2)) |
55 | return -ENODEV; | 55 | return -ENODEV; |
56 | 56 | ||
57 | if ((data[0] == 0x14) && (data[1] == 0x3a)) { | 57 | if ((data[0] == 0x14) && (data[1] == 0x3a)) { |
@@ -106,7 +106,7 @@ int mt9m111_get_vflip(struct gspca_dev *gspca_dev, __s32 *val) | |||
106 | u8 data[2] = {0x00, 0x00}; | 106 | u8 data[2] = {0x00, 0x00}; |
107 | struct sd *sd = (struct sd *) gspca_dev; | 107 | struct sd *sd = (struct sd *) gspca_dev; |
108 | 108 | ||
109 | err = mt9m111_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, | 109 | err = m5602_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, |
110 | data, 2); | 110 | data, 2); |
111 | *val = data[0] & MT9M111_RMB_MIRROR_ROWS; | 111 | *val = data[0] & MT9M111_RMB_MIRROR_ROWS; |
112 | PDEBUG(D_V4L2, "Read vertical flip %d", *val); | 112 | PDEBUG(D_V4L2, "Read vertical flip %d", *val); |
@@ -127,7 +127,7 @@ int mt9m111_set_vflip(struct gspca_dev *gspca_dev, __s32 val) | |||
127 | if (err < 0) | 127 | if (err < 0) |
128 | goto out; | 128 | goto out; |
129 | 129 | ||
130 | err = mt9m111_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, data, 2); | 130 | err = m5602_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, data, 2); |
131 | if (err < 0) | 131 | if (err < 0) |
132 | goto out; | 132 | goto out; |
133 | 133 | ||
@@ -144,7 +144,7 @@ int mt9m111_get_hflip(struct gspca_dev *gspca_dev, __s32 *val) | |||
144 | u8 data[2] = {0x00, 0x00}; | 144 | u8 data[2] = {0x00, 0x00}; |
145 | struct sd *sd = (struct sd *) gspca_dev; | 145 | struct sd *sd = (struct sd *) gspca_dev; |
146 | 146 | ||
147 | err = mt9m111_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, | 147 | err = m5602_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, |
148 | data, 2); | 148 | data, 2); |
149 | *val = data[0] & MT9M111_RMB_MIRROR_COLS; | 149 | *val = data[0] & MT9M111_RMB_MIRROR_COLS; |
150 | PDEBUG(D_V4L2, "Read horizontal flip %d", *val); | 150 | PDEBUG(D_V4L2, "Read horizontal flip %d", *val); |
@@ -165,7 +165,7 @@ int mt9m111_set_hflip(struct gspca_dev *gspca_dev, __s32 val) | |||
165 | if (err < 0) | 165 | if (err < 0) |
166 | goto out; | 166 | goto out; |
167 | 167 | ||
168 | err = mt9m111_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, data, 2); | 168 | err = m5602_read_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, data, 2); |
169 | if (err < 0) | 169 | if (err < 0) |
170 | goto out; | 170 | goto out; |
171 | 171 | ||
@@ -182,7 +182,7 @@ int mt9m111_get_gain(struct gspca_dev *gspca_dev, __s32 *val) | |||
182 | u8 data[2] = {0x00, 0x00}; | 182 | u8 data[2] = {0x00, 0x00}; |
183 | struct sd *sd = (struct sd *) gspca_dev; | 183 | struct sd *sd = (struct sd *) gspca_dev; |
184 | 184 | ||
185 | err = mt9m111_read_sensor(sd, MT9M111_SC_GLOBAL_GAIN, data, 2); | 185 | err = m5602_read_sensor(sd, MT9M111_SC_GLOBAL_GAIN, data, 2); |
186 | tmp = ((data[1] << 8) | data[0]); | 186 | tmp = ((data[1] << 8) | data[0]); |
187 | 187 | ||
188 | *val = ((tmp & (1 << 10)) * 2) | | 188 | *val = ((tmp & (1 << 10)) * 2) | |
@@ -276,7 +276,7 @@ static void mt9m111_dump_registers(struct sd *sd) | |||
276 | value[1] = MT9M111_SENSOR_CORE; | 276 | value[1] = MT9M111_SENSOR_CORE; |
277 | m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2); | 277 | m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2); |
278 | for (address = 0; address < 0xff; address++) { | 278 | for (address = 0; address < 0xff; address++) { |
279 | mt9m111_read_sensor(sd, address, value, 2); | 279 | m5602_read_sensor(sd, address, value, 2); |
280 | info("register 0x%x contains 0x%x%x", | 280 | info("register 0x%x contains 0x%x%x", |
281 | address, value[0], value[1]); | 281 | address, value[0], value[1]); |
282 | } | 282 | } |
@@ -285,7 +285,7 @@ static void mt9m111_dump_registers(struct sd *sd) | |||
285 | value[1] = MT9M111_COLORPIPE; | 285 | value[1] = MT9M111_COLORPIPE; |
286 | m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2); | 286 | m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2); |
287 | for (address = 0; address < 0xff; address++) { | 287 | for (address = 0; address < 0xff; address++) { |
288 | mt9m111_read_sensor(sd, address, value, 2); | 288 | m5602_read_sensor(sd, address, value, 2); |
289 | info("register 0x%x contains 0x%x%x", | 289 | info("register 0x%x contains 0x%x%x", |
290 | address, value[0], value[1]); | 290 | address, value[0], value[1]); |
291 | } | 291 | } |
@@ -294,7 +294,7 @@ static void mt9m111_dump_registers(struct sd *sd) | |||
294 | value[1] = MT9M111_CAMERA_CONTROL; | 294 | value[1] = MT9M111_CAMERA_CONTROL; |
295 | m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2); | 295 | m5602_write_sensor(sd, MT9M111_PAGE_MAP, value, 2); |
296 | for (address = 0; address < 0xff; address++) { | 296 | for (address = 0; address < 0xff; address++) { |
297 | mt9m111_read_sensor(sd, address, value, 2); | 297 | m5602_read_sensor(sd, address, value, 2); |
298 | info("register 0x%x contains 0x%x%x", | 298 | info("register 0x%x contains 0x%x%x", |
299 | address, value[0], value[1]); | 299 | address, value[0], value[1]); |
300 | } | 300 | } |