diff options
Diffstat (limited to 'drivers/media/video/gspca/t613.c')
-rw-r--r-- | drivers/media/video/gspca/t613.c | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c index 55ef6a744427..668a7536af90 100644 --- a/drivers/media/video/gspca/t613.c +++ b/drivers/media/video/gspca/t613.c | |||
@@ -52,6 +52,7 @@ struct sd { | |||
52 | #define SENSOR_OM6802 0 | 52 | #define SENSOR_OM6802 0 |
53 | #define SENSOR_OTHER 1 | 53 | #define SENSOR_OTHER 1 |
54 | #define SENSOR_TAS5130A 2 | 54 | #define SENSOR_TAS5130A 2 |
55 | #define SENSOR_LT168G 3 /* must verify if this is the actual model */ | ||
55 | }; | 56 | }; |
56 | 57 | ||
57 | /* V4L2 controls supported by the driver */ | 58 | /* V4L2 controls supported by the driver */ |
@@ -78,7 +79,7 @@ static int sd_geteffect(struct gspca_dev *gspca_dev, __s32 *val); | |||
78 | static int sd_querymenu(struct gspca_dev *gspca_dev, | 79 | static int sd_querymenu(struct gspca_dev *gspca_dev, |
79 | struct v4l2_querymenu *menu); | 80 | struct v4l2_querymenu *menu); |
80 | 81 | ||
81 | static struct ctrl sd_ctrls[] = { | 82 | static const struct ctrl sd_ctrls[] = { |
82 | { | 83 | { |
83 | { | 84 | { |
84 | .id = V4L2_CID_BRIGHTNESS, | 85 | .id = V4L2_CID_BRIGHTNESS, |
@@ -306,6 +307,17 @@ static const u8 n4_tas5130a[] = { | |||
306 | 0xbe, 0x36, 0xbf, 0xff, 0xc2, 0x88, 0xc5, 0xc8, | 307 | 0xbe, 0x36, 0xbf, 0xff, 0xc2, 0x88, 0xc5, 0xc8, |
307 | 0xc6, 0xda | 308 | 0xc6, 0xda |
308 | }; | 309 | }; |
310 | static const u8 n4_lt168g[] = { | ||
311 | 0x66, 0x01, 0x7f, 0x00, 0x80, 0x7c, 0x81, 0x28, | ||
312 | 0x83, 0x44, 0x84, 0x20, 0x86, 0x20, 0x8a, 0x70, | ||
313 | 0x8b, 0x58, 0x8c, 0x88, 0x8d, 0xa0, 0x8e, 0xb3, | ||
314 | 0x8f, 0x24, 0xa1, 0xb0, 0xa2, 0x38, 0xa5, 0x20, | ||
315 | 0xa6, 0x4a, 0xa8, 0xe8, 0xaf, 0x38, 0xb0, 0x68, | ||
316 | 0xb1, 0x44, 0xb2, 0x88, 0xbb, 0x86, 0xbd, 0x40, | ||
317 | 0xbe, 0x26, 0xc1, 0x05, 0xc2, 0x88, 0xc5, 0xc0, | ||
318 | 0xda, 0x8e, 0xdb, 0xca, 0xdc, 0xa8, 0xdd, 0x8c, | ||
319 | 0xde, 0x44, 0xdf, 0x0c, 0xe9, 0x80 | ||
320 | }; | ||
309 | 321 | ||
310 | static const struct additional_sensor_data sensor_data[] = { | 322 | static const struct additional_sensor_data sensor_data[] = { |
311 | { /* 0: OM6802 */ | 323 | { /* 0: OM6802 */ |
@@ -380,6 +392,23 @@ static const struct additional_sensor_data sensor_data[] = { | |||
380 | .stream = | 392 | .stream = |
381 | {0x0b, 0x04, 0x0a, 0x40}, | 393 | {0x0b, 0x04, 0x0a, 0x40}, |
382 | }, | 394 | }, |
395 | { /* 3: LT168G */ | ||
396 | .n3 = {0x61, 0xc2, 0x65, 0x68, 0x60, 0x00}, | ||
397 | .n4 = n4_lt168g, | ||
398 | .n4sz = sizeof n4_lt168g, | ||
399 | .reg80 = 0x7c, | ||
400 | .reg8e = 0xb3, | ||
401 | .nset8 = {0xa8, 0xf0, 0xc6, 0xba, 0xc0, 0x00}, | ||
402 | .data1 = {0xc0, 0x38, 0x08, 0x10, 0xc0, 0x30, 0x10, 0x40, | ||
403 | 0xb0, 0xf4}, | ||
404 | .data2 = {0x40, 0x80, 0xc0, 0x50, 0xa0, 0xf0, 0x53, 0xa6, | ||
405 | 0xff}, | ||
406 | .data3 = {0x40, 0x80, 0xc0, 0x50, 0xa0, 0xf0, 0x53, 0xa6, | ||
407 | 0xff}, | ||
408 | .data4 = {0x66, 0x41, 0xa8, 0xf0}, | ||
409 | .data5 = {0x0c, 0x03, 0xab, 0x4b, 0x81, 0x2b}, | ||
410 | .stream = {0x0b, 0x04, 0x0a, 0x28}, | ||
411 | }, | ||
383 | }; | 412 | }; |
384 | 413 | ||
385 | #define MAX_EFFECTS 7 | 414 | #define MAX_EFFECTS 7 |
@@ -716,6 +745,10 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
716 | PDEBUG(D_PROBE, "sensor tas5130a"); | 745 | PDEBUG(D_PROBE, "sensor tas5130a"); |
717 | sd->sensor = SENSOR_TAS5130A; | 746 | sd->sensor = SENSOR_TAS5130A; |
718 | break; | 747 | break; |
748 | case 0x0802: | ||
749 | PDEBUG(D_PROBE, "sensor lt168g"); | ||
750 | sd->sensor = SENSOR_LT168G; | ||
751 | break; | ||
719 | case 0x0803: | 752 | case 0x0803: |
720 | PDEBUG(D_PROBE, "sensor 'other'"); | 753 | PDEBUG(D_PROBE, "sensor 'other'"); |
721 | sd->sensor = SENSOR_OTHER; | 754 | sd->sensor = SENSOR_OTHER; |
@@ -758,6 +791,13 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
758 | reg_w_buf(gspca_dev, sensor->n3, sizeof sensor->n3); | 791 | reg_w_buf(gspca_dev, sensor->n3, sizeof sensor->n3); |
759 | reg_w_buf(gspca_dev, sensor->n4, sensor->n4sz); | 792 | reg_w_buf(gspca_dev, sensor->n4, sensor->n4sz); |
760 | 793 | ||
794 | if (sd->sensor == SENSOR_LT168G) { | ||
795 | test_byte = reg_r(gspca_dev, 0x80); | ||
796 | PDEBUG(D_STREAM, "Reg 0x%02x = 0x%02x", 0x80, | ||
797 | test_byte); | ||
798 | reg_w(gspca_dev, 0x6c80); | ||
799 | } | ||
800 | |||
761 | reg_w_ixbuf(gspca_dev, 0xd0, sensor->data1, sizeof sensor->data1); | 801 | reg_w_ixbuf(gspca_dev, 0xd0, sensor->data1, sizeof sensor->data1); |
762 | reg_w_ixbuf(gspca_dev, 0xc7, sensor->data2, sizeof sensor->data2); | 802 | reg_w_ixbuf(gspca_dev, 0xc7, sensor->data2, sizeof sensor->data2); |
763 | reg_w_ixbuf(gspca_dev, 0xe0, sensor->data3, sizeof sensor->data3); | 803 | reg_w_ixbuf(gspca_dev, 0xe0, sensor->data3, sizeof sensor->data3); |
@@ -782,6 +822,13 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
782 | reg_w_buf(gspca_dev, sensor->nset8, sizeof sensor->nset8); | 822 | reg_w_buf(gspca_dev, sensor->nset8, sizeof sensor->nset8); |
783 | reg_w_buf(gspca_dev, sensor->stream, sizeof sensor->stream); | 823 | reg_w_buf(gspca_dev, sensor->stream, sizeof sensor->stream); |
784 | 824 | ||
825 | if (sd->sensor == SENSOR_LT168G) { | ||
826 | test_byte = reg_r(gspca_dev, 0x80); | ||
827 | PDEBUG(D_STREAM, "Reg 0x%02x = 0x%02x", 0x80, | ||
828 | test_byte); | ||
829 | reg_w(gspca_dev, 0x6c80); | ||
830 | } | ||
831 | |||
785 | reg_w_ixbuf(gspca_dev, 0xd0, sensor->data1, sizeof sensor->data1); | 832 | reg_w_ixbuf(gspca_dev, 0xd0, sensor->data1, sizeof sensor->data1); |
786 | reg_w_ixbuf(gspca_dev, 0xc7, sensor->data2, sizeof sensor->data2); | 833 | reg_w_ixbuf(gspca_dev, 0xc7, sensor->data2, sizeof sensor->data2); |
787 | reg_w_ixbuf(gspca_dev, 0xe0, sensor->data3, sizeof sensor->data3); | 834 | reg_w_ixbuf(gspca_dev, 0xe0, sensor->data3, sizeof sensor->data3); |
@@ -888,6 +935,8 @@ static int sd_start(struct gspca_dev *gspca_dev) | |||
888 | case SENSOR_OM6802: | 935 | case SENSOR_OM6802: |
889 | om6802_sensor_init(gspca_dev); | 936 | om6802_sensor_init(gspca_dev); |
890 | break; | 937 | break; |
938 | case SENSOR_LT168G: | ||
939 | break; | ||
891 | case SENSOR_OTHER: | 940 | case SENSOR_OTHER: |
892 | break; | 941 | break; |
893 | default: | 942 | default: |