diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2006-11-25 07:40:28 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-11-26 05:52:38 -0500 |
commit | f7668162a366d1ce0fe84122d11108e13a8ce950 (patch) | |
tree | fd3fce8d8f56af9612ae1d9e3d117b2c6af557e5 /drivers/media/video/saa7115.c | |
parent | 5718bbd2d92b9c2aa2f5700e4d3ed9d72f72f47e (diff) |
V4L/DVB (4885): Improve saa711x check
The old code would accept any device on the same i2c address as the
saa711x chips as an saa711x. However, this fails with saa717x chips,
which use that same address and so are misdetected as a saa7111. Now
check whether the chip is really a saa711x model.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r-- | drivers/media/video/saa7115.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index c5719f7bd1ac..f28398dd9d93 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c | |||
@@ -1464,8 +1464,6 @@ static int saa711x_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1464 | client->driver = &i2c_driver_saa711x; | 1464 | client->driver = &i2c_driver_saa711x; |
1465 | snprintf(client->name, sizeof(client->name) - 1, "saa7115"); | 1465 | snprintf(client->name, sizeof(client->name) - 1, "saa7115"); |
1466 | 1466 | ||
1467 | v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1); | ||
1468 | |||
1469 | for (i=0;i<0x0f;i++) { | 1467 | for (i=0;i<0x0f;i++) { |
1470 | saa711x_write(client, 0, i); | 1468 | saa711x_write(client, 0, i); |
1471 | name[i] = (saa711x_read(client, 0) &0x0f) +'0'; | 1469 | name[i] = (saa711x_read(client, 0) &0x0f) +'0'; |
@@ -1477,6 +1475,13 @@ static int saa711x_attach(struct i2c_adapter *adapter, int address, int kind) | |||
1477 | saa711x_write(client, 0, 5); | 1475 | saa711x_write(client, 0, 5); |
1478 | chip_id = saa711x_read(client, 0) & 0x0f; | 1476 | chip_id = saa711x_read(client, 0) & 0x0f; |
1479 | 1477 | ||
1478 | /* Check whether this chip is part of the saa711x series */ | ||
1479 | if (memcmp(name, "1f711", 5)) { | ||
1480 | v4l_dbg(1, debug, client, "chip found @ 0x%x (ID %s) does not match a known saa711x chip.\n", | ||
1481 | address << 1, name); | ||
1482 | return 0; | ||
1483 | } | ||
1484 | |||
1480 | snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id); | 1485 | snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id); |
1481 | v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, address << 1, adapter->name); | 1486 | v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, address << 1, adapter->name); |
1482 | 1487 | ||