diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-05-13 19:48:50 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-05-13 19:48:50 +0000 |
commit | b60f8e0b02ee9d9ef582e9df01eb81e5218baf9e (patch) | |
tree | bcb266a5898ee14c3b687bddc268982acbd76d36 /linux/drivers/media/video/cx23885/cx23885-i2c.c | |
parent | e420aed19a5f4a2715733f2a450e8958fa7e2638 (diff) | |
download | mediapointer-dvb-s2-b60f8e0b02ee9d9ef582e9df01eb81e5218baf9e.tar.gz mediapointer-dvb-s2-b60f8e0b02ee9d9ef582e9df01eb81e5218baf9e.tar.bz2 |
ir-kbd-i2c: Switch to the new-style device binding model
From: Jean Delvare <khali@linux-fr.org>
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 'linux/drivers/media/video/cx23885/cx23885-i2c.c')
-rw-r--r-- | linux/drivers/media/video/cx23885/cx23885-i2c.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx23885/cx23885-i2c.c b/linux/drivers/media/video/cx23885/cx23885-i2c.c index a5d9f7530..4369470a3 100644 --- a/linux/drivers/media/video/cx23885/cx23885-i2c.c +++ b/linux/drivers/media/video/cx23885/cx23885-i2c.c @@ -364,6 +364,18 @@ int cx23885_i2c_register(struct cx23885_i2c *bus) printk(KERN_WARNING "%s: i2c bus %d register FAILED\n", dev->name, bus->nr); + /* Instantiate the IR receiver device, if present */ + if (0 == bus->i2c_rc) { + struct i2c_board_info info; + const unsigned short addr_list[] = { + 0x6b, I2C_CLIENT_END + }; + + memset(&info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, "ir_video", I2C_NAME_SIZE); + i2c_new_probed_device(&bus->i2c_adap, &info, addr_list); + } + return bus->i2c_rc; } |