Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37438
b: refs/heads/master
c: 236f16d
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Sep 26, 2006
1 parent 277bfd4 commit 73ee5fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 44b579d63678609a16265a0acdb6405fafd173d6
refs/heads/master: 236f16d241e16b269cd00ef0116975882f498be5
12 changes: 11 additions & 1 deletion trunk/drivers/media/video/saa7115.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,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 */
Expand All @@ -1324,6 +1326,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) {
Expand All @@ -1332,7 +1342,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);
Expand Down

0 comments on commit 73ee5fd

Please sign in to comment.