aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/hdpvr/hdpvr-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/hdpvr/hdpvr-i2c.c')
-rw-r--r--drivers/media/video/hdpvr/hdpvr-i2c.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c
index 89b71faeaac2..e53fa55d56a1 100644
--- a/drivers/media/video/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/video/hdpvr/hdpvr-i2c.c
@@ -31,26 +31,34 @@
31#define Z8F0811_IR_RX_I2C_ADDR 0x71 31#define Z8F0811_IR_RX_I2C_ADDR 0x71
32 32
33 33
34static struct i2c_board_info hdpvr_i2c_board_info = { 34struct i2c_client *hdpvr_register_ir_tx_i2c(struct hdpvr_device *dev)
35 I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR), 35{
36 I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR), 36 struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data;
37}; 37 struct i2c_board_info hdpvr_ir_tx_i2c_board_info = {
38 I2C_BOARD_INFO("ir_tx_z8f0811_hdpvr", Z8F0811_IR_TX_I2C_ADDR),
39 };
40
41 init_data->name = "HD-PVR";
42 hdpvr_ir_tx_i2c_board_info.platform_data = init_data;
38 43
39int hdpvr_register_i2c_ir(struct hdpvr_device *dev) 44 return i2c_new_device(&dev->i2c_adapter, &hdpvr_ir_tx_i2c_board_info);
45}
46
47struct i2c_client *hdpvr_register_ir_rx_i2c(struct hdpvr_device *dev)
40{ 48{
41 struct i2c_client *c;
42 struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data; 49 struct IR_i2c_init_data *init_data = &dev->ir_i2c_init_data;
50 struct i2c_board_info hdpvr_ir_rx_i2c_board_info = {
51 I2C_BOARD_INFO("ir_rx_z8f0811_hdpvr", Z8F0811_IR_RX_I2C_ADDR),
52 };
43 53
44 /* Our default information for ir-kbd-i2c.c to use */ 54 /* Our default information for ir-kbd-i2c.c to use */
45 init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW; 55 init_data->ir_codes = RC_MAP_HAUPPAUGE_NEW;
46 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR; 56 init_data->internal_get_key_func = IR_KBD_GET_KEY_HAUP_XVR;
47 init_data->type = RC_TYPE_RC5; 57 init_data->type = RC_TYPE_RC5;
48 init_data->name = "HD PVR"; 58 init_data->name = "HD-PVR";
49 hdpvr_i2c_board_info.platform_data = init_data; 59 hdpvr_ir_rx_i2c_board_info.platform_data = init_data;
50
51 c = i2c_new_device(&dev->i2c_adapter, &hdpvr_i2c_board_info);
52 60
53 return (c == NULL) ? -ENODEV : 0; 61 return i2c_new_device(&dev->i2c_adapter, &hdpvr_ir_rx_i2c_board_info);
54} 62}
55 63
56static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus, 64static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus,