Skip to content

Commit 392ee5a

Browse files
moinejfMauro Carvalho Chehab
authored andcommitted
V4L/DVB (9290): gspca: Adjust the sensor init sequences in t613.
Signed-off-by: Jean-Francois Moine <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 236088d commit 392ee5a

File tree

1 file changed

+20
-7
lines changed
  • drivers/media/video/gspca

1 file changed

+20
-7
lines changed

drivers/media/video/gspca/t613.c

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ static const __u8 tas5130a_sensor_init[][8] = {
365365
{},
366366
};
367367

368+
static __u8 sensor_reset[] = {0x61, 0x68, 0x62, 0xff, 0x60, 0x07};
369+
368370
/* read 1 byte */
369371
static int reg_r(struct gspca_dev *gspca_dev,
370372
__u16 index)
@@ -437,12 +439,25 @@ static void om6802_sensor_init(struct gspca_dev *gspca_dev)
437439
0x90, 0x24,
438440
0x91, 0xb2,
439441
0x82, 0x32,
440-
0xfd, 0x00,
441-
0xfd, 0x01,
442442
0xfd, 0x41,
443443
0x00 /* table end */
444444
};
445445

446+
reg_w_buf(gspca_dev, sensor_reset, sizeof sensor_reset);
447+
msleep(5);
448+
i = 4;
449+
while (--i < 0) {
450+
byte = reg_r(gspca_dev, 0x0060);
451+
if (!(byte & 0x01))
452+
break;
453+
msleep(100);
454+
}
455+
byte = reg_r(gspca_dev, 0x0063);
456+
if (byte != 0x17) {
457+
err("Bad sensor reset %02x", byte);
458+
/* continue? */
459+
}
460+
446461
p = sensor_init;
447462
while (*p != 0) {
448463
val[1] = *p++;
@@ -458,7 +473,8 @@ static void om6802_sensor_init(struct gspca_dev *gspca_dev)
458473
break;
459474
}
460475
}
461-
reg_w(gspca_dev, 0x3c80);
476+
msleep(15);
477+
reg_w(gspca_dev, 0x3c80);
462478
}
463479

464480
/* this function is called at probe time */
@@ -512,8 +528,6 @@ static int sd_init(struct gspca_dev *gspca_dev)
512528
{0x08, 0x03, 0x09, 0x03, 0x12, 0x04};
513529
static const __u8 n2[] =
514530
{0x08, 0x00};
515-
static const __u8 nset[] =
516-
{ 0x61, 0x68, 0x62, 0xff, 0x60, 0x07 };
517531
static const __u8 n3[] =
518532
{0x61, 0x68, 0x65, 0x0a, 0x60, 0x04};
519533
static const __u8 n4[] =
@@ -572,8 +586,7 @@ static int sd_init(struct gspca_dev *gspca_dev)
572586
test_byte = 0;
573587
i = 5;
574588
while (--i >= 0) {
575-
reg_w_buf(gspca_dev, nset, sizeof nset);
576-
msleep(5);
589+
reg_w_buf(gspca_dev, sensor_reset, sizeof sensor_reset);
577590
test_byte = reg_r(gspca_dev, 0x0063);
578591
msleep(100);
579592
if (test_byte == 0x17)

0 commit comments

Comments
 (0)