mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
V4L/DVB (12340): mtv9v011: Add a missing chip version to the driver
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>
This commit is contained in:
parent
225aeb1c58
commit
296544e15a
3 changed files with 13 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -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 = {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue