summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Schaefer <fschaefer.oss@googlemail.com>2013-02-17 09:40:05 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 17:10:43 -0300
commitfa563073281d7be6c685a0bb8ca6b2737e00f368 (patch)
tree086457f506908d82ca16d67a9573df0ae8c3d7f3
parente6a60d768bc7b767439c56e34e345eb2fe873b06 (diff)
downloadlinux-fa563073281d7be6c685a0bb8ca6b2737e00f368.tar.bz2
[media] bttv: make remote controls of devices with i2c ir decoder working
Request module ir-kbd-i2c if an i2c ir decoder is detected. Tested with device "Hauppauge WinTV Theatre" (model 37284 rev B421). Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/pci/bt8xx/bttv-input.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c
index 04207a799055..01c71214f9ec 100644
--- a/drivers/media/pci/bt8xx/bttv-input.c
+++ b/drivers/media/pci/bt8xx/bttv-input.c
@@ -375,6 +375,7 @@ void init_bttv_i2c_ir(struct bttv *btv)
I2C_CLIENT_END
};
struct i2c_board_info info;
+ struct i2c_client *i2c_dev;
if (0 != btv->i2c_rc)
return;
@@ -390,7 +391,12 @@ void init_bttv_i2c_ir(struct bttv *btv)
btv->init_data.ir_codes = RC_MAP_PV951;
info.addr = 0x4b;
break;
- default:
+ }
+
+ if (btv->init_data.name) {
+ info.platform_data = &btv->init_data;
+ i2c_dev = i2c_new_device(&btv->c.i2c_adap, &info);
+ } else {
/*
* The external IR receiver is at i2c address 0x34 (0x35 for
* reads). Future Hauppauge cards will have an internal
@@ -399,16 +405,14 @@ void init_bttv_i2c_ir(struct bttv *btv)
* internal.
* That's why we probe 0x1a (~0x34) first. CB
*/
-
- i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL);
- return;
+ i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL);
}
+ if (NULL == i2c_dev)
+ return;
- if (btv->init_data.name)
- info.platform_data = &btv->init_data;
- i2c_new_device(&btv->c.i2c_adap, &info);
-
- return;
+#if defined(CONFIG_MODULES) && defined(MODULE)
+ request_module("ir-kbd-i2c");
+#endif
}
int fini_bttv_i2c(struct bttv *btv)