aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-05-13 15:52:44 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:21:12 -0400
commitd9a88e632b2c527165434c404a0a1ca16d2d3793 (patch)
tree5b772c7ad4689fddbb1683f5a717b0482163dd1c /drivers/media/video/saa7134
parentec218a412bcc126d49dec002d06b24a10d0ab6cd (diff)
V4L/DVB (11848): saa7134: Simplify handling of IR on AVerMedia Cardbus E506R
Now that we instantiate I2C IR devices explicitly, we can skip probing altogether on boards where the I2C IR device address is known. The AVerMedia Cardbus E506R is one of these boards. Tested-by: Oldrich Jedlicka <oldium.pro@seznam.cz> 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.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c
index 97fe6d14174a..6e219c2db841 100644
--- a/drivers/media/video/saa7134/saa7134-input.c
+++ b/drivers/media/video/saa7134/saa7134-input.c
@@ -698,20 +698,6 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
698 .buf = NULL, 698 .buf = NULL,
699 }; 699 };
700 700
701 unsigned char subaddr, data;
702 struct i2c_msg msg_avermedia[] = { {
703 .addr = 0x40,
704 .flags = 0,
705 .len = 1,
706 .buf = &subaddr,
707 }, {
708 .addr = 0x40,
709 .flags = I2C_M_RD,
710 .len = 1,
711 .buf = &data,
712 } };
713
714 struct i2c_client *client;
715 int rc; 701 int rc;
716 702
717 if (disable_ir) { 703 if (disable_ir) {
@@ -775,6 +761,10 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
775 init_data.get_key = get_key_beholdm6xx; 761 init_data.get_key = get_key_beholdm6xx;
776 init_data.ir_codes = ir_codes_behold; 762 init_data.ir_codes = ir_codes_behold;
777 break; 763 break;
764 case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
765 case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
766 info.addr = 0x40;
767 break;
778 } 768 }
779 769
780 if (init_data.name) 770 if (init_data.name)
@@ -786,20 +776,7 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev)
786 } 776 }
787 777
788 /* Address not known, fallback to probing */ 778 /* Address not known, fallback to probing */
789 client = i2c_new_probed_device(&dev->i2c_adap, &info, addr_list); 779 i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
790 if (client)
791 return;
792
793 /* Special case for AVerMedia Cardbus remote */
794 subaddr = 0x0d;
795 rc = i2c_transfer(&dev->i2c_adap, msg_avermedia, 2);
796 dprintk(KERN_DEBUG "probe 0x%02x/0x%02x @ %s: %s\n",
797 msg_avermedia[0].addr, subaddr, dev->i2c_adap.name,
798 (2 == rc) ? "yes" : "no");
799 if (2 == rc) {
800 info.addr = msg_avermedia[0].addr;
801 i2c_new_device(&dev->i2c_adap, &info);
802 }
803} 780}
804 781
805static int saa7134_rc5_irq(struct saa7134_dev *dev) 782static int saa7134_rc5_irq(struct saa7134_dev *dev)