diff options
author | Erik Andrén <erik.andren@gmail.com> | 2011-07-27 16:19:58 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-30 23:50:20 -0400 |
commit | 46fecfaf786a35ce6dc024a70ae1e768ee44e803 (patch) | |
tree | c1734fc16048e4b7869b4787a0b70e376c4816c3 | |
parent | f9ada374f07fa8c09c15262ffd26371beacb1e98 (diff) |
[media] gspca-stv06xx: Simplify stv_init struct and vv6410 bridge init
Signed-off-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c | 13 | ||||
-rw-r--r-- | drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h | 35 |
2 files changed, 18 insertions, 30 deletions
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c b/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c index f8398434c328..51b66590c7fa 100644 --- a/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c +++ b/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.c | |||
@@ -138,18 +138,7 @@ static int vv6410_init(struct sd *sd) | |||
138 | s32 *sensor_settings = sd->sensor_priv; | 138 | s32 *sensor_settings = sd->sensor_priv; |
139 | 139 | ||
140 | for (i = 0; i < ARRAY_SIZE(stv_bridge_init); i++) { | 140 | for (i = 0; i < ARRAY_SIZE(stv_bridge_init); i++) { |
141 | /* if NULL then len contains single value */ | 141 | stv06xx_write_bridge(sd, stv_bridge_init[i].addr, stv_bridge_init[i].data); |
142 | if (stv_bridge_init[i].data == NULL) { | ||
143 | err = stv06xx_write_bridge(sd, | ||
144 | stv_bridge_init[i].start, | ||
145 | stv_bridge_init[i].len); | ||
146 | } else { | ||
147 | int j; | ||
148 | for (j = 0; j < stv_bridge_init[i].len; j++) | ||
149 | err = stv06xx_write_bridge(sd, | ||
150 | stv_bridge_init[i].start + j, | ||
151 | stv_bridge_init[i].data[j]); | ||
152 | } | ||
153 | } | 142 | } |
154 | 143 | ||
155 | if (err < 0) | 144 | if (err < 0) |
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h b/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h index c7615c218c31..f75c3364a376 100644 --- a/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h +++ b/drivers/media/video/gspca/stv06xx/stv06xx_vv6410.h | |||
@@ -211,28 +211,27 @@ const struct stv06xx_sensor stv06xx_sensor_vv6410 = { | |||
211 | 211 | ||
212 | /* If NULL, only single value to write, stored in len */ | 212 | /* If NULL, only single value to write, stored in len */ |
213 | struct stv_init { | 213 | struct stv_init { |
214 | const u8 *data; | 214 | u16 addr; |
215 | u16 start; | 215 | u8 data; |
216 | u8 len; | ||
217 | }; | 216 | }; |
218 | 217 | ||
219 | static const struct stv_init stv_bridge_init[] = { | 218 | static const struct stv_init stv_bridge_init[] = { |
220 | /* This reg is written twice. Some kind of reset? */ | 219 | /* This reg is written twice. Some kind of reset? */ |
221 | {NULL, STV_RESET, 0x80}, | 220 | {STV_RESET, 0x80}, |
222 | {NULL, STV_RESET, 0x00}, | 221 | {STV_RESET, 0x00}, |
223 | {NULL, STV_SCAN_RATE, 0x00}, | 222 | {STV_SCAN_RATE, 0x00}, |
224 | {NULL, STV_I2C_FLUSH, 0x04}, | 223 | {STV_I2C_FLUSH, 0x04}, |
225 | {NULL, STV_REG00, 0x0b}, | 224 | {STV_REG00, 0x0b}, |
226 | {NULL, STV_REG01, 0xa7}, | 225 | {STV_REG01, 0xa7}, |
227 | {NULL, STV_REG02, 0xb7}, | 226 | {STV_REG02, 0xb7}, |
228 | {NULL, STV_REG03, 0x00}, | 227 | {STV_REG03, 0x00}, |
229 | {NULL, STV_REG04, 0x00}, | 228 | {STV_REG04, 0x00}, |
230 | {NULL, 0x1536, 0x02}, | 229 | {0x1536, 0x02}, |
231 | {NULL, 0x1537, 0x00}, | 230 | {0x1537, 0x00}, |
232 | {NULL, 0x1538, 0x60}, | 231 | {0x1538, 0x60}, |
233 | {NULL, 0x1539, 0x01}, | 232 | {0x1539, 0x01}, |
234 | {NULL, 0x153a, 0x20}, | 233 | {0x153a, 0x20}, |
235 | {NULL, 0x153b, 0x01}, | 234 | {0x153b, 0x01}, |
236 | }; | 235 | }; |
237 | 236 | ||
238 | static const u8 vv6410_sensor_init[][2] = { | 237 | static const u8 vv6410_sensor_init[][2] = { |