diff options
author | Brian Johnson <brijohn@gmail.com> | 2010-03-16 12:58:28 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-17 23:50:09 -0400 |
commit | e99ac54da6d3e44e6152aaab693fa311279dec7c (patch) | |
tree | 2495ab787fb9a85dced2a182d3c594ab0ed85546 | |
parent | 7ddaac7fcb01eed38692f1bfa81f5f4348d848d7 (diff) |
V4L/DVB: gspca - sn9c20x: Add support for cameras using the MT9M112 sensor
Adds the following models:
- 0c45:624c
- 0c45:628c
- 0458:704a
- 0458:704c
Signed-off-by: Brian Johnson <brijohn@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | Documentation/video4linux/gspca.txt | 4 | ||||
-rw-r--r-- | drivers/media/video/gspca/sn9c20x.c | 44 |
2 files changed, 45 insertions, 3 deletions
diff --git a/Documentation/video4linux/gspca.txt b/Documentation/video4linux/gspca.txt index 9475e1e14411..8f3f5d33327c 100644 --- a/Documentation/video4linux/gspca.txt +++ b/Documentation/video4linux/gspca.txt | |||
@@ -50,6 +50,8 @@ zc3xx 0458:700f Genius VideoCam Web V2 | |||
50 | sonixj 0458:7025 Genius Eye 311Q | 50 | sonixj 0458:7025 Genius Eye 311Q |
51 | sn9c20x 0458:7029 Genius Look 320s | 51 | sn9c20x 0458:7029 Genius Look 320s |
52 | sonixj 0458:702e Genius Slim 310 NB | 52 | sonixj 0458:702e Genius Slim 310 NB |
53 | sn9c20x 0458:704a Genius Slim 1320 | ||
54 | sn9c20x 0458:704c Genius i-Look 1321 | ||
53 | sn9c20x 045e:00f4 LifeCam VX-6000 (SN9C20x + OV9650) | 55 | sn9c20x 045e:00f4 LifeCam VX-6000 (SN9C20x + OV9650) |
54 | sonixj 045e:00f5 MicroSoft VX3000 | 56 | sonixj 045e:00f5 MicroSoft VX3000 |
55 | sonixj 045e:00f7 MicroSoft VX1000 | 57 | sonixj 045e:00f7 MicroSoft VX1000 |
@@ -312,6 +314,7 @@ sonixj 0c45:614a Frontech E-Ccam (JIL-2225) | |||
312 | sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) | 314 | sn9c20x 0c45:6240 PC Camera (SN9C201 + MT9M001) |
313 | sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) | 315 | sn9c20x 0c45:6242 PC Camera (SN9C201 + MT9M111) |
314 | sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) | 316 | sn9c20x 0c45:6248 PC Camera (SN9C201 + OV9655) |
317 | sn9c20x 0c45:624c PC Camera (SN9C201 + MT9M112) | ||
315 | sn9c20x 0c45:624e PC Camera (SN9C201 + SOI968) | 318 | sn9c20x 0c45:624e PC Camera (SN9C201 + SOI968) |
316 | sn9c20x 0c45:624f PC Camera (SN9C201 + OV9650) | 319 | sn9c20x 0c45:624f PC Camera (SN9C201 + OV9650) |
317 | sn9c20x 0c45:6251 PC Camera (SN9C201 + OV9650) | 320 | sn9c20x 0c45:6251 PC Camera (SN9C201 + OV9650) |
@@ -324,6 +327,7 @@ sn9c20x 0c45:627f PC Camera (SN9C201 + OV9650) | |||
324 | sn9c20x 0c45:6280 PC Camera (SN9C202 + MT9M001) | 327 | sn9c20x 0c45:6280 PC Camera (SN9C202 + MT9M001) |
325 | sn9c20x 0c45:6282 PC Camera (SN9C202 + MT9M111) | 328 | sn9c20x 0c45:6282 PC Camera (SN9C202 + MT9M111) |
326 | sn9c20x 0c45:6288 PC Camera (SN9C202 + OV9655) | 329 | sn9c20x 0c45:6288 PC Camera (SN9C202 + OV9655) |
330 | sn9c20x 0c45:628c PC Camera (SN9C201 + MT9M112) | ||
327 | sn9c20x 0c45:628e PC Camera (SN9C202 + SOI968) | 331 | sn9c20x 0c45:628e PC Camera (SN9C202 + SOI968) |
328 | sn9c20x 0c45:628f PC Camera (SN9C202 + OV9650) | 332 | sn9c20x 0c45:628f PC Camera (SN9C202 + OV9650) |
329 | sn9c20x 0c45:62a0 PC Camera (SN9C202 + OV7670) | 333 | sn9c20x 0c45:62a0 PC Camera (SN9C202 + OV7670) |
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index 06c75dbecaee..479fdbb9e673 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
@@ -50,7 +50,8 @@ MODULE_LICENSE("GPL"); | |||
50 | #define SENSOR_MT9V112 7 | 50 | #define SENSOR_MT9V112 7 |
51 | #define SENSOR_MT9M001 8 | 51 | #define SENSOR_MT9M001 8 |
52 | #define SENSOR_MT9M111 9 | 52 | #define SENSOR_MT9M111 9 |
53 | #define SENSOR_HV7131R 10 | 53 | #define SENSOR_MT9M112 10 |
54 | #define SENSOR_HV7131R 11 | ||
54 | #define SENSOR_MT9VPRB 20 | 55 | #define SENSOR_MT9VPRB 20 |
55 | 56 | ||
56 | /* camera flags */ | 57 | /* camera flags */ |
@@ -731,6 +732,7 @@ static u16 i2c_ident[] = { | |||
731 | V4L2_IDENT_MT9V112, | 732 | V4L2_IDENT_MT9V112, |
732 | V4L2_IDENT_MT9M001C12ST, | 733 | V4L2_IDENT_MT9M001C12ST, |
733 | V4L2_IDENT_MT9M111, | 734 | V4L2_IDENT_MT9M111, |
735 | V4L2_IDENT_MT9M112, | ||
734 | V4L2_IDENT_HV7131R, | 736 | V4L2_IDENT_HV7131R, |
735 | }; | 737 | }; |
736 | 738 | ||
@@ -1062,6 +1064,13 @@ static struct i2c_reg_u16 mt9m111_init[] = { | |||
1062 | {0xf0, 0x0000}, | 1064 | {0xf0, 0x0000}, |
1063 | }; | 1065 | }; |
1064 | 1066 | ||
1067 | static struct i2c_reg_u16 mt9m112_init[] = { | ||
1068 | {0xf0, 0x0000}, {0x0d, 0x0021}, {0x0d, 0x0008}, | ||
1069 | {0xf0, 0x0001}, {0x3a, 0x4300}, {0x9b, 0x4300}, | ||
1070 | {0x06, 0x708e}, {0xf0, 0x0002}, {0x2e, 0x0a1e}, | ||
1071 | {0xf0, 0x0000}, | ||
1072 | }; | ||
1073 | |||
1065 | static struct i2c_reg_u8 hv7131r_init[] = { | 1074 | static struct i2c_reg_u8 hv7131r_init[] = { |
1066 | {0x02, 0x08}, {0x02, 0x00}, {0x01, 0x08}, | 1075 | {0x02, 0x08}, {0x02, 0x00}, {0x01, 0x08}, |
1067 | {0x02, 0x00}, {0x20, 0x00}, {0x21, 0xd0}, | 1076 | {0x02, 0x00}, {0x20, 0x00}, {0x21, 0xd0}, |
@@ -1388,6 +1397,23 @@ static int mt9v_init_sensor(struct gspca_dev *gspca_dev) | |||
1388 | return -ENODEV; | 1397 | return -ENODEV; |
1389 | } | 1398 | } |
1390 | 1399 | ||
1400 | static int mt9m112_init_sensor(struct gspca_dev *gspca_dev) | ||
1401 | { | ||
1402 | struct sd *sd = (struct sd *) gspca_dev; | ||
1403 | int i; | ||
1404 | for (i = 0; i < ARRAY_SIZE(mt9m112_init); i++) { | ||
1405 | if (i2c_w2(gspca_dev, mt9m112_init[i].reg, | ||
1406 | mt9m112_init[i].val) < 0) { | ||
1407 | err("MT9M112 sensor initialization failed"); | ||
1408 | return -ENODEV; | ||
1409 | } | ||
1410 | } | ||
1411 | gspca_dev->ctrl_dis = (1 << EXPOSURE_IDX) | (1 << AUTOGAIN_IDX) | (1 << GAIN_IDX); | ||
1412 | sd->hstart = 0; | ||
1413 | sd->vstart = 2; | ||
1414 | return 0; | ||
1415 | } | ||
1416 | |||
1391 | static int mt9m111_init_sensor(struct gspca_dev *gspca_dev) | 1417 | static int mt9m111_init_sensor(struct gspca_dev *gspca_dev) |
1392 | { | 1418 | { |
1393 | struct sd *sd = (struct sd *) gspca_dev; | 1419 | struct sd *sd = (struct sd *) gspca_dev; |
@@ -1553,6 +1579,7 @@ static int set_hvflip(struct gspca_dev *gspca_dev) | |||
1553 | value2 |= 0x4020; | 1579 | value2 |= 0x4020; |
1554 | i2c_w2(gspca_dev, 0x20, value2); | 1580 | i2c_w2(gspca_dev, 0x20, value2); |
1555 | break; | 1581 | break; |
1582 | case SENSOR_MT9M112: | ||
1556 | case SENSOR_MT9M111: | 1583 | case SENSOR_MT9M111: |
1557 | case SENSOR_MT9V112: | 1584 | case SENSOR_MT9V112: |
1558 | i2c_r2(gspca_dev, 0x20, &value2); | 1585 | i2c_r2(gspca_dev, 0x20, &value2); |
@@ -1878,7 +1905,7 @@ static int sd_dbg_g_register(struct gspca_dev *gspca_dev, | |||
1878 | if (reg->match.addr != sd->i2c_addr) | 1905 | if (reg->match.addr != sd->i2c_addr) |
1879 | return -EINVAL; | 1906 | return -EINVAL; |
1880 | if (sd->sensor >= SENSOR_MT9V011 && | 1907 | if (sd->sensor >= SENSOR_MT9V011 && |
1881 | sd->sensor <= SENSOR_MT9M111) { | 1908 | sd->sensor <= SENSOR_MT9M112) { |
1882 | if (i2c_r2(gspca_dev, reg->reg, (u16 *)®->val) < 0) | 1909 | if (i2c_r2(gspca_dev, reg->reg, (u16 *)®->val) < 0) |
1883 | return -EINVAL; | 1910 | return -EINVAL; |
1884 | } else { | 1911 | } else { |
@@ -1907,7 +1934,7 @@ static int sd_dbg_s_register(struct gspca_dev *gspca_dev, | |||
1907 | if (reg->match.addr != sd->i2c_addr) | 1934 | if (reg->match.addr != sd->i2c_addr) |
1908 | return -EINVAL; | 1935 | return -EINVAL; |
1909 | if (sd->sensor >= SENSOR_MT9V011 && | 1936 | if (sd->sensor >= SENSOR_MT9V011 && |
1910 | sd->sensor <= SENSOR_MT9M111) { | 1937 | sd->sensor <= SENSOR_MT9M112) { |
1911 | if (i2c_w2(gspca_dev, reg->reg, reg->val) < 0) | 1938 | if (i2c_w2(gspca_dev, reg->reg, reg->val) < 0) |
1912 | return -EINVAL; | 1939 | return -EINVAL; |
1913 | } else { | 1940 | } else { |
@@ -1955,6 +1982,7 @@ static int sd_config(struct gspca_dev *gspca_dev, | |||
1955 | sd->flags = (id->driver_info >> 16) & 0xff; | 1982 | sd->flags = (id->driver_info >> 16) & 0xff; |
1956 | 1983 | ||
1957 | switch (sd->sensor) { | 1984 | switch (sd->sensor) { |
1985 | case SENSOR_MT9M112: | ||
1958 | case SENSOR_MT9M111: | 1986 | case SENSOR_MT9M111: |
1959 | case SENSOR_OV9650: | 1987 | case SENSOR_OV9650: |
1960 | case SENSOR_SOI968: | 1988 | case SENSOR_SOI968: |
@@ -2051,6 +2079,11 @@ static int sd_init(struct gspca_dev *gspca_dev) | |||
2051 | return -ENODEV; | 2079 | return -ENODEV; |
2052 | info("MT9M111 sensor detected"); | 2080 | info("MT9M111 sensor detected"); |
2053 | break; | 2081 | break; |
2082 | case SENSOR_MT9M112: | ||
2083 | if (mt9m112_init_sensor(gspca_dev) < 0) | ||
2084 | return -ENODEV; | ||
2085 | info("MT9M112 sensor detected"); | ||
2086 | break; | ||
2054 | case SENSOR_MT9M001: | 2087 | case SENSOR_MT9M001: |
2055 | if (mt9m001_init_sensor(gspca_dev) < 0) | 2088 | if (mt9m001_init_sensor(gspca_dev) < 0) |
2056 | return -ENODEV; | 2089 | return -ENODEV; |
@@ -2110,6 +2143,7 @@ static void configure_sensor_output(struct gspca_dev *gspca_dev, int mode) | |||
2110 | i2c_w1(gspca_dev, 0x12, (value & 0x7) | 0x40); | 2143 | i2c_w1(gspca_dev, 0x12, (value & 0x7) | 0x40); |
2111 | } | 2144 | } |
2112 | break; | 2145 | break; |
2146 | case SENSOR_MT9M112: | ||
2113 | case SENSOR_MT9M111: | 2147 | case SENSOR_MT9M111: |
2114 | if (mode & MODE_SXGA) { | 2148 | if (mode & MODE_SXGA) { |
2115 | i2c_w2(gspca_dev, 0xf0, 0x0002); | 2149 | i2c_w2(gspca_dev, 0xf0, 0x0002); |
@@ -2399,6 +2433,7 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
2399 | {USB_DEVICE(0x0c45, 0x6240), SN9C20X(MT9M001, 0x5d, 0)}, | 2433 | {USB_DEVICE(0x0c45, 0x6240), SN9C20X(MT9M001, 0x5d, 0)}, |
2400 | {USB_DEVICE(0x0c45, 0x6242), SN9C20X(MT9M111, 0x5d, 0)}, | 2434 | {USB_DEVICE(0x0c45, 0x6242), SN9C20X(MT9M111, 0x5d, 0)}, |
2401 | {USB_DEVICE(0x0c45, 0x6248), SN9C20X(OV9655, 0x30, 0)}, | 2435 | {USB_DEVICE(0x0c45, 0x6248), SN9C20X(OV9655, 0x30, 0)}, |
2436 | {USB_DEVICE(0x0c45, 0x624c), SN9C20X(MT9M112, 0x5d, 0)}, | ||
2402 | {USB_DEVICE(0x0c45, 0x624e), SN9C20X(SOI968, 0x30, | 2437 | {USB_DEVICE(0x0c45, 0x624e), SN9C20X(SOI968, 0x30, |
2403 | (HAS_BUTTON | LED_REVERSE))}, | 2438 | (HAS_BUTTON | LED_REVERSE))}, |
2404 | {USB_DEVICE(0x0c45, 0x624f), SN9C20X(OV9650, 0x30, FLIP_DETECT)}, | 2439 | {USB_DEVICE(0x0c45, 0x624f), SN9C20X(OV9650, 0x30, FLIP_DETECT)}, |
@@ -2412,6 +2447,7 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
2412 | {USB_DEVICE(0x0c45, 0x6280), SN9C20X(MT9M001, 0x5d, 0)}, | 2447 | {USB_DEVICE(0x0c45, 0x6280), SN9C20X(MT9M001, 0x5d, 0)}, |
2413 | {USB_DEVICE(0x0c45, 0x6282), SN9C20X(MT9M111, 0x5d, 0)}, | 2448 | {USB_DEVICE(0x0c45, 0x6282), SN9C20X(MT9M111, 0x5d, 0)}, |
2414 | {USB_DEVICE(0x0c45, 0x6288), SN9C20X(OV9655, 0x30, HAS_BUTTON)}, | 2449 | {USB_DEVICE(0x0c45, 0x6288), SN9C20X(OV9655, 0x30, HAS_BUTTON)}, |
2450 | {USB_DEVICE(0x0c45, 0x628c), SN9C20X(MT9M112, 0x5d, 0)}, | ||
2415 | {USB_DEVICE(0x0c45, 0x628e), SN9C20X(SOI968, 0x30, 0)}, | 2451 | {USB_DEVICE(0x0c45, 0x628e), SN9C20X(SOI968, 0x30, 0)}, |
2416 | {USB_DEVICE(0x0c45, 0x628f), SN9C20X(OV9650, 0x30, 0)}, | 2452 | {USB_DEVICE(0x0c45, 0x628f), SN9C20X(OV9650, 0x30, 0)}, |
2417 | {USB_DEVICE(0x0c45, 0x62a0), SN9C20X(OV7670, 0x21, 0)}, | 2453 | {USB_DEVICE(0x0c45, 0x62a0), SN9C20X(OV7670, 0x21, 0)}, |
@@ -2422,6 +2458,8 @@ static const __devinitdata struct usb_device_id device_table[] = { | |||
2422 | {USB_DEVICE(0x045e, 0x00f4), SN9C20X(OV9650, 0x30, 0)}, | 2458 | {USB_DEVICE(0x045e, 0x00f4), SN9C20X(OV9650, 0x30, 0)}, |
2423 | {USB_DEVICE(0x145f, 0x013d), SN9C20X(OV7660, 0x21, 0)}, | 2459 | {USB_DEVICE(0x145f, 0x013d), SN9C20X(OV7660, 0x21, 0)}, |
2424 | {USB_DEVICE(0x0458, 0x7029), SN9C20X(HV7131R, 0x11, 0)}, | 2460 | {USB_DEVICE(0x0458, 0x7029), SN9C20X(HV7131R, 0x11, 0)}, |
2461 | {USB_DEVICE(0x0458, 0x704a), SN9C20X(MT9M112, 0x5d, 0)}, | ||
2462 | {USB_DEVICE(0x0458, 0x704c), SN9C20X(MT9M112, 0x5d, 0)}, | ||
2425 | {USB_DEVICE(0xa168, 0x0610), SN9C20X(HV7131R, 0x11, 0)}, | 2463 | {USB_DEVICE(0xa168, 0x0610), SN9C20X(HV7131R, 0x11, 0)}, |
2426 | {USB_DEVICE(0xa168, 0x0611), SN9C20X(HV7131R, 0x11, 0)}, | 2464 | {USB_DEVICE(0xa168, 0x0611), SN9C20X(HV7131R, 0x11, 0)}, |
2427 | {USB_DEVICE(0xa168, 0x0613), SN9C20X(HV7131R, 0x11, 0)}, | 2465 | {USB_DEVICE(0xa168, 0x0613), SN9C20X(HV7131R, 0x11, 0)}, |