diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-05-13 15:48:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:21:11 -0400 |
commit | c668f32dca105d876e51862a003a302fa61e4ae4 (patch) | |
tree | 5a71742ecd4e6a1c48f77977e5e2f6d129ffb566 /drivers/media/video/bt8xx/bttv-i2c.c | |
parent | 1df8e9861cf9fac5737ccb61c7f7fefa77711d40 (diff) |
V4L/DVB (11844): ir-kbd-i2c: Switch to the new-style device binding model
Let card drivers probe for IR receiver devices and instantiate them if
found. Ultimately it would be better if we could stop probing
completely, but I suspect this won't be possible for all card types.
There's certainly room for cleanups. For example, some drivers are
sharing I2C adapter IDs, so they also had to share the list of I2C
addresses being probed for an IR receiver. Now that each driver
explicitly says which addresses should be probed, maybe some addresses
can be dropped from some drivers.
Also, the special cases in saa7134-i2c should probably be handled on a
per-board basis. This would be more efficient and less risky than always
probing extra addresses on all boards. I'll give it a try later.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-i2c.c')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-i2c.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c index a99d92fac3d..ebd1ee9dc87 100644 --- a/drivers/media/video/bt8xx/bttv-i2c.c +++ b/drivers/media/video/bt8xx/bttv-i2c.c | |||
@@ -389,6 +389,27 @@ int __devinit init_bttv_i2c(struct bttv *btv) | |||
389 | } | 389 | } |
390 | if (0 == btv->i2c_rc && i2c_scan) | 390 | if (0 == btv->i2c_rc && i2c_scan) |
391 | do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client); | 391 | do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client); |
392 | |||
393 | /* Instantiate the IR receiver device, if present */ | ||
394 | if (0 == btv->i2c_rc) { | ||
395 | struct i2c_board_info info; | ||
396 | /* The external IR receiver is at i2c address 0x34 (0x35 for | ||
397 | reads). Future Hauppauge cards will have an internal | ||
398 | receiver at 0x30 (0x31 for reads). In theory, both can be | ||
399 | fitted, and Hauppauge suggest an external overrides an | ||
400 | internal. | ||
401 | |||
402 | That's why we probe 0x1a (~0x34) first. CB | ||
403 | */ | ||
404 | const unsigned short addr_list[] = { | ||
405 | 0x1a, 0x18, 0x4b, 0x64, 0x30, | ||
406 | I2C_CLIENT_END | ||
407 | }; | ||
408 | |||
409 | memset(&info, 0, sizeof(struct i2c_board_info)); | ||
410 | strlcpy(info.type, "ir_video", I2C_NAME_SIZE); | ||
411 | i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list); | ||
412 | } | ||
392 | return btv->i2c_rc; | 413 | return btv->i2c_rc; |
393 | } | 414 | } |
394 | 415 | ||