aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/sq930x.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-07-26 06:27:13 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-08 22:42:53 -0400
commit6e80cc51b4419ca0f8162024ee2497d7ec8ba31c (patch)
treee8a787818e4e2f0cb9799261cd42980eb99c755b /drivers/media/video/gspca/sq930x.c
parent585d48812c66f3045b6cb51539bafe10b109882f (diff)
V4L/DVB: gspca - sq930x: Cleanup source, add comments
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/sq930x.c')
-rw-r--r--drivers/media/video/gspca/sq930x.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/sq930x.c b/drivers/media/video/gspca/sq930x.c
index fceed19b330a..7ae6522d4edf 100644
--- a/drivers/media/video/gspca/sq930x.c
+++ b/drivers/media/video/gspca/sq930x.c
@@ -48,7 +48,7 @@ enum sensors {
48 SENSOR_ICX098BQ, 48 SENSOR_ICX098BQ,
49 SENSOR_LZ24BP, 49 SENSOR_LZ24BP,
50 SENSOR_MI0360, 50 SENSOR_MI0360,
51 SENSOR_MT9V111, 51 SENSOR_MT9V111, /* = MI360SOC */
52 SENSOR_OV7660, 52 SENSOR_OV7660,
53 SENSOR_OV9630, 53 SENSOR_OV9630,
54}; 54};
@@ -279,7 +279,7 @@ static const struct i2c_write_cmd mt9v111_init_0[] = {
279 {0x01, 0x0001}, /* select IFP/SOC registers */ 279 {0x01, 0x0001}, /* select IFP/SOC registers */
280 {0x06, 0x300c}, /* operating mode control */ 280 {0x06, 0x300c}, /* operating mode control */
281 {0x08, 0xcc00}, /* output format control (RGB) */ 281 {0x08, 0xcc00}, /* output format control (RGB) */
282 {0x01, 0x0004}, /* select core registers */ 282 {0x01, 0x0004}, /* select sensor core registers */
283}; 283};
284static const struct i2c_write_cmd mt9v111_init_1[] = { 284static const struct i2c_write_cmd mt9v111_init_1[] = {
285 {0x03, 0x01e5}, /* window height */ 285 {0x03, 0x01e5}, /* window height */
@@ -321,6 +321,7 @@ static const struct ucbus_write_cmd ov9630_start_0[] = {
321 {0xf334, 0x3e}, {0xf335, 0xf8}, {0xf33f, 0x03} 321 {0xf334, 0x3e}, {0xf335, 0xf8}, {0xf33f, 0x03}
322}; 322};
323 323
324/* start parameters indexed by [sensor][mode] */
324static const struct cap_s { 325static const struct cap_s {
325 u8 cc_sizeid; 326 u8 cc_sizeid;
326 u8 cc_bytes[32]; 327 u8 cc_bytes[32];
@@ -923,11 +924,12 @@ static void send_start(struct gspca_dev *gspca_dev)
923 reg_wb(gspca_dev, 0x0900 | SQ930_CTRL_CAP_START, 924 reg_wb(gspca_dev, 0x0900 | SQ930_CTRL_CAP_START,
924 0x0a00 | cap->cc_sizeid, 925 0x0a00 | cap->cc_sizeid,
925 cap->cc_bytes, 32); 926 cap->cc_bytes, 32);
926}; 927}
928
927static void send_stop(struct gspca_dev *gspca_dev) 929static void send_stop(struct gspca_dev *gspca_dev)
928{ 930{
929 reg_w(gspca_dev, SQ930_CTRL_CAP_STOP, 0); 931 reg_w(gspca_dev, SQ930_CTRL_CAP_STOP, 0);
930}; 932}
931 933
932/* function called at start time before URB creation */ 934/* function called at start time before URB creation */
933static int sd_isoc_init(struct gspca_dev *gspca_dev) 935static int sd_isoc_init(struct gspca_dev *gspca_dev)
@@ -1014,7 +1016,7 @@ static int sd_start(struct gspca_dev *gspca_dev)
1014 /* 1st start */ 1016 /* 1st start */
1015 send_start(gspca_dev); 1017 send_start(gspca_dev);
1016 msleep(60); 1018 msleep(60);
1017 reg_w(gspca_dev, SQ930_CTRL_CAP_STOP, 0x0000); 1019 send_stop(gspca_dev);
1018 1020
1019 i2c_write(sd, 1021 i2c_write(sd,
1020 mi0360_start_4, ARRAY_SIZE(mi0360_start_4)); 1022 mi0360_start_4, ARRAY_SIZE(mi0360_start_4));