diff options
Diffstat (limited to 'drivers/media/pci/bt8xx/bttv-input.c')
-rw-r--r-- | drivers/media/pci/bt8xx/bttv-input.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c index 04207a799055..f36821367d8d 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) | |||
375 | I2C_CLIENT_END | 375 | I2C_CLIENT_END |
376 | }; | 376 | }; |
377 | struct i2c_board_info info; | 377 | struct i2c_board_info info; |
378 | struct i2c_client *i2c_dev; | ||
378 | 379 | ||
379 | if (0 != btv->i2c_rc) | 380 | if (0 != btv->i2c_rc) |
380 | return; | 381 | return; |
@@ -390,7 +391,12 @@ void init_bttv_i2c_ir(struct bttv *btv) | |||
390 | btv->init_data.ir_codes = RC_MAP_PV951; | 391 | btv->init_data.ir_codes = RC_MAP_PV951; |
391 | info.addr = 0x4b; | 392 | info.addr = 0x4b; |
392 | break; | 393 | break; |
393 | default: | 394 | } |
395 | |||
396 | if (btv->init_data.name) { | ||
397 | info.platform_data = &btv->init_data; | ||
398 | i2c_dev = i2c_new_device(&btv->c.i2c_adap, &info); | ||
399 | } else { | ||
394 | /* | 400 | /* |
395 | * The external IR receiver is at i2c address 0x34 (0x35 for | 401 | * The external IR receiver is at i2c address 0x34 (0x35 for |
396 | * reads). Future Hauppauge cards will have an internal | 402 | * reads). Future Hauppauge cards will have an internal |
@@ -399,24 +405,14 @@ void init_bttv_i2c_ir(struct bttv *btv) | |||
399 | * internal. | 405 | * internal. |
400 | * That's why we probe 0x1a (~0x34) first. CB | 406 | * That's why we probe 0x1a (~0x34) first. CB |
401 | */ | 407 | */ |
402 | 408 | i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL); | |
403 | i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL); | ||
404 | return; | ||
405 | } | 409 | } |
410 | if (NULL == i2c_dev) | ||
411 | return; | ||
406 | 412 | ||
407 | if (btv->init_data.name) | 413 | #if defined(CONFIG_MODULES) && defined(MODULE) |
408 | info.platform_data = &btv->init_data; | 414 | request_module("ir-kbd-i2c"); |
409 | i2c_new_device(&btv->c.i2c_adap, &info); | 415 | #endif |
410 | |||
411 | return; | ||
412 | } | ||
413 | |||
414 | int fini_bttv_i2c(struct bttv *btv) | ||
415 | { | ||
416 | if (0 != btv->i2c_rc) | ||
417 | return 0; | ||
418 | |||
419 | return i2c_del_adapter(&btv->c.i2c_adap); | ||
420 | } | 416 | } |
421 | 417 | ||
422 | int bttv_input_init(struct bttv *btv) | 418 | int bttv_input_init(struct bttv *btv) |