aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-06-29 10:35:05 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-05 13:30:05 -0400
commit02e7804b2135ff941b8846f5820cf48fbfdadd54 (patch)
tree58d3e596946d4c6b1bae23465f5d9b80e893d300 /drivers/media/video/em28xx/em28xx-cards.c
parent6934e6fface7b7d5fe7e578c3f43cbe8f23af2d4 (diff)
V4L/DVB (12138): em28xx: add support for Silvercrest Webcam
This webcam uses a em2710 chipset, that identifies itself as em2820, plus a mt9v011 sensor, and a DY-301P lens. It needs a few different initializations than a normal em28xx device. Thanks to Hans de Goede <hdegoede@redhat.com> and Douglas Landgraf <dougsland@redhat.com> for providing the acces for the webcam during this weekend, I could make a patch for it while returning back from FISL/Fudcom LATAM 2009. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index c43fdb9bc888..bd9b637c7ea5 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -191,6 +191,13 @@ static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
191 {EM28XX_R08_GPIO, 0xff, 0xff, 10}, 191 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
192 { -1, -1, -1, -1}, 192 { -1, -1, -1, -1},
193}; 193};
194
195static struct em28xx_reg_seq silvercrest_reg_seq[] = {
196 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
197 {EM28XX_R08_GPIO, 0x01, 0xf7, 10},
198 { -1, -1, -1, -1},
199};
200
194/* 201/*
195 * Board definitions 202 * Board definitions
196 */ 203 */
@@ -438,6 +445,18 @@ struct em28xx_board em28xx_boards[] = {
438 .amux = EM28XX_AMUX_VIDEO, 445 .amux = EM28XX_AMUX_VIDEO,
439 } }, 446 } },
440 }, 447 },
448 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
449 .name = "Silvercrest Webcam 1.3mpix",
450 .tuner_type = TUNER_ABSENT,
451 .is_27xx = 1,
452 .decoder = EM28XX_MT9V011,
453 .input = { {
454 .type = EM28XX_VMUX_COMPOSITE1,
455 .vmux = 0,
456 .amux = EM28XX_AMUX_VIDEO,
457 .gpio = silvercrest_reg_seq,
458 } },
459 },
441 [EM2821_BOARD_SUPERCOMP_USB_2] = { 460 [EM2821_BOARD_SUPERCOMP_USB_2] = {
442 .name = "Supercomp USB 2.0 TV", 461 .name = "Supercomp USB 2.0 TV",
443 .valid = EM28XX_BOARD_NOT_VALIDATED, 462 .valid = EM28XX_BOARD_NOT_VALIDATED,
@@ -1639,6 +1658,11 @@ static unsigned short tvp5150_addrs[] = {
1639 I2C_CLIENT_END 1658 I2C_CLIENT_END
1640}; 1659};
1641 1660
1661static unsigned short mt9v011_addrs[] = {
1662 0xba >> 1,
1663 I2C_CLIENT_END
1664};
1665
1642static unsigned short msp3400_addrs[] = { 1666static unsigned short msp3400_addrs[] = {
1643 0x80 >> 1, 1667 0x80 >> 1,
1644 0x88 >> 1, 1668 0x88 >> 1,
@@ -1706,7 +1730,10 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1706 em28xx_info("chip ID is em2750\n"); 1730 em28xx_info("chip ID is em2750\n");
1707 break; 1731 break;
1708 case CHIP_ID_EM2820: 1732 case CHIP_ID_EM2820:
1709 em28xx_info("chip ID is em2820\n"); 1733 if (dev->board.is_27xx)
1734 em28xx_info("chip is em2710\n");
1735 else
1736 em28xx_info("chip ID is em2820\n");
1710 break; 1737 break;
1711 case CHIP_ID_EM2840: 1738 case CHIP_ID_EM2840:
1712 em28xx_info("chip ID is em2840\n"); 1739 em28xx_info("chip ID is em2840\n");
@@ -2158,6 +2185,10 @@ void em28xx_card_setup(struct em28xx *dev)
2158 before probing the i2c bus. */ 2185 before probing the i2c bus. */
2159 em28xx_set_mode(dev, EM28XX_ANALOG_MODE); 2186 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2160 break; 2187 break;
2188 case EM2820_BOARD_SILVERCREST_WEBCAM:
2189 /* FIXME: need to document the registers bellow */
2190 em28xx_write_reg(dev, 0x0d, 0x42);
2191 em28xx_write_reg(dev, 0x13, 0x08);
2161 } 2192 }
2162 2193
2163 if (dev->board.has_snapshot_button) 2194 if (dev->board.has_snapshot_button)
@@ -2189,6 +2220,10 @@ void em28xx_card_setup(struct em28xx *dev)
2189 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, 2220 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2190 "tvp5150", "tvp5150", tvp5150_addrs); 2221 "tvp5150", "tvp5150", tvp5150_addrs);
2191 2222
2223 if (dev->board.decoder == EM28XX_MT9V011)
2224 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2225 "mt9v011", "mt9v011", mt9v011_addrs);
2226
2192 if (dev->board.adecoder == EM28XX_TVAUDIO) 2227 if (dev->board.adecoder == EM28XX_TVAUDIO)
2193 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, 2228 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2194 "tvaudio", "tvaudio", dev->board.tvaudio_addr); 2229 "tvaudio", "tvaudio", dev->board.tvaudio_addr);