diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-05-13 21:51:46 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 23:21:11 +0200 |
commit | ec218a412bcc126d49dec002d06b24a10d0ab6cd (patch) | |
tree | f937a5ecdf873c909193e9dee4044458569f97c3 /drivers/media/video/saa7134 | |
parent | V4L/DVB (11846): ir-kbd-i2c: Don't assume all IR receivers are supported (diff) | |
download | linux-ec218a412bcc126d49dec002d06b24a10d0ab6cd.tar.xz linux-ec218a412bcc126d49dec002d06b24a10d0ab6cd.zip |
V4L/DVB (11847): saa7134: Simplify handling of IR on MSI TV@nywhere Plus
Now that we instantiate I2C IR devices explicitly, we can skip probing
altogether on boards where the I2C IR device address is known. The MSI
TV@nywhere Plus is one of these boards.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index a20f687f81a8..97fe6d14174a 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c @@ -691,9 +691,6 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) I2C_CLIENT_END }; - const unsigned short addr_list_msi[] = { - 0x30, I2C_CLIENT_END - }; struct i2c_msg msg_msi = { .addr = 0x50, .flags = I2C_M_RD, @@ -747,6 +744,15 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) init_data.name = "MSI TV@nywhere Plus"; init_data.get_key = get_key_msi_tvanywhere_plus; init_data.ir_codes = ir_codes_msi_tvanywhere_plus; + info.addr = 0x30; + /* MSI TV@nywhere Plus controller doesn't seem to + respond to probes unless we read something from + an existing device. Weird... + REVISIT: might no longer be needed */ + rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); + dprintk(KERN_DEBUG "probe 0x%02x @ %s: %s\n", + msg_msi.addr, dev->i2c_adap.name, + (1 == rc) ? "yes" : "no"); break; case SAA7134_BOARD_HAUPPAUGE_HVR1110: init_data.name = "HVR 1110"; @@ -773,18 +779,14 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) if (init_data.name) info.platform_data = &init_data; - client = i2c_new_probed_device(&dev->i2c_adap, &info, addr_list); - if (client) + /* No need to probe if address is known */ + if (info.addr) { + i2c_new_device(&dev->i2c_adap, &info); return; + } - /* MSI TV@nywhere Plus controller doesn't seem to - respond to probes unless we read something from - an existing device. Weird... */ - rc = i2c_transfer(&dev->i2c_adap, &msg_msi, 1); - dprintk(KERN_DEBUG "probe 0x%02x @ %s: %s\n", - msg_msi.addr, dev->i2c_adap.name, - (1 == rc) ? "yes" : "no"); - client = i2c_new_probed_device(&dev->i2c_adap, &info, addr_list_msi); + /* Address not known, fallback to probing */ + client = i2c_new_probed_device(&dev->i2c_adap, &info, addr_list); if (client) return; |