提交 fa563073 编写于 作者: F Frank Schaefer 提交者: Mauro Carvalho Chehab

[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: NFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 e6a60d76
...@@ -375,6 +375,7 @@ void init_bttv_i2c_ir(struct bttv *btv) ...@@ -375,6 +375,7 @@ void init_bttv_i2c_ir(struct bttv *btv)
I2C_CLIENT_END I2C_CLIENT_END
}; };
struct i2c_board_info info; struct i2c_board_info info;
struct i2c_client *i2c_dev;
if (0 != btv->i2c_rc) if (0 != btv->i2c_rc)
return; return;
...@@ -390,7 +391,12 @@ void init_bttv_i2c_ir(struct bttv *btv) ...@@ -390,7 +391,12 @@ void init_bttv_i2c_ir(struct bttv *btv)
btv->init_data.ir_codes = RC_MAP_PV951; btv->init_data.ir_codes = RC_MAP_PV951;
info.addr = 0x4b; info.addr = 0x4b;
break; 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 * The external IR receiver is at i2c address 0x34 (0x35 for
* reads). Future Hauppauge cards will have an internal * reads). Future Hauppauge cards will have an internal
...@@ -399,16 +405,14 @@ void init_bttv_i2c_ir(struct bttv *btv) ...@@ -399,16 +405,14 @@ void init_bttv_i2c_ir(struct bttv *btv)
* internal. * internal.
* That's why we probe 0x1a (~0x34) first. CB * That's why we probe 0x1a (~0x34) first. CB
*/ */
i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL);
i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL);
return;
} }
if (NULL == i2c_dev)
return;
if (btv->init_data.name) #if defined(CONFIG_MODULES) && defined(MODULE)
info.platform_data = &btv->init_data; request_module("ir-kbd-i2c");
i2c_new_device(&btv->c.i2c_adap, &info); #endif
return;
} }
int fini_bttv_i2c(struct bttv *btv) int fini_bttv_i2c(struct bttv *btv)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册