@@ -1778,6 +1778,46 @@ static inline void em28xx_set_model(stru
EM28XX_I2C_FREQ_100_KHZ;
}
+/* FIXME: Should be replaced by a proper mt9m001 driver */
+static int em28xx_initialize_mt9m001(struct em28xx *dev)
+{
+ int i;
+ unsigned char regs[][3] = {
+ { 0x0d, 0x00, 0x01 },
+ { 0x0d, 0x00, 0x00 },
+ { 0x01, 0x00, 0x08 }, /* ROWSTART */
+ { 0x02, 0x00, 0x14 }, /* COLSTART */
+ { 0x03, 0x01, 0xe0 }, /* WINDOW HEIGHT */
+ { 0x04, 0x02, 0x80 }, /* WINDOW WIDTH */
+ { 0x05, 0x00, 0x01 }, /* HORIZONTAL BLANKING */
+ { 0x06, 0x00, 0x01 }, /* VERTICAL BLANKING */
+ { 0x0d, 0x00, 0x02 },
+ { 0x0a, 0x00, 0x00 },
+ { 0x0c, 0x00, 0x00 },
+ { 0x11, 0x00, 0x00 },
+ { 0x1e, 0x80, 0x00 },
+ { 0x5f, 0x89, 0x04 },
+ { 0x60, 0x00, 0x00 },
+ { 0x61, 0x00, 0x00 },
+ { 0x62, 0x04, 0x98 },
+ { 0x63, 0x00, 0x00 },
+ { 0x64, 0x00, 0x00 },
+ { 0x20, 0x11, 0x1d },
+ { 0x06, 0x00, 0xf2 },
+ { 0x05, 0x00, 0x13 },
+ { 0x09, 0x10, 0xf2 },
+ { 0x07, 0x00, 0x03 },
+ { 0x2b, 0x00, 0x2a },
+ { 0x2d, 0x00, 0x2a },
+ { 0x2c, 0x00, 0x2a },
+ { 0x2e, 0x00, 0x29 },
+ { 0x07, 0x00, 0x02 },
+ };
+
+ for (i = 0; i < ARRAY_SIZE(regs); i++)
+ i2c_master_send(&dev->i2c_client, ®s[i][0], 3);
+}
+
/* HINT method: webcam I2C chips
*
* This method work for webcams with Micron sensors
@@ -1809,6 +1849,14 @@ static int em28xx_hint_sensor(struct em2
sensor_name = "mt9v011";
dev->em28xx_sensor = EM28XX_MT9V011;
break;
+ case 0x8411:
+ case 0x8421:
+ case 0x8431:
+ dev->model = EM2750_BOARD_UNKNOWN;
+ sensor_name = "mt9m001";
+ dev->em28xx_sensor = EM28XX_MT9M001;
+ em28xx_initialize_mt9m001(dev);
+ break;
default:
printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version));
return -EINVAL;
@@ -2376,6 +2424,13 @@ void em28xx_card_setup(struct em28xx *de
v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
"mt9v011", "mt9v011", mt9v011_addrs);
+#if 0
+ /* FIXME: use mt9m001 after their conversion to v4l dev/subdev */
+ if (dev->em28xx_sensor == EM28XX_MT9M001)
+ v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
+ "mt9m001", "mt9m001", mt9v011_addrs);
+#endif
+
if (dev->board.adecoder == EM28XX_TVAUDIO)
v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
"tvaudio", "tvaudio", dev->board.tvaudio_addr);
@@ -367,6 +367,7 @@ enum em28xx_decoder {
enum em28xx_sensor {
EM28XX_NOSENSOR = 0,
EM28XX_MT9V011,
+ EM28XX_MT9M001,
};
enum em28xx_adecoder {