aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-07-14 20:08:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-24 13:03:26 -0400
commitb80fd2d811b48a92051f86d257b00f373e69a6d7 (patch)
tree63f6959bdd6f041e259242d59ca12d3e9c32cd93 /drivers/media
parent579d315218e8a3f696e375c5f6917da6488bec8a (diff)
V4L/DVB (12245): em28xx: add support for mt9m001 webcams
Thanks to Wally <wally@voosen.eu> for bringing the issue and helping with the tests. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c41
-rw-r--r--drivers/media/video/em28xx/em28xx.h1
2 files changed, 42 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index e793aee16726..1bd789a52e63 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -211,6 +211,7 @@ struct em28xx_board em28xx_boards[] = {
211 .type = EM28XX_VMUX_COMPOSITE1, 211 .type = EM28XX_VMUX_COMPOSITE1,
212 .vmux = 0, 212 .vmux = 0,
213 .amux = EM28XX_AMUX_VIDEO, 213 .amux = EM28XX_AMUX_VIDEO,
214 .gpio = silvercrest_reg_seq,
214 } }, 215 } },
215 }, 216 },
216 [EM2800_BOARD_UNKNOWN] = { 217 [EM2800_BOARD_UNKNOWN] = {
@@ -1706,6 +1707,32 @@ static inline void em28xx_set_model(struct em28xx *dev)
1706 EM28XX_I2C_FREQ_100_KHZ; 1707 EM28XX_I2C_FREQ_100_KHZ;
1707} 1708}
1708 1709
1710/* FIXME: Should be replaced by a proper mt9m001 driver */
1711static int em28xx_initialize_mt9m001(struct em28xx *dev)
1712{
1713 int i;
1714 unsigned char regs[][3] = {
1715 { 0x0d, 0x00, 0x01, },
1716 { 0x0d, 0x00, 0x00, },
1717 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
1718 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
1719 { 0x20, 0x11, 0x00, },
1720 { 0x06, 0x00, 0x10, },
1721 { 0x2b, 0x00, 0x24, },
1722 { 0x2e, 0x00, 0x24, },
1723 { 0x35, 0x00, 0x24, },
1724 { 0x2d, 0x00, 0x20, },
1725 { 0x2c, 0x00, 0x20, },
1726 { 0x09, 0x0a, 0xd4, },
1727 { 0x35, 0x00, 0x57, },
1728 };
1729
1730 for (i = 0; i < ARRAY_SIZE(regs); i++)
1731 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
1732
1733 return 0;
1734}
1735
1709/* HINT method: webcam I2C chips 1736/* HINT method: webcam I2C chips
1710 * 1737 *
1711 * This method work for webcams with Micron sensors 1738 * This method work for webcams with Micron sensors
@@ -1741,6 +1768,19 @@ static int em28xx_hint_sensor(struct em28xx *dev)
1741 dev->vinctl = 0x00; 1768 dev->vinctl = 0x00;
1742 1769
1743 break; 1770 break;
1771 case 0x8431:
1772 dev->model = EM2750_BOARD_UNKNOWN;
1773 sensor_name = "mt9m001";
1774 dev->em28xx_sensor = EM28XX_MT9M001;
1775 em28xx_initialize_mt9m001(dev);
1776 dev->sensor_xres = 1280;
1777 dev->sensor_yres = 1024;
1778
1779 /* probably means BGGR 16 bit bayer */
1780 dev->vinmode = 0x0c;
1781 dev->vinctl = 0x00;
1782
1783 break;
1744 default: 1784 default:
1745 printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version)); 1785 printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version));
1746 return -EINVAL; 1786 return -EINVAL;
@@ -2275,6 +2315,7 @@ void em28xx_card_setup(struct em28xx *dev)
2275 v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal); 2315 v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal);
2276 } 2316 }
2277 2317
2318
2278 if (dev->board.adecoder == EM28XX_TVAUDIO) 2319 if (dev->board.adecoder == EM28XX_TVAUDIO)
2279 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, 2320 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2280 "tvaudio", "tvaudio", dev->board.tvaudio_addr); 2321 "tvaudio", "tvaudio", dev->board.tvaudio_addr);
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 766ab59b8d59..45bd513f62dc 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -366,6 +366,7 @@ enum em28xx_decoder {
366enum em28xx_sensor { 366enum em28xx_sensor {
367 EM28XX_NOSENSOR = 0, 367 EM28XX_NOSENSOR = 0,
368 EM28XX_MT9V011, 368 EM28XX_MT9V011,
369 EM28XX_MT9M001,
369}; 370};
370 371
371enum em28xx_adecoder { 372enum em28xx_adecoder {