aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-08-28 07:25:29 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 11:30:34 -0400
commit236f16d241e16b269cd00ef0116975882f498be5 (patch)
treed49e3e780c490e2f165224568655dd63ceff26e4
parent44b579d63678609a16265a0acdb6405fafd173d6 (diff)
V4L/DVB (4550): Make saa7115 to report the complete chipset name
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/saa7115.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index b59c11717273..e5558c920860 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1308,6 +1308,8 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
1308{ 1308{
1309 struct i2c_client *client; 1309 struct i2c_client *client;
1310 struct saa7115_state *state; 1310 struct saa7115_state *state;
1311 int i;
1312 char name[17];
1311 u8 chip_id; 1313 u8 chip_id;
1312 1314
1313 /* Check if the adapter supports the needed features */ 1315 /* Check if the adapter supports the needed features */
@@ -1324,6 +1326,14 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
1324 1326
1325 v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1); 1327 v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1);
1326 1328
1329 for (i=0;i<0x0f;i++) {
1330 saa7115_write(client, 0, i);
1331 name[i] = (saa7115_read(client, 0) &0x0f) +'0';
1332 if (name[i]>'9')
1333 name[i]+='a'-'9'-1;
1334 }
1335 name[i]='\0';
1336
1327 saa7115_write(client, 0, 5); 1337 saa7115_write(client, 0, 5);
1328 chip_id = saa7115_read(client, 0) & 0x0f; 1338 chip_id = saa7115_read(client, 0) & 0x0f;
1329 if (chip_id < 3 && chip_id > 5) { 1339 if (chip_id < 3 && chip_id > 5) {
@@ -1332,7 +1342,7 @@ static int saa7115_attach(struct i2c_adapter *adapter, int address, int kind)
1332 return 0; 1342 return 0;
1333 } 1343 }
1334 snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id); 1344 snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id);
1335 v4l_info(client, "saa711%d found @ 0x%x (%s)\n", chip_id, address << 1, adapter->name); 1345 v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, address << 1, adapter->name);
1336 1346
1337 state = kzalloc(sizeof(struct saa7115_state), GFP_KERNEL); 1347 state = kzalloc(sizeof(struct saa7115_state), GFP_KERNEL);
1338 i2c_set_clientdata(client, state); 1348 i2c_set_clientdata(client, state);