summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-08-28 08:25:29 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-08-28 08:25:29 -0300
commite245654ef43894a4082ea1538c03e9e5cc865f9c (patch)
treefb05766955ec51cad16c2d1c8924266d0841af0d /linux/drivers/media/video/saa7115.c
parentc0ed3442e926ec304d6d231bfaa66d5e2e53059c (diff)
downloadmediapointer-dvb-s2-e245654ef43894a4082ea1538c03e9e5cc865f9c.tar.gz
mediapointer-dvb-s2-e245654ef43894a4082ea1538c03e9e5cc865f9c.tar.bz2
Make saa7115 to report the complete chipset name
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/saa7115.c')
-rw-r--r--linux/drivers/media/video/saa7115.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/linux/drivers/media/video/saa7115.c b/linux/drivers/media/video/saa7115.c
index fdfea3f16..9abb35c09 100644
--- a/linux/drivers/media/video/saa7115.c
+++ b/linux/drivers/media/video/saa7115.c
@@ -1326,6 +1326,8 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
{
struct i2c_client *client;
struct saa7115_state *state;
+ int i;
+ char name[17];
u8 chip_id;
/* Check if the adapter supports the needed features */
@@ -1345,6 +1347,14 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1);
+ for (i=0;i<0x0f;i++) {
+ saa7115_write(client, 0, i);
+ name[i] = (saa7115_read(client, 0) &0x0f) +'0';
+ if (name[i]>'9')
+ name[i]+='a'-'9'-1;
+ }
+ name[i]='\0';
+
saa7115_write(client, 0, 5);
chip_id = saa7115_read(client, 0) & 0x0f;
if (chip_id < 3 && chip_id > 5) {
@@ -1353,7 +1363,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
return 0;
}
snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id);
- v4l_info(client, "saa711%d found @ 0x%x (%s)\n", chip_id, address << 1, adapter->name);
+ v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, address << 1, adapter->name);
state = kzalloc(sizeof(struct saa7115_state), GFP_KERNEL);
i2c_set_clientdata(client, state);