Skip to content

Commit

Permalink
V4L/DVB (12340): mtv9v011: Add a missing chip version to the driver
Browse files Browse the repository at this point in the history
Some mt9v011 webcams report 0x8332 chip version, instead of 0x8243. From
the revision history at the mt9v011 datasheet, it seems that the chip
version has changed from the first release of the chip.

Thanks-to hermann pitton <hermann-pitton@arcor.de> for pointing this to
me, on his tests with a Silvercrest webcam.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Aug 13, 2009
1 parent 225aeb1 commit 296544e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion drivers/media/video/em28xx/em28xx-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,8 @@ static int em28xx_hint_sensor(struct em28xx *dev)
version = be16_to_cpu(version_be);

switch (version) {
case 0x8243: /* mt9v011 640x480 1.3 Mpix sensor */
case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
sensor_name = "mt9v011";
dev->em28xx_sensor = EM28XX_MT9V011;
Expand Down
14 changes: 9 additions & 5 deletions drivers/media/video/mt9v011.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,13 @@ static int mt9v011_s_register(struct v4l2_subdev *sd,
static int mt9v011_g_chip_ident(struct v4l2_subdev *sd,
struct v4l2_dbg_chip_ident *chip)
{
u16 version;
struct i2c_client *client = v4l2_get_subdevdata(sd);

version = mt9v011_read(sd, R00_MT9V011_CHIP_VERSION);

return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_MT9V011,
MT9V011_VERSION);
version);
}

static const struct v4l2_subdev_core_ops mt9v011_core_ops = {
Expand Down Expand Up @@ -449,8 +452,9 @@ static int mt9v011_probe(struct i2c_client *c,

/* Check if the sensor is really a MT9V011 */
version = mt9v011_read(sd, R00_MT9V011_CHIP_VERSION);
if (version != MT9V011_VERSION) {
v4l2_info(sd, "*** unknown micron chip detected (0x%04x.\n",
if ((version != MT9V011_VERSION) &&
(version != MT9V011_REV_B_VERSION)) {
v4l2_info(sd, "*** unknown micron chip detected (0x%04x).\n",
version);
kfree(core);
return -EINVAL;
Expand All @@ -461,8 +465,8 @@ static int mt9v011_probe(struct i2c_client *c,
core->height = 480;
core->xtal = 27000000; /* Hz */

v4l_info(c, "chip found @ 0x%02x (%s)\n",
c->addr << 1, c->adapter->name);
v4l_info(c, "chip found @ 0x%02x (%s - chip version 0x%04x)\n",
c->addr << 1, c->adapter->name, version);

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/media/video/mt9v011.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define R35_MT9V011_GLOBAL_GAIN 0x35
#define RF1_MT9V011_CHIP_ENABLE 0xf1

#define MT9V011_VERSION 0x8243
#define MT9V011_VERSION 0x8232
#define MT9V011_REV_B_VERSION 0x8243

#endif

0 comments on commit 296544e

Please sign in to comment.