diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
32 files changed, 564 insertions, 479 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index 2525d3b3c88d..3d48ba019342 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DVB_USB | 1 | config DVB_USB |
2 | tristate "Support for various USB DVB devices" | 2 | tristate "Support for various USB DVB devices" |
3 | depends on DVB_CORE && USB && I2C && IR_CORE | 3 | depends on DVB_CORE && USB && I2C && RC_CORE |
4 | help | 4 | help |
5 | By enabling this you will be able to choose the various supported | 5 | By enabling this you will be able to choose the various supported |
6 | USB1.1 and USB2.0 DVB devices. | 6 | USB1.1 and USB2.0 DVB devices. |
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c index a5c363727133..53b93a4b6f8a 100644 --- a/drivers/media/dvb/dvb-usb/a800.c +++ b/drivers/media/dvb/dvb-usb/a800.c | |||
@@ -37,7 +37,7 @@ static int a800_identify_state(struct usb_device *udev, struct dvb_usb_device_pr | |||
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
39 | 39 | ||
40 | static struct ir_scancode ir_codes_a800_table[] = { | 40 | static struct rc_map_table rc_map_a800_table[] = { |
41 | { 0x0201, KEY_PROG1 }, /* SOURCE */ | 41 | { 0x0201, KEY_PROG1 }, /* SOURCE */ |
42 | { 0x0200, KEY_POWER }, /* POWER */ | 42 | { 0x0200, KEY_POWER }, /* POWER */ |
43 | { 0x0205, KEY_1 }, /* 1 */ | 43 | { 0x0205, KEY_1 }, /* 1 */ |
@@ -148,8 +148,8 @@ static struct dvb_usb_device_properties a800_properties = { | |||
148 | 148 | ||
149 | .rc.legacy = { | 149 | .rc.legacy = { |
150 | .rc_interval = DEFAULT_RC_INTERVAL, | 150 | .rc_interval = DEFAULT_RC_INTERVAL, |
151 | .rc_key_map = ir_codes_a800_table, | 151 | .rc_map_table = rc_map_a800_table, |
152 | .rc_key_map_size = ARRAY_SIZE(ir_codes_a800_table), | 152 | .rc_map_size = ARRAY_SIZE(rc_map_a800_table), |
153 | .rc_query = a800_rc_query, | 153 | .rc_query = a800_rc_query, |
154 | }, | 154 | }, |
155 | 155 | ||
diff --git a/drivers/media/dvb/dvb-usb/af9005-remote.c b/drivers/media/dvb/dvb-usb/af9005-remote.c index 696207fe37ec..c3bc64ed405c 100644 --- a/drivers/media/dvb/dvb-usb/af9005-remote.c +++ b/drivers/media/dvb/dvb-usb/af9005-remote.c | |||
@@ -33,7 +33,7 @@ MODULE_PARM_DESC(debug, | |||
33 | 33 | ||
34 | #define deb_decode(args...) dprintk(dvb_usb_af9005_remote_debug,0x01,args) | 34 | #define deb_decode(args...) dprintk(dvb_usb_af9005_remote_debug,0x01,args) |
35 | 35 | ||
36 | struct ir_scancode ir_codes_af9005_table[] = { | 36 | struct rc_map_table rc_map_af9005_table[] = { |
37 | 37 | ||
38 | {0x01b7, KEY_POWER}, | 38 | {0x01b7, KEY_POWER}, |
39 | {0x01a7, KEY_VOLUMEUP}, | 39 | {0x01a7, KEY_VOLUMEUP}, |
@@ -74,7 +74,7 @@ struct ir_scancode ir_codes_af9005_table[] = { | |||
74 | {0x00d5, KEY_GOTO}, /* marked jump on the remote */ | 74 | {0x00d5, KEY_GOTO}, /* marked jump on the remote */ |
75 | }; | 75 | }; |
76 | 76 | ||
77 | int ir_codes_af9005_table_size = ARRAY_SIZE(ir_codes_af9005_table); | 77 | int rc_map_af9005_table_size = ARRAY_SIZE(rc_map_af9005_table); |
78 | 78 | ||
79 | static int repeatable_keys[] = { | 79 | static int repeatable_keys[] = { |
80 | KEY_VOLUMEUP, | 80 | KEY_VOLUMEUP, |
@@ -130,10 +130,10 @@ int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event, | |||
130 | deb_decode("code != inverted code\n"); | 130 | deb_decode("code != inverted code\n"); |
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
133 | for (i = 0; i < ir_codes_af9005_table_size; i++) { | 133 | for (i = 0; i < rc_map_af9005_table_size; i++) { |
134 | if (rc5_custom(&ir_codes_af9005_table[i]) == cust | 134 | if (rc5_custom(&rc_map_af9005_table[i]) == cust |
135 | && rc5_data(&ir_codes_af9005_table[i]) == dat) { | 135 | && rc5_data(&rc_map_af9005_table[i]) == dat) { |
136 | *event = ir_codes_af9005_table[i].keycode; | 136 | *event = rc_map_af9005_table[i].keycode; |
137 | *state = REMOTE_KEY_PRESSED; | 137 | *state = REMOTE_KEY_PRESSED; |
138 | deb_decode | 138 | deb_decode |
139 | ("key pressed, event %x\n", *event); | 139 | ("key pressed, event %x\n", *event); |
@@ -146,8 +146,8 @@ int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, u32 * event, | |||
146 | return 0; | 146 | return 0; |
147 | } | 147 | } |
148 | 148 | ||
149 | EXPORT_SYMBOL(ir_codes_af9005_table); | 149 | EXPORT_SYMBOL(rc_map_af9005_table); |
150 | EXPORT_SYMBOL(ir_codes_af9005_table_size); | 150 | EXPORT_SYMBOL(rc_map_af9005_table_size); |
151 | EXPORT_SYMBOL(af9005_rc_decode); | 151 | EXPORT_SYMBOL(af9005_rc_decode); |
152 | 152 | ||
153 | MODULE_AUTHOR("Luca Olivetti <luca@ventoso.org>"); | 153 | MODULE_AUTHOR("Luca Olivetti <luca@ventoso.org>"); |
diff --git a/drivers/media/dvb/dvb-usb/af9005.c b/drivers/media/dvb/dvb-usb/af9005.c index 8ecba8848bcf..51f6439dcfd5 100644 --- a/drivers/media/dvb/dvb-usb/af9005.c +++ b/drivers/media/dvb/dvb-usb/af9005.c | |||
@@ -1027,8 +1027,8 @@ static struct dvb_usb_device_properties af9005_properties = { | |||
1027 | 1027 | ||
1028 | .rc.legacy = { | 1028 | .rc.legacy = { |
1029 | .rc_interval = 200, | 1029 | .rc_interval = 200, |
1030 | .rc_key_map = NULL, | 1030 | .rc_map_table = NULL, |
1031 | .rc_key_map_size = 0, | 1031 | .rc_map_size = 0, |
1032 | .rc_query = af9005_rc_query, | 1032 | .rc_query = af9005_rc_query, |
1033 | }, | 1033 | }, |
1034 | 1034 | ||
@@ -1070,14 +1070,14 @@ static int __init af9005_usb_module_init(void) | |||
1070 | return result; | 1070 | return result; |
1071 | } | 1071 | } |
1072 | rc_decode = symbol_request(af9005_rc_decode); | 1072 | rc_decode = symbol_request(af9005_rc_decode); |
1073 | rc_keys = symbol_request(ir_codes_af9005_table); | 1073 | rc_keys = symbol_request(rc_map_af9005_table); |
1074 | rc_keys_size = symbol_request(ir_codes_af9005_table_size); | 1074 | rc_keys_size = symbol_request(rc_map_af9005_table_size); |
1075 | if (rc_decode == NULL || rc_keys == NULL || rc_keys_size == NULL) { | 1075 | if (rc_decode == NULL || rc_keys == NULL || rc_keys_size == NULL) { |
1076 | err("af9005_rc_decode function not found, disabling remote"); | 1076 | err("af9005_rc_decode function not found, disabling remote"); |
1077 | af9005_properties.rc.legacy.rc_query = NULL; | 1077 | af9005_properties.rc.legacy.rc_query = NULL; |
1078 | } else { | 1078 | } else { |
1079 | af9005_properties.rc.legacy.rc_key_map = rc_keys; | 1079 | af9005_properties.rc.legacy.rc_map_table = rc_keys; |
1080 | af9005_properties.rc.legacy.rc_key_map_size = *rc_keys_size; | 1080 | af9005_properties.rc.legacy.rc_map_size = *rc_keys_size; |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | return 0; | 1083 | return 0; |
@@ -1089,9 +1089,9 @@ static void __exit af9005_usb_module_exit(void) | |||
1089 | if (rc_decode != NULL) | 1089 | if (rc_decode != NULL) |
1090 | symbol_put(af9005_rc_decode); | 1090 | symbol_put(af9005_rc_decode); |
1091 | if (rc_keys != NULL) | 1091 | if (rc_keys != NULL) |
1092 | symbol_put(ir_codes_af9005_table); | 1092 | symbol_put(rc_map_af9005_table); |
1093 | if (rc_keys_size != NULL) | 1093 | if (rc_keys_size != NULL) |
1094 | symbol_put(ir_codes_af9005_table_size); | 1094 | symbol_put(rc_map_af9005_table_size); |
1095 | /* deregister this driver from the USB subsystem */ | 1095 | /* deregister this driver from the USB subsystem */ |
1096 | usb_deregister(&af9005_usb_driver); | 1096 | usb_deregister(&af9005_usb_driver); |
1097 | } | 1097 | } |
diff --git a/drivers/media/dvb/dvb-usb/af9005.h b/drivers/media/dvb/dvb-usb/af9005.h index 3c1fbd1c5d60..c71c77bd7f4b 100644 --- a/drivers/media/dvb/dvb-usb/af9005.h +++ b/drivers/media/dvb/dvb-usb/af9005.h | |||
@@ -3490,7 +3490,7 @@ extern u8 regmask[8]; | |||
3490 | /* remote control decoder */ | 3490 | /* remote control decoder */ |
3491 | extern int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, | 3491 | extern int af9005_rc_decode(struct dvb_usb_device *d, u8 * data, int len, |
3492 | u32 * event, int *state); | 3492 | u32 * event, int *state); |
3493 | extern struct ir_scancode ir_codes_af9005_table[]; | 3493 | extern struct rc_map_table rc_map_af9005_table[]; |
3494 | extern int ir_codes_af9005_table_size; | 3494 | extern int rc_map_af9005_table_size; |
3495 | 3495 | ||
3496 | #endif | 3496 | #endif |
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index 31c0a0ed39f5..8671ca362c81 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c | |||
@@ -1041,13 +1041,13 @@ static int af9015_rc_query(struct dvb_usb_device *d) | |||
1041 | priv->rc_keycode = buf[12] << 16 | | 1041 | priv->rc_keycode = buf[12] << 16 | |
1042 | buf[13] << 8 | buf[14]; | 1042 | buf[13] << 8 | buf[14]; |
1043 | } | 1043 | } |
1044 | ir_keydown(d->rc_input_dev, priv->rc_keycode, 0); | 1044 | rc_keydown(d->rc_dev, priv->rc_keycode, 0); |
1045 | } else { | 1045 | } else { |
1046 | priv->rc_keycode = 0; /* clear just for sure */ | 1046 | priv->rc_keycode = 0; /* clear just for sure */ |
1047 | } | 1047 | } |
1048 | } else if (priv->rc_repeat != buf[6] || buf[0]) { | 1048 | } else if (priv->rc_repeat != buf[6] || buf[0]) { |
1049 | deb_rc("%s: key repeated\n", __func__); | 1049 | deb_rc("%s: key repeated\n", __func__); |
1050 | ir_keydown(d->rc_input_dev, priv->rc_keycode, 0); | 1050 | rc_keydown(d->rc_dev, priv->rc_keycode, 0); |
1051 | } else { | 1051 | } else { |
1052 | deb_rc("%s: no key press\n", __func__); | 1052 | deb_rc("%s: no key press\n", __func__); |
1053 | } | 1053 | } |
@@ -1344,13 +1344,11 @@ static struct dvb_usb_device_properties af9015_properties[] = { | |||
1344 | .identify_state = af9015_identify_state, | 1344 | .identify_state = af9015_identify_state, |
1345 | 1345 | ||
1346 | .rc.core = { | 1346 | .rc.core = { |
1347 | .protocol = IR_TYPE_NEC, | 1347 | .protocol = RC_TYPE_NEC, |
1348 | .module_name = "af9015", | 1348 | .module_name = "af9015", |
1349 | .rc_query = af9015_rc_query, | 1349 | .rc_query = af9015_rc_query, |
1350 | .rc_interval = AF9015_RC_INTERVAL, | 1350 | .rc_interval = AF9015_RC_INTERVAL, |
1351 | .rc_props = { | 1351 | .allowed_protos = RC_TYPE_NEC, |
1352 | .allowed_protos = IR_TYPE_NEC, | ||
1353 | }, | ||
1354 | }, | 1352 | }, |
1355 | 1353 | ||
1356 | .i2c_algo = &af9015_i2c_algo, | 1354 | .i2c_algo = &af9015_i2c_algo, |
@@ -1474,13 +1472,11 @@ static struct dvb_usb_device_properties af9015_properties[] = { | |||
1474 | .identify_state = af9015_identify_state, | 1472 | .identify_state = af9015_identify_state, |
1475 | 1473 | ||
1476 | .rc.core = { | 1474 | .rc.core = { |
1477 | .protocol = IR_TYPE_NEC, | 1475 | .protocol = RC_TYPE_NEC, |
1478 | .module_name = "af9015", | 1476 | .module_name = "af9015", |
1479 | .rc_query = af9015_rc_query, | 1477 | .rc_query = af9015_rc_query, |
1480 | .rc_interval = AF9015_RC_INTERVAL, | 1478 | .rc_interval = AF9015_RC_INTERVAL, |
1481 | .rc_props = { | 1479 | .allowed_protos = RC_TYPE_NEC, |
1482 | .allowed_protos = IR_TYPE_NEC, | ||
1483 | }, | ||
1484 | }, | 1480 | }, |
1485 | 1481 | ||
1486 | .i2c_algo = &af9015_i2c_algo, | 1482 | .i2c_algo = &af9015_i2c_algo, |
@@ -1588,13 +1584,11 @@ static struct dvb_usb_device_properties af9015_properties[] = { | |||
1588 | .identify_state = af9015_identify_state, | 1584 | .identify_state = af9015_identify_state, |
1589 | 1585 | ||
1590 | .rc.core = { | 1586 | .rc.core = { |
1591 | .protocol = IR_TYPE_NEC, | 1587 | .protocol = RC_TYPE_NEC, |
1592 | .module_name = "af9015", | 1588 | .module_name = "af9015", |
1593 | .rc_query = af9015_rc_query, | 1589 | .rc_query = af9015_rc_query, |
1594 | .rc_interval = AF9015_RC_INTERVAL, | 1590 | .rc_interval = AF9015_RC_INTERVAL, |
1595 | .rc_props = { | 1591 | .allowed_protos = RC_TYPE_NEC, |
1596 | .allowed_protos = IR_TYPE_NEC, | ||
1597 | }, | ||
1598 | }, | 1592 | }, |
1599 | 1593 | ||
1600 | .i2c_algo = &af9015_i2c_algo, | 1594 | .i2c_algo = &af9015_i2c_algo, |
diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index 1759d26bca42..6b402e943539 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c | |||
@@ -394,7 +394,7 @@ static int anysee_rc_query(struct dvb_usb_device *d) | |||
394 | 394 | ||
395 | if (ircode[0]) { | 395 | if (ircode[0]) { |
396 | deb_rc("%s: key pressed %02x\n", __func__, ircode[1]); | 396 | deb_rc("%s: key pressed %02x\n", __func__, ircode[1]); |
397 | ir_keydown(d->rc_input_dev, 0x08 << 8 | ircode[1], 0); | 397 | rc_keydown(d->rc_dev, 0x08 << 8 | ircode[1], 0); |
398 | } | 398 | } |
399 | 399 | ||
400 | return 0; | 400 | return 0; |
@@ -476,7 +476,7 @@ static struct dvb_usb_device_properties anysee_properties = { | |||
476 | 476 | ||
477 | .rc.core = { | 477 | .rc.core = { |
478 | .rc_codes = RC_MAP_ANYSEE, | 478 | .rc_codes = RC_MAP_ANYSEE, |
479 | .protocol = IR_TYPE_OTHER, | 479 | .protocol = RC_TYPE_OTHER, |
480 | .module_name = "anysee", | 480 | .module_name = "anysee", |
481 | .rc_query = anysee_rc_query, | 481 | .rc_query = anysee_rc_query, |
482 | .rc_interval = 250, /* windows driver uses 500ms */ | 482 | .rc_interval = 250, /* windows driver uses 500ms */ |
diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index 62c58288469f..57e2444d51ab 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c | |||
@@ -386,7 +386,7 @@ static int az6027_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
386 | } | 386 | } |
387 | 387 | ||
388 | /* keys for the enclosed remote control */ | 388 | /* keys for the enclosed remote control */ |
389 | static struct ir_scancode ir_codes_az6027_table[] = { | 389 | static struct rc_map_table rc_map_az6027_table[] = { |
390 | { 0x01, KEY_1 }, | 390 | { 0x01, KEY_1 }, |
391 | { 0x02, KEY_2 }, | 391 | { 0x02, KEY_2 }, |
392 | }; | 392 | }; |
@@ -1089,6 +1089,7 @@ static struct usb_device_id az6027_usb_table[] = { | |||
1089 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_DVBS2CI_V2) }, | 1089 | { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_DVBS2CI_V2) }, |
1090 | { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V1) }, | 1090 | { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V1) }, |
1091 | { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V2) }, | 1091 | { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V2) }, |
1092 | { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_SAT) }, | ||
1092 | { }, | 1093 | { }, |
1093 | }; | 1094 | }; |
1094 | 1095 | ||
@@ -1126,15 +1127,15 @@ static struct dvb_usb_device_properties az6027_properties = { | |||
1126 | .read_mac_address = az6027_read_mac_addr, | 1127 | .read_mac_address = az6027_read_mac_addr, |
1127 | */ | 1128 | */ |
1128 | .rc.legacy = { | 1129 | .rc.legacy = { |
1129 | .rc_key_map = ir_codes_az6027_table, | 1130 | .rc_map_table = rc_map_az6027_table, |
1130 | .rc_key_map_size = ARRAY_SIZE(ir_codes_az6027_table), | 1131 | .rc_map_size = ARRAY_SIZE(rc_map_az6027_table), |
1131 | .rc_interval = 400, | 1132 | .rc_interval = 400, |
1132 | .rc_query = az6027_rc_query, | 1133 | .rc_query = az6027_rc_query, |
1133 | }, | 1134 | }, |
1134 | 1135 | ||
1135 | .i2c_algo = &az6027_i2c_algo, | 1136 | .i2c_algo = &az6027_i2c_algo, |
1136 | 1137 | ||
1137 | .num_device_descs = 5, | 1138 | .num_device_descs = 6, |
1138 | .devices = { | 1139 | .devices = { |
1139 | { | 1140 | { |
1140 | .name = "AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)", | 1141 | .name = "AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)", |
@@ -1156,6 +1157,10 @@ static struct dvb_usb_device_properties az6027_properties = { | |||
1156 | .name = "Technisat SkyStar USB 2 HD CI", | 1157 | .name = "Technisat SkyStar USB 2 HD CI", |
1157 | .cold_ids = { &az6027_usb_table[4], NULL }, | 1158 | .cold_ids = { &az6027_usb_table[4], NULL }, |
1158 | .warm_ids = { NULL }, | 1159 | .warm_ids = { NULL }, |
1160 | }, { | ||
1161 | .name = "Elgato EyeTV Sat", | ||
1162 | .cold_ids = { &az6027_usb_table[5], NULL }, | ||
1163 | .warm_ids = { NULL }, | ||
1159 | }, | 1164 | }, |
1160 | { NULL }, | 1165 | { NULL }, |
1161 | } | 1166 | } |
diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-core.c b/drivers/media/dvb/dvb-usb/cinergyT2-core.c index 4f5aa83fc1fc..16f2ce2bc15a 100644 --- a/drivers/media/dvb/dvb-usb/cinergyT2-core.c +++ b/drivers/media/dvb/dvb-usb/cinergyT2-core.c | |||
@@ -84,7 +84,7 @@ static int cinergyt2_frontend_attach(struct dvb_usb_adapter *adap) | |||
84 | return 0; | 84 | return 0; |
85 | } | 85 | } |
86 | 86 | ||
87 | static struct ir_scancode ir_codes_cinergyt2_table[] = { | 87 | static struct rc_map_table rc_map_cinergyt2_table[] = { |
88 | { 0x0401, KEY_POWER }, | 88 | { 0x0401, KEY_POWER }, |
89 | { 0x0402, KEY_1 }, | 89 | { 0x0402, KEY_1 }, |
90 | { 0x0403, KEY_2 }, | 90 | { 0x0403, KEY_2 }, |
@@ -219,8 +219,8 @@ static struct dvb_usb_device_properties cinergyt2_properties = { | |||
219 | 219 | ||
220 | .rc.legacy = { | 220 | .rc.legacy = { |
221 | .rc_interval = 50, | 221 | .rc_interval = 50, |
222 | .rc_key_map = ir_codes_cinergyt2_table, | 222 | .rc_map_table = rc_map_cinergyt2_table, |
223 | .rc_key_map_size = ARRAY_SIZE(ir_codes_cinergyt2_table), | 223 | .rc_map_size = ARRAY_SIZE(rc_map_cinergyt2_table), |
224 | .rc_query = cinergyt2_rc_query, | 224 | .rc_query = cinergyt2_rc_query, |
225 | }, | 225 | }, |
226 | 226 | ||
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index cd9f362c37b2..acb5fb2d2e73 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -385,7 +385,7 @@ static int cxusb_d680_dmb_streaming_ctrl( | |||
385 | 385 | ||
386 | static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 386 | static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
387 | { | 387 | { |
388 | struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; | 388 | struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; |
389 | u8 ircode[4]; | 389 | u8 ircode[4]; |
390 | int i; | 390 | int i; |
391 | 391 | ||
@@ -394,7 +394,7 @@ static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
394 | *event = 0; | 394 | *event = 0; |
395 | *state = REMOTE_NO_KEY_PRESSED; | 395 | *state = REMOTE_NO_KEY_PRESSED; |
396 | 396 | ||
397 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { | 397 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) { |
398 | if (rc5_custom(&keymap[i]) == ircode[2] && | 398 | if (rc5_custom(&keymap[i]) == ircode[2] && |
399 | rc5_data(&keymap[i]) == ircode[3]) { | 399 | rc5_data(&keymap[i]) == ircode[3]) { |
400 | *event = keymap[i].keycode; | 400 | *event = keymap[i].keycode; |
@@ -410,7 +410,7 @@ static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
410 | static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event, | 410 | static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event, |
411 | int *state) | 411 | int *state) |
412 | { | 412 | { |
413 | struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; | 413 | struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; |
414 | u8 ircode[4]; | 414 | u8 ircode[4]; |
415 | int i; | 415 | int i; |
416 | struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD, | 416 | struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD, |
@@ -422,7 +422,7 @@ static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event, | |||
422 | if (cxusb_i2c_xfer(&d->i2c_adap, &msg, 1) != 1) | 422 | if (cxusb_i2c_xfer(&d->i2c_adap, &msg, 1) != 1) |
423 | return 0; | 423 | return 0; |
424 | 424 | ||
425 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { | 425 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) { |
426 | if (rc5_custom(&keymap[i]) == ircode[1] && | 426 | if (rc5_custom(&keymap[i]) == ircode[1] && |
427 | rc5_data(&keymap[i]) == ircode[2]) { | 427 | rc5_data(&keymap[i]) == ircode[2]) { |
428 | *event = keymap[i].keycode; | 428 | *event = keymap[i].keycode; |
@@ -438,7 +438,7 @@ static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event, | |||
438 | static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, | 438 | static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, |
439 | int *state) | 439 | int *state) |
440 | { | 440 | { |
441 | struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; | 441 | struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; |
442 | u8 ircode[2]; | 442 | u8 ircode[2]; |
443 | int i; | 443 | int i; |
444 | 444 | ||
@@ -448,7 +448,7 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, | |||
448 | if (cxusb_ctrl_msg(d, 0x10, NULL, 0, ircode, 2) < 0) | 448 | if (cxusb_ctrl_msg(d, 0x10, NULL, 0, ircode, 2) < 0) |
449 | return 0; | 449 | return 0; |
450 | 450 | ||
451 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { | 451 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) { |
452 | if (rc5_custom(&keymap[i]) == ircode[0] && | 452 | if (rc5_custom(&keymap[i]) == ircode[0] && |
453 | rc5_data(&keymap[i]) == ircode[1]) { | 453 | rc5_data(&keymap[i]) == ircode[1]) { |
454 | *event = keymap[i].keycode; | 454 | *event = keymap[i].keycode; |
@@ -461,7 +461,7 @@ static int cxusb_d680_dmb_rc_query(struct dvb_usb_device *d, u32 *event, | |||
461 | return 0; | 461 | return 0; |
462 | } | 462 | } |
463 | 463 | ||
464 | static struct ir_scancode ir_codes_dvico_mce_table[] = { | 464 | static struct rc_map_table rc_map_dvico_mce_table[] = { |
465 | { 0xfe02, KEY_TV }, | 465 | { 0xfe02, KEY_TV }, |
466 | { 0xfe0e, KEY_MP3 }, | 466 | { 0xfe0e, KEY_MP3 }, |
467 | { 0xfe1a, KEY_DVD }, | 467 | { 0xfe1a, KEY_DVD }, |
@@ -509,7 +509,7 @@ static struct ir_scancode ir_codes_dvico_mce_table[] = { | |||
509 | { 0xfe4e, KEY_POWER }, | 509 | { 0xfe4e, KEY_POWER }, |
510 | }; | 510 | }; |
511 | 511 | ||
512 | static struct ir_scancode ir_codes_dvico_portable_table[] = { | 512 | static struct rc_map_table rc_map_dvico_portable_table[] = { |
513 | { 0xfc02, KEY_SETUP }, /* Profile */ | 513 | { 0xfc02, KEY_SETUP }, /* Profile */ |
514 | { 0xfc43, KEY_POWER2 }, | 514 | { 0xfc43, KEY_POWER2 }, |
515 | { 0xfc06, KEY_EPG }, | 515 | { 0xfc06, KEY_EPG }, |
@@ -548,7 +548,7 @@ static struct ir_scancode ir_codes_dvico_portable_table[] = { | |||
548 | { 0xfc00, KEY_UNKNOWN }, /* HD */ | 548 | { 0xfc00, KEY_UNKNOWN }, /* HD */ |
549 | }; | 549 | }; |
550 | 550 | ||
551 | static struct ir_scancode ir_codes_d680_dmb_table[] = { | 551 | static struct rc_map_table rc_map_d680_dmb_table[] = { |
552 | { 0x0038, KEY_UNKNOWN }, /* TV/AV */ | 552 | { 0x0038, KEY_UNKNOWN }, /* TV/AV */ |
553 | { 0x080c, KEY_ZOOM }, | 553 | { 0x080c, KEY_ZOOM }, |
554 | { 0x0800, KEY_0 }, | 554 | { 0x0800, KEY_0 }, |
@@ -923,7 +923,7 @@ static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap) | |||
923 | return -EIO; | 923 | return -EIO; |
924 | 924 | ||
925 | /* try to determine if there is no IR decoder on the I2C bus */ | 925 | /* try to determine if there is no IR decoder on the I2C bus */ |
926 | for (i = 0; adap->dev->props.rc.legacy.rc_key_map != NULL && i < 5; i++) { | 926 | for (i = 0; adap->dev->props.rc.legacy.rc_map_table != NULL && i < 5; i++) { |
927 | msleep(20); | 927 | msleep(20); |
928 | if (cxusb_i2c_xfer(&adap->dev->i2c_adap, &msg, 1) != 1) | 928 | if (cxusb_i2c_xfer(&adap->dev->i2c_adap, &msg, 1) != 1) |
929 | goto no_IR; | 929 | goto no_IR; |
@@ -931,7 +931,7 @@ static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap) | |||
931 | continue; | 931 | continue; |
932 | if (ircode[2] + ircode[3] != 0xff) { | 932 | if (ircode[2] + ircode[3] != 0xff) { |
933 | no_IR: | 933 | no_IR: |
934 | adap->dev->props.rc.legacy.rc_key_map = NULL; | 934 | adap->dev->props.rc.legacy.rc_map_table = NULL; |
935 | info("No IR receiver detected on this device."); | 935 | info("No IR receiver detected on this device."); |
936 | break; | 936 | break; |
937 | } | 937 | } |
@@ -1453,8 +1453,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties = { | |||
1453 | 1453 | ||
1454 | .rc.legacy = { | 1454 | .rc.legacy = { |
1455 | .rc_interval = 100, | 1455 | .rc_interval = 100, |
1456 | .rc_key_map = ir_codes_dvico_portable_table, | 1456 | .rc_map_table = rc_map_dvico_portable_table, |
1457 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), | 1457 | .rc_map_size = ARRAY_SIZE(rc_map_dvico_portable_table), |
1458 | .rc_query = cxusb_rc_query, | 1458 | .rc_query = cxusb_rc_query, |
1459 | }, | 1459 | }, |
1460 | 1460 | ||
@@ -1506,8 +1506,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties = { | |||
1506 | 1506 | ||
1507 | .rc.legacy = { | 1507 | .rc.legacy = { |
1508 | .rc_interval = 150, | 1508 | .rc_interval = 150, |
1509 | .rc_key_map = ir_codes_dvico_mce_table, | 1509 | .rc_map_table = rc_map_dvico_mce_table, |
1510 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_mce_table), | 1510 | .rc_map_size = ARRAY_SIZE(rc_map_dvico_mce_table), |
1511 | .rc_query = cxusb_rc_query, | 1511 | .rc_query = cxusb_rc_query, |
1512 | }, | 1512 | }, |
1513 | 1513 | ||
@@ -1567,8 +1567,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties = { | |||
1567 | 1567 | ||
1568 | .rc.legacy = { | 1568 | .rc.legacy = { |
1569 | .rc_interval = 100, | 1569 | .rc_interval = 100, |
1570 | .rc_key_map = ir_codes_dvico_portable_table, | 1570 | .rc_map_table = rc_map_dvico_portable_table, |
1571 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), | 1571 | .rc_map_size = ARRAY_SIZE(rc_map_dvico_portable_table), |
1572 | .rc_query = cxusb_rc_query, | 1572 | .rc_query = cxusb_rc_query, |
1573 | }, | 1573 | }, |
1574 | 1574 | ||
@@ -1619,8 +1619,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties = { | |||
1619 | 1619 | ||
1620 | .rc.legacy = { | 1620 | .rc.legacy = { |
1621 | .rc_interval = 100, | 1621 | .rc_interval = 100, |
1622 | .rc_key_map = ir_codes_dvico_portable_table, | 1622 | .rc_map_table = rc_map_dvico_portable_table, |
1623 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), | 1623 | .rc_map_size = ARRAY_SIZE(rc_map_dvico_portable_table), |
1624 | .rc_query = cxusb_rc_query, | 1624 | .rc_query = cxusb_rc_query, |
1625 | }, | 1625 | }, |
1626 | 1626 | ||
@@ -1670,8 +1670,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties = { | |||
1670 | 1670 | ||
1671 | .rc.legacy = { | 1671 | .rc.legacy = { |
1672 | .rc_interval = 100, | 1672 | .rc_interval = 100, |
1673 | .rc_key_map = ir_codes_dvico_mce_table, | 1673 | .rc_map_table = rc_map_dvico_mce_table, |
1674 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_mce_table), | 1674 | .rc_map_size = ARRAY_SIZE(rc_map_dvico_mce_table), |
1675 | .rc_query = cxusb_bluebird2_rc_query, | 1675 | .rc_query = cxusb_bluebird2_rc_query, |
1676 | }, | 1676 | }, |
1677 | 1677 | ||
@@ -1720,8 +1720,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_nano2_properties = { | |||
1720 | 1720 | ||
1721 | .rc.legacy = { | 1721 | .rc.legacy = { |
1722 | .rc_interval = 100, | 1722 | .rc_interval = 100, |
1723 | .rc_key_map = ir_codes_dvico_portable_table, | 1723 | .rc_map_table = rc_map_dvico_portable_table, |
1724 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), | 1724 | .rc_map_size = ARRAY_SIZE(rc_map_dvico_portable_table), |
1725 | .rc_query = cxusb_bluebird2_rc_query, | 1725 | .rc_query = cxusb_bluebird2_rc_query, |
1726 | }, | 1726 | }, |
1727 | 1727 | ||
@@ -1772,8 +1772,8 @@ static struct dvb_usb_device_properties cxusb_bluebird_nano2_needsfirmware_prope | |||
1772 | 1772 | ||
1773 | .rc.legacy = { | 1773 | .rc.legacy = { |
1774 | .rc_interval = 100, | 1774 | .rc_interval = 100, |
1775 | .rc_key_map = ir_codes_dvico_portable_table, | 1775 | .rc_map_table = rc_map_dvico_portable_table, |
1776 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_portable_table), | 1776 | .rc_map_size = ARRAY_SIZE(rc_map_dvico_portable_table), |
1777 | .rc_query = cxusb_rc_query, | 1777 | .rc_query = cxusb_rc_query, |
1778 | }, | 1778 | }, |
1779 | 1779 | ||
@@ -1865,8 +1865,8 @@ struct dvb_usb_device_properties cxusb_bluebird_dualdig4_rev2_properties = { | |||
1865 | 1865 | ||
1866 | .rc.legacy = { | 1866 | .rc.legacy = { |
1867 | .rc_interval = 100, | 1867 | .rc_interval = 100, |
1868 | .rc_key_map = ir_codes_dvico_mce_table, | 1868 | .rc_map_table = rc_map_dvico_mce_table, |
1869 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dvico_mce_table), | 1869 | .rc_map_size = ARRAY_SIZE(rc_map_dvico_mce_table), |
1870 | .rc_query = cxusb_rc_query, | 1870 | .rc_query = cxusb_rc_query, |
1871 | }, | 1871 | }, |
1872 | 1872 | ||
@@ -1915,8 +1915,8 @@ static struct dvb_usb_device_properties cxusb_d680_dmb_properties = { | |||
1915 | 1915 | ||
1916 | .rc.legacy = { | 1916 | .rc.legacy = { |
1917 | .rc_interval = 100, | 1917 | .rc_interval = 100, |
1918 | .rc_key_map = ir_codes_d680_dmb_table, | 1918 | .rc_map_table = rc_map_d680_dmb_table, |
1919 | .rc_key_map_size = ARRAY_SIZE(ir_codes_d680_dmb_table), | 1919 | .rc_map_size = ARRAY_SIZE(rc_map_d680_dmb_table), |
1920 | .rc_query = cxusb_d680_dmb_rc_query, | 1920 | .rc_query = cxusb_d680_dmb_rc_query, |
1921 | }, | 1921 | }, |
1922 | 1922 | ||
@@ -1966,8 +1966,8 @@ static struct dvb_usb_device_properties cxusb_mygica_d689_properties = { | |||
1966 | 1966 | ||
1967 | .rc.legacy = { | 1967 | .rc.legacy = { |
1968 | .rc_interval = 100, | 1968 | .rc_interval = 100, |
1969 | .rc_key_map = ir_codes_d680_dmb_table, | 1969 | .rc_map_table = rc_map_d680_dmb_table, |
1970 | .rc_key_map_size = ARRAY_SIZE(ir_codes_d680_dmb_table), | 1970 | .rc_map_size = ARRAY_SIZE(rc_map_d680_dmb_table), |
1971 | .rc_query = cxusb_d680_dmb_rc_query, | 1971 | .rc_query = cxusb_d680_dmb_rc_query, |
1972 | }, | 1972 | }, |
1973 | 1973 | ||
diff --git a/drivers/media/dvb/dvb-usb/dib0700.h b/drivers/media/dvb/dvb-usb/dib0700.h index c2c9d236ec7e..3537d65c04bc 100644 --- a/drivers/media/dvb/dvb-usb/dib0700.h +++ b/drivers/media/dvb/dvb-usb/dib0700.h | |||
@@ -60,7 +60,7 @@ extern int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff); | |||
60 | extern struct i2c_algorithm dib0700_i2c_algo; | 60 | extern struct i2c_algorithm dib0700_i2c_algo; |
61 | extern int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, | 61 | extern int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props, |
62 | struct dvb_usb_device_description **desc, int *cold); | 62 | struct dvb_usb_device_description **desc, int *cold); |
63 | extern int dib0700_change_protocol(void *priv, u64 ir_type); | 63 | extern int dib0700_change_protocol(struct rc_dev *dev, u64 rc_type); |
64 | 64 | ||
65 | extern int dib0700_device_count; | 65 | extern int dib0700_device_count; |
66 | extern int dvb_usb_dib0700_ir_proto; | 66 | extern int dvb_usb_dib0700_ir_proto; |
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c index 48397f103d32..8ca48f76dfa9 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_core.c +++ b/drivers/media/dvb/dvb-usb/dib0700_core.c | |||
@@ -471,19 +471,19 @@ int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
471 | return dib0700_ctrl_wr(adap->dev, b, 4); | 471 | return dib0700_ctrl_wr(adap->dev, b, 4); |
472 | } | 472 | } |
473 | 473 | ||
474 | int dib0700_change_protocol(void *priv, u64 ir_type) | 474 | int dib0700_change_protocol(struct rc_dev *rc, u64 rc_type) |
475 | { | 475 | { |
476 | struct dvb_usb_device *d = priv; | 476 | struct dvb_usb_device *d = rc->priv; |
477 | struct dib0700_state *st = d->priv; | 477 | struct dib0700_state *st = d->priv; |
478 | u8 rc_setup[3] = { REQUEST_SET_RC, 0, 0 }; | 478 | u8 rc_setup[3] = { REQUEST_SET_RC, 0, 0 }; |
479 | int new_proto, ret; | 479 | int new_proto, ret; |
480 | 480 | ||
481 | /* Set the IR mode */ | 481 | /* Set the IR mode */ |
482 | if (ir_type == IR_TYPE_RC5) | 482 | if (rc_type == RC_TYPE_RC5) |
483 | new_proto = 1; | 483 | new_proto = 1; |
484 | else if (ir_type == IR_TYPE_NEC) | 484 | else if (rc_type == RC_TYPE_NEC) |
485 | new_proto = 0; | 485 | new_proto = 0; |
486 | else if (ir_type == IR_TYPE_RC6) { | 486 | else if (rc_type == RC_TYPE_RC6) { |
487 | if (st->fw_version < 0x10200) | 487 | if (st->fw_version < 0x10200) |
488 | return -EINVAL; | 488 | return -EINVAL; |
489 | 489 | ||
@@ -499,7 +499,7 @@ int dib0700_change_protocol(void *priv, u64 ir_type) | |||
499 | return ret; | 499 | return ret; |
500 | } | 500 | } |
501 | 501 | ||
502 | d->props.rc.core.protocol = ir_type; | 502 | d->props.rc.core.protocol = rc_type; |
503 | 503 | ||
504 | return ret; | 504 | return ret; |
505 | } | 505 | } |
@@ -535,7 +535,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) | |||
535 | if (d == NULL) | 535 | if (d == NULL) |
536 | return; | 536 | return; |
537 | 537 | ||
538 | if (d->rc_input_dev == NULL) { | 538 | if (d->rc_dev == NULL) { |
539 | /* This will occur if disable_rc_polling=1 */ | 539 | /* This will occur if disable_rc_polling=1 */ |
540 | usb_free_urb(purb); | 540 | usb_free_urb(purb); |
541 | return; | 541 | return; |
@@ -562,7 +562,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) | |||
562 | purb->actual_length); | 562 | purb->actual_length); |
563 | 563 | ||
564 | switch (d->props.rc.core.protocol) { | 564 | switch (d->props.rc.core.protocol) { |
565 | case IR_TYPE_NEC: | 565 | case RC_TYPE_NEC: |
566 | toggle = 0; | 566 | toggle = 0; |
567 | 567 | ||
568 | /* NEC protocol sends repeat code as 0 0 0 FF */ | 568 | /* NEC protocol sends repeat code as 0 0 0 FF */ |
@@ -600,7 +600,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) | |||
600 | goto resubmit; | 600 | goto resubmit; |
601 | } | 601 | } |
602 | 602 | ||
603 | ir_keydown(d->rc_input_dev, keycode, toggle); | 603 | rc_keydown(d->rc_dev, keycode, toggle); |
604 | 604 | ||
605 | resubmit: | 605 | resubmit: |
606 | /* Clean the buffer before we requeue */ | 606 | /* Clean the buffer before we requeue */ |
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index e06acd1fecb6..defd83964ce2 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
@@ -510,7 +510,7 @@ static int dib0700_rc_query_old_firmware(struct dvb_usb_device *d) | |||
510 | 510 | ||
511 | d->last_event = 0; | 511 | d->last_event = 0; |
512 | switch (d->props.rc.core.protocol) { | 512 | switch (d->props.rc.core.protocol) { |
513 | case IR_TYPE_NEC: | 513 | case RC_TYPE_NEC: |
514 | /* NEC protocol sends repeat code as 0 0 0 FF */ | 514 | /* NEC protocol sends repeat code as 0 0 0 FF */ |
515 | if ((key[3-2] == 0x00) && (key[3-3] == 0x00) && | 515 | if ((key[3-2] == 0x00) && (key[3-3] == 0x00) && |
516 | (key[3] == 0xff)) | 516 | (key[3] == 0xff)) |
@@ -520,13 +520,13 @@ static int dib0700_rc_query_old_firmware(struct dvb_usb_device *d) | |||
520 | d->last_event = keycode; | 520 | d->last_event = keycode; |
521 | } | 521 | } |
522 | 522 | ||
523 | ir_keydown(d->rc_input_dev, keycode, 0); | 523 | rc_keydown(d->rc_dev, keycode, 0); |
524 | break; | 524 | break; |
525 | default: | 525 | default: |
526 | /* RC-5 protocol changes toggle bit on new keypress */ | 526 | /* RC-5 protocol changes toggle bit on new keypress */ |
527 | keycode = key[3-2] << 8 | key[3-3]; | 527 | keycode = key[3-2] << 8 | key[3-3]; |
528 | toggle = key[3-1]; | 528 | toggle = key[3-1]; |
529 | ir_keydown(d->rc_input_dev, keycode, toggle); | 529 | rc_keydown(d->rc_dev, keycode, toggle); |
530 | 530 | ||
531 | break; | 531 | break; |
532 | } | 532 | } |
@@ -1924,12 +1924,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1924 | .rc_interval = DEFAULT_RC_INTERVAL, | 1924 | .rc_interval = DEFAULT_RC_INTERVAL, |
1925 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 1925 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
1926 | .rc_query = dib0700_rc_query_old_firmware, | 1926 | .rc_query = dib0700_rc_query_old_firmware, |
1927 | .rc_props = { | 1927 | .allowed_protos = RC_TYPE_RC5 | |
1928 | .allowed_protos = IR_TYPE_RC5 | | 1928 | RC_TYPE_RC6 | |
1929 | IR_TYPE_RC6 | | 1929 | RC_TYPE_NEC, |
1930 | IR_TYPE_NEC, | 1930 | .change_protocol = dib0700_change_protocol, |
1931 | .change_protocol = dib0700_change_protocol, | ||
1932 | }, | ||
1933 | }, | 1931 | }, |
1934 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 1932 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1935 | 1933 | ||
@@ -1960,12 +1958,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
1960 | .rc_interval = DEFAULT_RC_INTERVAL, | 1958 | .rc_interval = DEFAULT_RC_INTERVAL, |
1961 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 1959 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
1962 | .rc_query = dib0700_rc_query_old_firmware, | 1960 | .rc_query = dib0700_rc_query_old_firmware, |
1963 | .rc_props = { | 1961 | .allowed_protos = RC_TYPE_RC5 | |
1964 | .allowed_protos = IR_TYPE_RC5 | | 1962 | RC_TYPE_RC6 | |
1965 | IR_TYPE_RC6 | | 1963 | RC_TYPE_NEC, |
1966 | IR_TYPE_NEC, | 1964 | .change_protocol = dib0700_change_protocol, |
1967 | .change_protocol = dib0700_change_protocol, | ||
1968 | }, | ||
1969 | }, | 1965 | }, |
1970 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 1966 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
1971 | 1967 | ||
@@ -2021,12 +2017,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2021 | .rc_interval = DEFAULT_RC_INTERVAL, | 2017 | .rc_interval = DEFAULT_RC_INTERVAL, |
2022 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2018 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2023 | .rc_query = dib0700_rc_query_old_firmware, | 2019 | .rc_query = dib0700_rc_query_old_firmware, |
2024 | .rc_props = { | 2020 | .allowed_protos = RC_TYPE_RC5 | |
2025 | .allowed_protos = IR_TYPE_RC5 | | 2021 | RC_TYPE_RC6 | |
2026 | IR_TYPE_RC6 | | 2022 | RC_TYPE_NEC, |
2027 | IR_TYPE_NEC, | 2023 | .change_protocol = dib0700_change_protocol, |
2028 | .change_protocol = dib0700_change_protocol, | ||
2029 | }, | ||
2030 | }, | 2024 | }, |
2031 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2025 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2032 | 2026 | ||
@@ -2065,12 +2059,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2065 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2059 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2066 | .module_name = "dib0700", | 2060 | .module_name = "dib0700", |
2067 | .rc_query = dib0700_rc_query_old_firmware, | 2061 | .rc_query = dib0700_rc_query_old_firmware, |
2068 | .rc_props = { | 2062 | .allowed_protos = RC_TYPE_RC5 | |
2069 | .allowed_protos = IR_TYPE_RC5 | | 2063 | RC_TYPE_RC6 | |
2070 | IR_TYPE_RC6 | | 2064 | RC_TYPE_NEC, |
2071 | IR_TYPE_NEC, | 2065 | .change_protocol = dib0700_change_protocol, |
2072 | .change_protocol = dib0700_change_protocol, | ||
2073 | }, | ||
2074 | }, | 2066 | }, |
2075 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2067 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2076 | 2068 | ||
@@ -2143,12 +2135,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2143 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2135 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2144 | .module_name = "dib0700", | 2136 | .module_name = "dib0700", |
2145 | .rc_query = dib0700_rc_query_old_firmware, | 2137 | .rc_query = dib0700_rc_query_old_firmware, |
2146 | .rc_props = { | 2138 | .allowed_protos = RC_TYPE_RC5 | |
2147 | .allowed_protos = IR_TYPE_RC5 | | 2139 | RC_TYPE_RC6 | |
2148 | IR_TYPE_RC6 | | 2140 | RC_TYPE_NEC, |
2149 | IR_TYPE_NEC, | 2141 | .change_protocol = dib0700_change_protocol, |
2150 | .change_protocol = dib0700_change_protocol, | ||
2151 | }, | ||
2152 | }, | 2142 | }, |
2153 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2143 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2154 | 2144 | ||
@@ -2189,12 +2179,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2189 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2179 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2190 | .module_name = "dib0700", | 2180 | .module_name = "dib0700", |
2191 | .rc_query = dib0700_rc_query_old_firmware, | 2181 | .rc_query = dib0700_rc_query_old_firmware, |
2192 | .rc_props = { | 2182 | .allowed_protos = RC_TYPE_RC5 | |
2193 | .allowed_protos = IR_TYPE_RC5 | | 2183 | RC_TYPE_RC6 | |
2194 | IR_TYPE_RC6 | | 2184 | RC_TYPE_NEC, |
2195 | IR_TYPE_NEC, | 2185 | .change_protocol = dib0700_change_protocol, |
2196 | .change_protocol = dib0700_change_protocol, | ||
2197 | }, | ||
2198 | }, | 2186 | }, |
2199 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2187 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2200 | 2188 | ||
@@ -2259,12 +2247,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2259 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2247 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2260 | .module_name = "dib0700", | 2248 | .module_name = "dib0700", |
2261 | .rc_query = dib0700_rc_query_old_firmware, | 2249 | .rc_query = dib0700_rc_query_old_firmware, |
2262 | .rc_props = { | 2250 | .allowed_protos = RC_TYPE_RC5 | |
2263 | .allowed_protos = IR_TYPE_RC5 | | 2251 | RC_TYPE_RC6 | |
2264 | IR_TYPE_RC6 | | 2252 | RC_TYPE_NEC, |
2265 | IR_TYPE_NEC, | 2253 | .change_protocol = dib0700_change_protocol, |
2266 | .change_protocol = dib0700_change_protocol, | ||
2267 | }, | ||
2268 | }, | 2254 | }, |
2269 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2255 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2270 | 2256 | ||
@@ -2308,12 +2294,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2308 | .rc_codes = RC_MAP_DIB0700_NEC_TABLE, | 2294 | .rc_codes = RC_MAP_DIB0700_NEC_TABLE, |
2309 | .module_name = "dib0700", | 2295 | .module_name = "dib0700", |
2310 | .rc_query = dib0700_rc_query_old_firmware, | 2296 | .rc_query = dib0700_rc_query_old_firmware, |
2311 | .rc_props = { | 2297 | .allowed_protos = RC_TYPE_RC5 | |
2312 | .allowed_protos = IR_TYPE_RC5 | | 2298 | RC_TYPE_RC6 | |
2313 | IR_TYPE_RC6 | | 2299 | RC_TYPE_NEC, |
2314 | IR_TYPE_NEC, | 2300 | .change_protocol = dib0700_change_protocol, |
2315 | .change_protocol = dib0700_change_protocol, | ||
2316 | }, | ||
2317 | }, | 2301 | }, |
2318 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2302 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2319 | 2303 | ||
@@ -2379,12 +2363,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2379 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2363 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2380 | .module_name = "dib0700", | 2364 | .module_name = "dib0700", |
2381 | .rc_query = dib0700_rc_query_old_firmware, | 2365 | .rc_query = dib0700_rc_query_old_firmware, |
2382 | .rc_props = { | 2366 | .allowed_protos = RC_TYPE_RC5 | |
2383 | .allowed_protos = IR_TYPE_RC5 | | 2367 | RC_TYPE_RC6 | |
2384 | IR_TYPE_RC6 | | 2368 | RC_TYPE_NEC, |
2385 | IR_TYPE_NEC, | 2369 | .change_protocol = dib0700_change_protocol, |
2386 | .change_protocol = dib0700_change_protocol, | ||
2387 | }, | ||
2388 | }, | 2370 | }, |
2389 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2371 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2390 | .num_adapters = 1, | 2372 | .num_adapters = 1, |
@@ -2417,12 +2399,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2417 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2399 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2418 | .module_name = "dib0700", | 2400 | .module_name = "dib0700", |
2419 | .rc_query = dib0700_rc_query_old_firmware, | 2401 | .rc_query = dib0700_rc_query_old_firmware, |
2420 | .rc_props = { | 2402 | .allowed_protos = RC_TYPE_RC5 | |
2421 | .allowed_protos = IR_TYPE_RC5 | | 2403 | RC_TYPE_RC6 | |
2422 | IR_TYPE_RC6 | | 2404 | RC_TYPE_NEC, |
2423 | IR_TYPE_NEC, | 2405 | .change_protocol = dib0700_change_protocol, |
2424 | .change_protocol = dib0700_change_protocol, | ||
2425 | }, | ||
2426 | }, | 2406 | }, |
2427 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2407 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2428 | .num_adapters = 1, | 2408 | .num_adapters = 1, |
@@ -2487,12 +2467,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2487 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2467 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2488 | .module_name = "dib0700", | 2468 | .module_name = "dib0700", |
2489 | .rc_query = dib0700_rc_query_old_firmware, | 2469 | .rc_query = dib0700_rc_query_old_firmware, |
2490 | .rc_props = { | 2470 | .allowed_protos = RC_TYPE_RC5 | |
2491 | .allowed_protos = IR_TYPE_RC5 | | 2471 | RC_TYPE_RC6 | |
2492 | IR_TYPE_RC6 | | 2472 | RC_TYPE_NEC, |
2493 | IR_TYPE_NEC, | 2473 | .change_protocol = dib0700_change_protocol, |
2494 | .change_protocol = dib0700_change_protocol, | ||
2495 | }, | ||
2496 | }, | 2474 | }, |
2497 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2475 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2498 | .num_adapters = 1, | 2476 | .num_adapters = 1, |
@@ -2533,12 +2511,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2533 | .rc_codes = RC_MAP_DIB0700_NEC_TABLE, | 2511 | .rc_codes = RC_MAP_DIB0700_NEC_TABLE, |
2534 | .module_name = "dib0700", | 2512 | .module_name = "dib0700", |
2535 | .rc_query = dib0700_rc_query_old_firmware, | 2513 | .rc_query = dib0700_rc_query_old_firmware, |
2536 | .rc_props = { | 2514 | .allowed_protos = RC_TYPE_RC5 | |
2537 | .allowed_protos = IR_TYPE_RC5 | | 2515 | RC_TYPE_RC6 | |
2538 | IR_TYPE_RC6 | | 2516 | RC_TYPE_NEC, |
2539 | IR_TYPE_NEC, | 2517 | .change_protocol = dib0700_change_protocol, |
2540 | .change_protocol = dib0700_change_protocol, | ||
2541 | }, | ||
2542 | }, | 2518 | }, |
2543 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2519 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2544 | .num_adapters = 2, | 2520 | .num_adapters = 2, |
@@ -2584,12 +2560,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2584 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2560 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2585 | .module_name = "dib0700", | 2561 | .module_name = "dib0700", |
2586 | .rc_query = dib0700_rc_query_old_firmware, | 2562 | .rc_query = dib0700_rc_query_old_firmware, |
2587 | .rc_props = { | 2563 | .allowed_protos = RC_TYPE_RC5 | |
2588 | .allowed_protos = IR_TYPE_RC5 | | 2564 | RC_TYPE_RC6 | |
2589 | IR_TYPE_RC6 | | 2565 | RC_TYPE_NEC, |
2590 | IR_TYPE_NEC, | 2566 | .change_protocol = dib0700_change_protocol, |
2591 | .change_protocol = dib0700_change_protocol, | ||
2592 | }, | ||
2593 | }, | 2567 | }, |
2594 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | 2568 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, |
2595 | .num_adapters = 1, | 2569 | .num_adapters = 1, |
@@ -2623,12 +2597,10 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
2623 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | 2597 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, |
2624 | .module_name = "dib0700", | 2598 | .module_name = "dib0700", |
2625 | .rc_query = dib0700_rc_query_old_firmware, | 2599 | .rc_query = dib0700_rc_query_old_firmware, |
2626 | .rc_props = { | 2600 | .allowed_protos = RC_TYPE_RC5 | |
2627 | .allowed_protos = IR_TYPE_RC5 | | 2601 | RC_TYPE_RC6 | |
2628 | IR_TYPE_RC6 | | 2602 | RC_TYPE_NEC, |
2629 | IR_TYPE_NEC, | 2603 | .change_protocol = dib0700_change_protocol, |
2630 | .change_protocol = dib0700_change_protocol, | ||
2631 | }, | ||
2632 | }, | 2604 | }, |
2633 | }, | 2605 | }, |
2634 | }; | 2606 | }; |
diff --git a/drivers/media/dvb/dvb-usb/dibusb-common.c b/drivers/media/dvb/dvb-usb/dibusb-common.c index ba991aa21aff..956f7ae2e510 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-common.c +++ b/drivers/media/dvb/dvb-usb/dibusb-common.c | |||
@@ -327,7 +327,7 @@ EXPORT_SYMBOL(dibusb_dib3000mc_tuner_attach); | |||
327 | /* | 327 | /* |
328 | * common remote control stuff | 328 | * common remote control stuff |
329 | */ | 329 | */ |
330 | struct ir_scancode ir_codes_dibusb_table[] = { | 330 | struct rc_map_table rc_map_dibusb_table[] = { |
331 | /* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */ | 331 | /* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */ |
332 | { 0x0016, KEY_POWER }, | 332 | { 0x0016, KEY_POWER }, |
333 | { 0x0010, KEY_MUTE }, | 333 | { 0x0010, KEY_MUTE }, |
@@ -456,7 +456,7 @@ struct ir_scancode ir_codes_dibusb_table[] = { | |||
456 | { 0x804e, KEY_ENTER }, | 456 | { 0x804e, KEY_ENTER }, |
457 | { 0x804f, KEY_VOLUMEDOWN }, | 457 | { 0x804f, KEY_VOLUMEDOWN }, |
458 | }; | 458 | }; |
459 | EXPORT_SYMBOL(ir_codes_dibusb_table); | 459 | EXPORT_SYMBOL(rc_map_dibusb_table); |
460 | 460 | ||
461 | int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 461 | int dibusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
462 | { | 462 | { |
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c index 8e3c0d2cce16..04d91bdd3562 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c | |||
@@ -213,8 +213,8 @@ static struct dvb_usb_device_properties dibusb1_1_properties = { | |||
213 | 213 | ||
214 | .rc.legacy = { | 214 | .rc.legacy = { |
215 | .rc_interval = DEFAULT_RC_INTERVAL, | 215 | .rc_interval = DEFAULT_RC_INTERVAL, |
216 | .rc_key_map = ir_codes_dibusb_table, | 216 | .rc_map_table = rc_map_dibusb_table, |
217 | .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ | 217 | .rc_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ |
218 | .rc_query = dibusb_rc_query, | 218 | .rc_query = dibusb_rc_query, |
219 | }, | 219 | }, |
220 | 220 | ||
@@ -299,8 +299,8 @@ static struct dvb_usb_device_properties dibusb1_1_an2235_properties = { | |||
299 | 299 | ||
300 | .rc.legacy = { | 300 | .rc.legacy = { |
301 | .rc_interval = DEFAULT_RC_INTERVAL, | 301 | .rc_interval = DEFAULT_RC_INTERVAL, |
302 | .rc_key_map = ir_codes_dibusb_table, | 302 | .rc_map_table = rc_map_dibusb_table, |
303 | .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ | 303 | .rc_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ |
304 | .rc_query = dibusb_rc_query, | 304 | .rc_query = dibusb_rc_query, |
305 | }, | 305 | }, |
306 | 306 | ||
@@ -365,8 +365,8 @@ static struct dvb_usb_device_properties dibusb2_0b_properties = { | |||
365 | 365 | ||
366 | .rc.legacy = { | 366 | .rc.legacy = { |
367 | .rc_interval = DEFAULT_RC_INTERVAL, | 367 | .rc_interval = DEFAULT_RC_INTERVAL, |
368 | .rc_key_map = ir_codes_dibusb_table, | 368 | .rc_map_table = rc_map_dibusb_table, |
369 | .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ | 369 | .rc_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ |
370 | .rc_query = dibusb_rc_query, | 370 | .rc_query = dibusb_rc_query, |
371 | }, | 371 | }, |
372 | 372 | ||
@@ -424,8 +424,8 @@ static struct dvb_usb_device_properties artec_t1_usb2_properties = { | |||
424 | 424 | ||
425 | .rc.legacy = { | 425 | .rc.legacy = { |
426 | .rc_interval = DEFAULT_RC_INTERVAL, | 426 | .rc_interval = DEFAULT_RC_INTERVAL, |
427 | .rc_key_map = ir_codes_dibusb_table, | 427 | .rc_map_table = rc_map_dibusb_table, |
428 | .rc_key_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ | 428 | .rc_map_size = 111, /* wow, that is ugly ... I want to load it to the driver dynamically */ |
429 | .rc_query = dibusb_rc_query, | 429 | .rc_query = dibusb_rc_query, |
430 | }, | 430 | }, |
431 | 431 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c index 1cbc41cb4e8f..c1d9094b61e5 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mc.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c | |||
@@ -83,8 +83,8 @@ static struct dvb_usb_device_properties dibusb_mc_properties = { | |||
83 | 83 | ||
84 | .rc.legacy = { | 84 | .rc.legacy = { |
85 | .rc_interval = DEFAULT_RC_INTERVAL, | 85 | .rc_interval = DEFAULT_RC_INTERVAL, |
86 | .rc_key_map = ir_codes_dibusb_table, | 86 | .rc_map_table = rc_map_dibusb_table, |
87 | .rc_key_map_size = 111, /* FIXME */ | 87 | .rc_map_size = 111, /* FIXME */ |
88 | .rc_query = dibusb_rc_query, | 88 | .rc_query = dibusb_rc_query, |
89 | }, | 89 | }, |
90 | 90 | ||
diff --git a/drivers/media/dvb/dvb-usb/dibusb.h b/drivers/media/dvb/dvb-usb/dibusb.h index 61a6bf389472..e47c321b3ffc 100644 --- a/drivers/media/dvb/dvb-usb/dibusb.h +++ b/drivers/media/dvb/dvb-usb/dibusb.h | |||
@@ -124,7 +124,7 @@ extern int dibusb2_0_power_ctrl(struct dvb_usb_device *, int); | |||
124 | #define DEFAULT_RC_INTERVAL 150 | 124 | #define DEFAULT_RC_INTERVAL 150 |
125 | //#define DEFAULT_RC_INTERVAL 100000 | 125 | //#define DEFAULT_RC_INTERVAL 100000 |
126 | 126 | ||
127 | extern struct ir_scancode ir_codes_dibusb_table[]; | 127 | extern struct rc_map_table rc_map_dibusb_table[]; |
128 | extern int dibusb_rc_query(struct dvb_usb_device *, u32 *, int *); | 128 | extern int dibusb_rc_query(struct dvb_usb_device *, u32 *, int *); |
129 | extern int dibusb_read_eeprom_byte(struct dvb_usb_device *, u8, u8 *); | 129 | extern int dibusb_read_eeprom_byte(struct dvb_usb_device *, u8, u8 *); |
130 | 130 | ||
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index 13d006bb19db..f2dbce7edb3b 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -161,7 +161,7 @@ static int digitv_tuner_attach(struct dvb_usb_adapter *adap) | |||
161 | return 0; | 161 | return 0; |
162 | } | 162 | } |
163 | 163 | ||
164 | static struct ir_scancode ir_codes_digitv_table[] = { | 164 | static struct rc_map_table rc_map_digitv_table[] = { |
165 | { 0x5f55, KEY_0 }, | 165 | { 0x5f55, KEY_0 }, |
166 | { 0x6f55, KEY_1 }, | 166 | { 0x6f55, KEY_1 }, |
167 | { 0x9f55, KEY_2 }, | 167 | { 0x9f55, KEY_2 }, |
@@ -237,10 +237,10 @@ static int digitv_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
237 | /* if something is inside the buffer, simulate key press */ | 237 | /* if something is inside the buffer, simulate key press */ |
238 | if (key[1] != 0) | 238 | if (key[1] != 0) |
239 | { | 239 | { |
240 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { | 240 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) { |
241 | if (rc5_custom(&d->props.rc.legacy.rc_key_map[i]) == key[1] && | 241 | if (rc5_custom(&d->props.rc.legacy.rc_map_table[i]) == key[1] && |
242 | rc5_data(&d->props.rc.legacy.rc_key_map[i]) == key[2]) { | 242 | rc5_data(&d->props.rc.legacy.rc_map_table[i]) == key[2]) { |
243 | *event = d->props.rc.legacy.rc_key_map[i].keycode; | 243 | *event = d->props.rc.legacy.rc_map_table[i].keycode; |
244 | *state = REMOTE_KEY_PRESSED; | 244 | *state = REMOTE_KEY_PRESSED; |
245 | return 0; | 245 | return 0; |
246 | } | 246 | } |
@@ -312,8 +312,8 @@ static struct dvb_usb_device_properties digitv_properties = { | |||
312 | 312 | ||
313 | .rc.legacy = { | 313 | .rc.legacy = { |
314 | .rc_interval = 1000, | 314 | .rc_interval = 1000, |
315 | .rc_key_map = ir_codes_digitv_table, | 315 | .rc_map_table = rc_map_digitv_table, |
316 | .rc_key_map_size = ARRAY_SIZE(ir_codes_digitv_table), | 316 | .rc_map_size = ARRAY_SIZE(rc_map_digitv_table), |
317 | .rc_query = digitv_rc_query, | 317 | .rc_query = digitv_rc_query, |
318 | }, | 318 | }, |
319 | 319 | ||
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c index ca495e07f35c..ecd86eca2548 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u.c +++ b/drivers/media/dvb/dvb-usb/dtt200u.c | |||
@@ -57,7 +57,7 @@ static int dtt200u_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, | |||
57 | 57 | ||
58 | /* remote control */ | 58 | /* remote control */ |
59 | /* key list for the tiny remote control (Yakumo, don't know about the others) */ | 59 | /* key list for the tiny remote control (Yakumo, don't know about the others) */ |
60 | static struct ir_scancode ir_codes_dtt200u_table[] = { | 60 | static struct rc_map_table rc_map_dtt200u_table[] = { |
61 | { 0x8001, KEY_MUTE }, | 61 | { 0x8001, KEY_MUTE }, |
62 | { 0x8002, KEY_CHANNELDOWN }, | 62 | { 0x8002, KEY_CHANNELDOWN }, |
63 | { 0x8003, KEY_VOLUMEDOWN }, | 63 | { 0x8003, KEY_VOLUMEDOWN }, |
@@ -163,8 +163,8 @@ static struct dvb_usb_device_properties dtt200u_properties = { | |||
163 | 163 | ||
164 | .rc.legacy = { | 164 | .rc.legacy = { |
165 | .rc_interval = 300, | 165 | .rc_interval = 300, |
166 | .rc_key_map = ir_codes_dtt200u_table, | 166 | .rc_map_table = rc_map_dtt200u_table, |
167 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), | 167 | .rc_map_size = ARRAY_SIZE(rc_map_dtt200u_table), |
168 | .rc_query = dtt200u_rc_query, | 168 | .rc_query = dtt200u_rc_query, |
169 | }, | 169 | }, |
170 | 170 | ||
@@ -210,8 +210,8 @@ static struct dvb_usb_device_properties wt220u_properties = { | |||
210 | 210 | ||
211 | .rc.legacy = { | 211 | .rc.legacy = { |
212 | .rc_interval = 300, | 212 | .rc_interval = 300, |
213 | .rc_key_map = ir_codes_dtt200u_table, | 213 | .rc_map_table = rc_map_dtt200u_table, |
214 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), | 214 | .rc_map_size = ARRAY_SIZE(rc_map_dtt200u_table), |
215 | .rc_query = dtt200u_rc_query, | 215 | .rc_query = dtt200u_rc_query, |
216 | }, | 216 | }, |
217 | 217 | ||
@@ -257,8 +257,8 @@ static struct dvb_usb_device_properties wt220u_fc_properties = { | |||
257 | 257 | ||
258 | .rc.legacy = { | 258 | .rc.legacy = { |
259 | .rc_interval = 300, | 259 | .rc_interval = 300, |
260 | .rc_key_map = ir_codes_dtt200u_table, | 260 | .rc_map_table = rc_map_dtt200u_table, |
261 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), | 261 | .rc_map_size = ARRAY_SIZE(rc_map_dtt200u_table), |
262 | .rc_query = dtt200u_rc_query, | 262 | .rc_query = dtt200u_rc_query, |
263 | }, | 263 | }, |
264 | 264 | ||
@@ -304,8 +304,8 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = { | |||
304 | 304 | ||
305 | .rc.legacy = { | 305 | .rc.legacy = { |
306 | .rc_interval = 300, | 306 | .rc_interval = 300, |
307 | .rc_key_map = ir_codes_dtt200u_table, | 307 | .rc_map_table = rc_map_dtt200u_table, |
308 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dtt200u_table), | 308 | .rc_map_size = ARRAY_SIZE(rc_map_dtt200u_table), |
309 | .rc_query = dtt200u_rc_query, | 309 | .rc_query = dtt200u_rc_query, |
310 | }, | 310 | }, |
311 | 311 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 192a40ce583d..1a6310b61923 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -301,6 +301,7 @@ | |||
301 | #define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011 | 301 | #define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011 |
302 | #define USB_PID_ELGATO_EYETV_DTT 0x0021 | 302 | #define USB_PID_ELGATO_EYETV_DTT 0x0021 |
303 | #define USB_PID_ELGATO_EYETV_DTT_Dlx 0x0020 | 303 | #define USB_PID_ELGATO_EYETV_DTT_Dlx 0x0020 |
304 | #define USB_PID_ELGATO_EYETV_SAT 0x002a | ||
304 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000 | 305 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000 |
305 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM 0x5001 | 306 | #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM 0x5001 |
306 | #define USB_PID_FRIIO_WHITE 0x0001 | 307 | #define USB_PID_FRIIO_WHITE 0x0001 |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c index b579fed3ab3f..c6498f536dff 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c | |||
@@ -13,11 +13,11 @@ static int legacy_dvb_usb_getkeycode(struct input_dev *dev, | |||
13 | { | 13 | { |
14 | struct dvb_usb_device *d = input_get_drvdata(dev); | 14 | struct dvb_usb_device *d = input_get_drvdata(dev); |
15 | 15 | ||
16 | struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; | 16 | struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; |
17 | int i; | 17 | int i; |
18 | 18 | ||
19 | /* See if we can match the raw key code. */ | 19 | /* See if we can match the raw key code. */ |
20 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) | 20 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) |
21 | if (keymap[i].scancode == scancode) { | 21 | if (keymap[i].scancode == scancode) { |
22 | *keycode = keymap[i].keycode; | 22 | *keycode = keymap[i].keycode; |
23 | return 0; | 23 | return 0; |
@@ -28,7 +28,7 @@ static int legacy_dvb_usb_getkeycode(struct input_dev *dev, | |||
28 | * otherwise, input core won't let legacy_dvb_usb_setkeycode | 28 | * otherwise, input core won't let legacy_dvb_usb_setkeycode |
29 | * to work | 29 | * to work |
30 | */ | 30 | */ |
31 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) | 31 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) |
32 | if (keymap[i].keycode == KEY_RESERVED || | 32 | if (keymap[i].keycode == KEY_RESERVED || |
33 | keymap[i].keycode == KEY_UNKNOWN) { | 33 | keymap[i].keycode == KEY_UNKNOWN) { |
34 | *keycode = KEY_RESERVED; | 34 | *keycode = KEY_RESERVED; |
@@ -43,18 +43,18 @@ static int legacy_dvb_usb_setkeycode(struct input_dev *dev, | |||
43 | { | 43 | { |
44 | struct dvb_usb_device *d = input_get_drvdata(dev); | 44 | struct dvb_usb_device *d = input_get_drvdata(dev); |
45 | 45 | ||
46 | struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; | 46 | struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; |
47 | int i; | 47 | int i; |
48 | 48 | ||
49 | /* Search if it is replacing an existing keycode */ | 49 | /* Search if it is replacing an existing keycode */ |
50 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) | 50 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) |
51 | if (keymap[i].scancode == scancode) { | 51 | if (keymap[i].scancode == scancode) { |
52 | keymap[i].keycode = keycode; | 52 | keymap[i].keycode = keycode; |
53 | return 0; | 53 | return 0; |
54 | } | 54 | } |
55 | 55 | ||
56 | /* Search if is there a clean entry. If so, use it */ | 56 | /* Search if is there a clean entry. If so, use it */ |
57 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) | 57 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) |
58 | if (keymap[i].keycode == KEY_RESERVED || | 58 | if (keymap[i].keycode == KEY_RESERVED || |
59 | keymap[i].keycode == KEY_UNKNOWN) { | 59 | keymap[i].keycode == KEY_UNKNOWN) { |
60 | keymap[i].scancode = scancode; | 60 | keymap[i].scancode = scancode; |
@@ -106,10 +106,10 @@ static void legacy_dvb_usb_read_remote_control(struct work_struct *work) | |||
106 | d->last_event = event; | 106 | d->last_event = event; |
107 | case REMOTE_KEY_REPEAT: | 107 | case REMOTE_KEY_REPEAT: |
108 | deb_rc("key repeated\n"); | 108 | deb_rc("key repeated\n"); |
109 | input_event(d->rc_input_dev, EV_KEY, event, 1); | 109 | input_event(d->input_dev, EV_KEY, event, 1); |
110 | input_sync(d->rc_input_dev); | 110 | input_sync(d->input_dev); |
111 | input_event(d->rc_input_dev, EV_KEY, d->last_event, 0); | 111 | input_event(d->input_dev, EV_KEY, d->last_event, 0); |
112 | input_sync(d->rc_input_dev); | 112 | input_sync(d->input_dev); |
113 | break; | 113 | break; |
114 | default: | 114 | default: |
115 | break; | 115 | break; |
@@ -154,20 +154,32 @@ schedule: | |||
154 | schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc.legacy.rc_interval)); | 154 | schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc.legacy.rc_interval)); |
155 | } | 155 | } |
156 | 156 | ||
157 | static int legacy_dvb_usb_remote_init(struct dvb_usb_device *d, | 157 | static int legacy_dvb_usb_remote_init(struct dvb_usb_device *d) |
158 | struct input_dev *input_dev) | ||
159 | { | 158 | { |
160 | int i, err, rc_interval; | 159 | int i, err, rc_interval; |
160 | struct input_dev *input_dev; | ||
161 | |||
162 | input_dev = input_allocate_device(); | ||
163 | if (!input_dev) | ||
164 | return -ENOMEM; | ||
165 | |||
166 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | ||
167 | input_dev->name = "IR-receiver inside an USB DVB receiver"; | ||
168 | input_dev->phys = d->rc_phys; | ||
169 | usb_to_input_id(d->udev, &input_dev->id); | ||
170 | input_dev->dev.parent = &d->udev->dev; | ||
171 | d->input_dev = input_dev; | ||
172 | d->rc_dev = NULL; | ||
161 | 173 | ||
162 | input_dev->getkeycode = legacy_dvb_usb_getkeycode; | 174 | input_dev->getkeycode = legacy_dvb_usb_getkeycode; |
163 | input_dev->setkeycode = legacy_dvb_usb_setkeycode; | 175 | input_dev->setkeycode = legacy_dvb_usb_setkeycode; |
164 | 176 | ||
165 | /* set the bits for the keys */ | 177 | /* set the bits for the keys */ |
166 | deb_rc("key map size: %d\n", d->props.rc.legacy.rc_key_map_size); | 178 | deb_rc("key map size: %d\n", d->props.rc.legacy.rc_map_size); |
167 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) { | 179 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) { |
168 | deb_rc("setting bit for event %d item %d\n", | 180 | deb_rc("setting bit for event %d item %d\n", |
169 | d->props.rc.legacy.rc_key_map[i].keycode, i); | 181 | d->props.rc.legacy.rc_map_table[i].keycode, i); |
170 | set_bit(d->props.rc.legacy.rc_key_map[i].keycode, input_dev->keybit); | 182 | set_bit(d->props.rc.legacy.rc_map_table[i].keycode, input_dev->keybit); |
171 | } | 183 | } |
172 | 184 | ||
173 | /* setting these two values to non-zero, we have to manage key repeats */ | 185 | /* setting these two values to non-zero, we have to manage key repeats */ |
@@ -221,18 +233,34 @@ static void dvb_usb_read_remote_control(struct work_struct *work) | |||
221 | msecs_to_jiffies(d->props.rc.core.rc_interval)); | 233 | msecs_to_jiffies(d->props.rc.core.rc_interval)); |
222 | } | 234 | } |
223 | 235 | ||
224 | static int rc_core_dvb_usb_remote_init(struct dvb_usb_device *d, | 236 | static int rc_core_dvb_usb_remote_init(struct dvb_usb_device *d) |
225 | struct input_dev *input_dev) | ||
226 | { | 237 | { |
227 | int err, rc_interval; | 238 | int err, rc_interval; |
239 | struct rc_dev *dev; | ||
240 | |||
241 | dev = rc_allocate_device(); | ||
242 | if (!dev) | ||
243 | return -ENOMEM; | ||
228 | 244 | ||
229 | d->props.rc.core.rc_props.priv = d; | 245 | dev->driver_name = d->props.rc.core.module_name; |
230 | err = ir_input_register(input_dev, | 246 | dev->map_name = d->props.rc.core.rc_codes; |
231 | d->props.rc.core.rc_codes, | 247 | dev->change_protocol = d->props.rc.core.change_protocol; |
232 | &d->props.rc.core.rc_props, | 248 | dev->allowed_protos = d->props.rc.core.allowed_protos; |
233 | d->props.rc.core.module_name); | 249 | dev->driver_type = RC_DRIVER_SCANCODE; |
234 | if (err < 0) | 250 | usb_to_input_id(d->udev, &dev->input_id); |
251 | dev->input_name = "IR-receiver inside an USB DVB receiver"; | ||
252 | dev->input_phys = d->rc_phys; | ||
253 | dev->dev.parent = &d->udev->dev; | ||
254 | dev->priv = d; | ||
255 | |||
256 | err = rc_register_device(dev); | ||
257 | if (err < 0) { | ||
258 | rc_free_device(dev); | ||
235 | return err; | 259 | return err; |
260 | } | ||
261 | |||
262 | d->input_dev = NULL; | ||
263 | d->rc_dev = dev; | ||
236 | 264 | ||
237 | if (!d->props.rc.core.rc_query || d->props.rc.core.bulk_mode) | 265 | if (!d->props.rc.core.rc_query || d->props.rc.core.bulk_mode) |
238 | return 0; | 266 | return 0; |
@@ -251,13 +279,12 @@ static int rc_core_dvb_usb_remote_init(struct dvb_usb_device *d, | |||
251 | 279 | ||
252 | int dvb_usb_remote_init(struct dvb_usb_device *d) | 280 | int dvb_usb_remote_init(struct dvb_usb_device *d) |
253 | { | 281 | { |
254 | struct input_dev *input_dev; | ||
255 | int err; | 282 | int err; |
256 | 283 | ||
257 | if (dvb_usb_disable_rc_polling) | 284 | if (dvb_usb_disable_rc_polling) |
258 | return 0; | 285 | return 0; |
259 | 286 | ||
260 | if (d->props.rc.legacy.rc_key_map && d->props.rc.legacy.rc_query) | 287 | if (d->props.rc.legacy.rc_map_table && d->props.rc.legacy.rc_query) |
261 | d->props.rc.mode = DVB_RC_LEGACY; | 288 | d->props.rc.mode = DVB_RC_LEGACY; |
262 | else if (d->props.rc.core.rc_codes) | 289 | else if (d->props.rc.core.rc_codes) |
263 | d->props.rc.mode = DVB_RC_CORE; | 290 | d->props.rc.mode = DVB_RC_CORE; |
@@ -267,26 +294,14 @@ int dvb_usb_remote_init(struct dvb_usb_device *d) | |||
267 | usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys)); | 294 | usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys)); |
268 | strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys)); | 295 | strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys)); |
269 | 296 | ||
270 | input_dev = input_allocate_device(); | ||
271 | if (!input_dev) | ||
272 | return -ENOMEM; | ||
273 | |||
274 | input_dev->evbit[0] = BIT_MASK(EV_KEY); | ||
275 | input_dev->name = "IR-receiver inside an USB DVB receiver"; | ||
276 | input_dev->phys = d->rc_phys; | ||
277 | usb_to_input_id(d->udev, &input_dev->id); | ||
278 | input_dev->dev.parent = &d->udev->dev; | ||
279 | |||
280 | /* Start the remote-control polling. */ | 297 | /* Start the remote-control polling. */ |
281 | if (d->props.rc.legacy.rc_interval < 40) | 298 | if (d->props.rc.legacy.rc_interval < 40) |
282 | d->props.rc.legacy.rc_interval = 100; /* default */ | 299 | d->props.rc.legacy.rc_interval = 100; /* default */ |
283 | 300 | ||
284 | d->rc_input_dev = input_dev; | ||
285 | |||
286 | if (d->props.rc.mode == DVB_RC_LEGACY) | 301 | if (d->props.rc.mode == DVB_RC_LEGACY) |
287 | err = legacy_dvb_usb_remote_init(d, input_dev); | 302 | err = legacy_dvb_usb_remote_init(d); |
288 | else | 303 | else |
289 | err = rc_core_dvb_usb_remote_init(d, input_dev); | 304 | err = rc_core_dvb_usb_remote_init(d); |
290 | if (err) | 305 | if (err) |
291 | return err; | 306 | return err; |
292 | 307 | ||
@@ -301,9 +316,9 @@ int dvb_usb_remote_exit(struct dvb_usb_device *d) | |||
301 | cancel_rearming_delayed_work(&d->rc_query_work); | 316 | cancel_rearming_delayed_work(&d->rc_query_work); |
302 | flush_scheduled_work(); | 317 | flush_scheduled_work(); |
303 | if (d->props.rc.mode == DVB_RC_LEGACY) | 318 | if (d->props.rc.mode == DVB_RC_LEGACY) |
304 | input_unregister_device(d->rc_input_dev); | 319 | input_unregister_device(d->input_dev); |
305 | else | 320 | else |
306 | ir_input_unregister(d->rc_input_dev); | 321 | rc_unregister_device(d->rc_dev); |
307 | } | 322 | } |
308 | d->state &= ~DVB_USB_STATE_REMOTE; | 323 | d->state &= ~DVB_USB_STATE_REMOTE; |
309 | return 0; | 324 | return 0; |
@@ -316,7 +331,7 @@ int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, | |||
316 | u8 keybuf[5], u32 *event, int *state) | 331 | u8 keybuf[5], u32 *event, int *state) |
317 | { | 332 | { |
318 | int i; | 333 | int i; |
319 | struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; | 334 | struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; |
320 | *event = 0; | 335 | *event = 0; |
321 | *state = REMOTE_NO_KEY_PRESSED; | 336 | *state = REMOTE_NO_KEY_PRESSED; |
322 | switch (keybuf[0]) { | 337 | switch (keybuf[0]) { |
@@ -329,7 +344,7 @@ int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *d, | |||
329 | break; | 344 | break; |
330 | } | 345 | } |
331 | /* See if we can match the raw key code. */ | 346 | /* See if we can match the raw key code. */ |
332 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) | 347 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) |
333 | if (rc5_custom(&keymap[i]) == keybuf[1] && | 348 | if (rc5_custom(&keymap[i]) == keybuf[1] && |
334 | rc5_data(&keymap[i]) == keybuf[3]) { | 349 | rc5_data(&keymap[i]) == keybuf[3]) { |
335 | *event = keymap[i].keycode; | 350 | *event = keymap[i].keycode; |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 34f7b3ba8cc7..65fa9268e7f7 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/usb.h> | 14 | #include <linux/usb.h> |
15 | #include <linux/firmware.h> | 15 | #include <linux/firmware.h> |
16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
17 | #include <media/ir-core.h> | 17 | #include <media/rc-core.h> |
18 | 18 | ||
19 | #include "dvb_frontend.h" | 19 | #include "dvb_frontend.h" |
20 | #include "dvb_demux.h" | 20 | #include "dvb_demux.h" |
@@ -75,17 +75,17 @@ struct dvb_usb_device_description { | |||
75 | struct usb_device_id *warm_ids[DVB_USB_ID_MAX_NUM]; | 75 | struct usb_device_id *warm_ids[DVB_USB_ID_MAX_NUM]; |
76 | }; | 76 | }; |
77 | 77 | ||
78 | static inline u8 rc5_custom(struct ir_scancode *key) | 78 | static inline u8 rc5_custom(struct rc_map_table *key) |
79 | { | 79 | { |
80 | return (key->scancode >> 8) & 0xff; | 80 | return (key->scancode >> 8) & 0xff; |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline u8 rc5_data(struct ir_scancode *key) | 83 | static inline u8 rc5_data(struct rc_map_table *key) |
84 | { | 84 | { |
85 | return key->scancode & 0xff; | 85 | return key->scancode & 0xff; |
86 | } | 86 | } |
87 | 87 | ||
88 | static inline u8 rc5_scan(struct ir_scancode *key) | 88 | static inline u8 rc5_scan(struct rc_map_table *key) |
89 | { | 89 | { |
90 | return key->scancode & 0xffff; | 90 | return key->scancode & 0xffff; |
91 | } | 91 | } |
@@ -159,9 +159,9 @@ struct dvb_usb_adapter_properties { | |||
159 | 159 | ||
160 | /** | 160 | /** |
161 | * struct dvb_rc_legacy - old properties of remote controller | 161 | * struct dvb_rc_legacy - old properties of remote controller |
162 | * @rc_key_map: a hard-wired array of struct ir_scancode (NULL to disable | 162 | * @rc_map_table: a hard-wired array of struct rc_map_table (NULL to disable |
163 | * remote control handling). | 163 | * remote control handling). |
164 | * @rc_key_map_size: number of items in @rc_key_map. | 164 | * @rc_map_size: number of items in @rc_map_table. |
165 | * @rc_query: called to query an event event. | 165 | * @rc_query: called to query an event event. |
166 | * @rc_interval: time in ms between two queries. | 166 | * @rc_interval: time in ms between two queries. |
167 | */ | 167 | */ |
@@ -170,8 +170,8 @@ struct dvb_rc_legacy { | |||
170 | #define REMOTE_NO_KEY_PRESSED 0x00 | 170 | #define REMOTE_NO_KEY_PRESSED 0x00 |
171 | #define REMOTE_KEY_PRESSED 0x01 | 171 | #define REMOTE_KEY_PRESSED 0x01 |
172 | #define REMOTE_KEY_REPEAT 0x02 | 172 | #define REMOTE_KEY_REPEAT 0x02 |
173 | struct ir_scancode *rc_key_map; | 173 | struct rc_map_table *rc_map_table; |
174 | int rc_key_map_size; | 174 | int rc_map_size; |
175 | int (*rc_query) (struct dvb_usb_device *, u32 *, int *); | 175 | int (*rc_query) (struct dvb_usb_device *, u32 *, int *); |
176 | int rc_interval; | 176 | int rc_interval; |
177 | }; | 177 | }; |
@@ -180,18 +180,20 @@ struct dvb_rc_legacy { | |||
180 | * struct dvb_rc properties of remote controller, using rc-core | 180 | * struct dvb_rc properties of remote controller, using rc-core |
181 | * @rc_codes: name of rc codes table | 181 | * @rc_codes: name of rc codes table |
182 | * @protocol: type of protocol(s) currently used by the driver | 182 | * @protocol: type of protocol(s) currently used by the driver |
183 | * @allowed_protos: protocol(s) supported by the driver | ||
184 | * @change_protocol: callback to change protocol | ||
183 | * @rc_query: called to query an event event. | 185 | * @rc_query: called to query an event event. |
184 | * @rc_interval: time in ms between two queries. | 186 | * @rc_interval: time in ms between two queries. |
185 | * @rc_props: remote controller properties | ||
186 | * @bulk_mode: device supports bulk mode for RC (disable polling mode) | 187 | * @bulk_mode: device supports bulk mode for RC (disable polling mode) |
187 | */ | 188 | */ |
188 | struct dvb_rc { | 189 | struct dvb_rc { |
189 | char *rc_codes; | 190 | char *rc_codes; |
190 | u64 protocol; | 191 | u64 protocol; |
192 | u64 allowed_protos; | ||
193 | int (*change_protocol)(struct rc_dev *dev, u64 rc_type); | ||
191 | char *module_name; | 194 | char *module_name; |
192 | int (*rc_query) (struct dvb_usb_device *d); | 195 | int (*rc_query) (struct dvb_usb_device *d); |
193 | int rc_interval; | 196 | int rc_interval; |
194 | struct ir_dev_props rc_props; | ||
195 | bool bulk_mode; /* uses bulk mode */ | 197 | bool bulk_mode; /* uses bulk mode */ |
196 | }; | 198 | }; |
197 | 199 | ||
@@ -385,7 +387,8 @@ struct dvb_usb_adapter { | |||
385 | * | 387 | * |
386 | * @i2c_adap: device's i2c_adapter if it uses I2CoverUSB | 388 | * @i2c_adap: device's i2c_adapter if it uses I2CoverUSB |
387 | * | 389 | * |
388 | * @rc_input_dev: input device for the remote control. | 390 | * @rc_dev: rc device for the remote control (rc-core mode) |
391 | * @input_dev: input device for the remote control (legacy mode) | ||
389 | * @rc_query_work: struct work_struct frequent rc queries | 392 | * @rc_query_work: struct work_struct frequent rc queries |
390 | * @last_event: last triggered event | 393 | * @last_event: last triggered event |
391 | * @last_state: last state (no, pressed, repeat) | 394 | * @last_state: last state (no, pressed, repeat) |
@@ -418,7 +421,8 @@ struct dvb_usb_device { | |||
418 | struct dvb_usb_adapter adapter[MAX_NO_OF_ADAPTER_PER_DEVICE]; | 421 | struct dvb_usb_adapter adapter[MAX_NO_OF_ADAPTER_PER_DEVICE]; |
419 | 422 | ||
420 | /* remote control */ | 423 | /* remote control */ |
421 | struct input_dev *rc_input_dev; | 424 | struct rc_dev *rc_dev; |
425 | struct input_dev *input_dev; | ||
422 | char rc_phys[64]; | 426 | char rc_phys[64]; |
423 | struct delayed_work rc_query_work; | 427 | struct delayed_work rc_query_work; |
424 | u32 last_event; | 428 | u32 last_event; |
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index 774df88dc6e3..2c307ba0d28b 100644 --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c | |||
@@ -73,8 +73,8 @@ | |||
73 | "Please see linux/Documentation/dvb/ for more details " \ | 73 | "Please see linux/Documentation/dvb/ for more details " \ |
74 | "on firmware-problems." | 74 | "on firmware-problems." |
75 | 75 | ||
76 | struct ir_codes_dvb_usb_table_table { | 76 | struct rc_map_dvb_usb_table_table { |
77 | struct ir_scancode *rc_keys; | 77 | struct rc_map_table *rc_keys; |
78 | int rc_keys_size; | 78 | int rc_keys_size; |
79 | }; | 79 | }; |
80 | 80 | ||
@@ -948,7 +948,7 @@ static int dw3101_tuner_attach(struct dvb_usb_adapter *adap) | |||
948 | return 0; | 948 | return 0; |
949 | } | 949 | } |
950 | 950 | ||
951 | static struct ir_scancode ir_codes_dw210x_table[] = { | 951 | static struct rc_map_table rc_map_dw210x_table[] = { |
952 | { 0xf80a, KEY_Q }, /*power*/ | 952 | { 0xf80a, KEY_Q }, /*power*/ |
953 | { 0xf80c, KEY_M }, /*mute*/ | 953 | { 0xf80c, KEY_M }, /*mute*/ |
954 | { 0xf811, KEY_1 }, | 954 | { 0xf811, KEY_1 }, |
@@ -982,7 +982,7 @@ static struct ir_scancode ir_codes_dw210x_table[] = { | |||
982 | { 0xf81b, KEY_B }, /*recall*/ | 982 | { 0xf81b, KEY_B }, /*recall*/ |
983 | }; | 983 | }; |
984 | 984 | ||
985 | static struct ir_scancode ir_codes_tevii_table[] = { | 985 | static struct rc_map_table rc_map_tevii_table[] = { |
986 | { 0xf80a, KEY_POWER }, | 986 | { 0xf80a, KEY_POWER }, |
987 | { 0xf80c, KEY_MUTE }, | 987 | { 0xf80c, KEY_MUTE }, |
988 | { 0xf811, KEY_1 }, | 988 | { 0xf811, KEY_1 }, |
@@ -1032,7 +1032,7 @@ static struct ir_scancode ir_codes_tevii_table[] = { | |||
1032 | { 0xf858, KEY_SWITCHVIDEOMODE }, | 1032 | { 0xf858, KEY_SWITCHVIDEOMODE }, |
1033 | }; | 1033 | }; |
1034 | 1034 | ||
1035 | static struct ir_scancode ir_codes_tbs_table[] = { | 1035 | static struct rc_map_table rc_map_tbs_table[] = { |
1036 | { 0xf884, KEY_POWER }, | 1036 | { 0xf884, KEY_POWER }, |
1037 | { 0xf894, KEY_MUTE }, | 1037 | { 0xf894, KEY_MUTE }, |
1038 | { 0xf887, KEY_1 }, | 1038 | { 0xf887, KEY_1 }, |
@@ -1067,16 +1067,16 @@ static struct ir_scancode ir_codes_tbs_table[] = { | |||
1067 | { 0xf89b, KEY_MODE } | 1067 | { 0xf89b, KEY_MODE } |
1068 | }; | 1068 | }; |
1069 | 1069 | ||
1070 | static struct ir_codes_dvb_usb_table_table keys_tables[] = { | 1070 | static struct rc_map_dvb_usb_table_table keys_tables[] = { |
1071 | { ir_codes_dw210x_table, ARRAY_SIZE(ir_codes_dw210x_table) }, | 1071 | { rc_map_dw210x_table, ARRAY_SIZE(rc_map_dw210x_table) }, |
1072 | { ir_codes_tevii_table, ARRAY_SIZE(ir_codes_tevii_table) }, | 1072 | { rc_map_tevii_table, ARRAY_SIZE(rc_map_tevii_table) }, |
1073 | { ir_codes_tbs_table, ARRAY_SIZE(ir_codes_tbs_table) }, | 1073 | { rc_map_tbs_table, ARRAY_SIZE(rc_map_tbs_table) }, |
1074 | }; | 1074 | }; |
1075 | 1075 | ||
1076 | static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | 1076 | static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state) |
1077 | { | 1077 | { |
1078 | struct ir_scancode *keymap = d->props.rc.legacy.rc_key_map; | 1078 | struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table; |
1079 | int keymap_size = d->props.rc.legacy.rc_key_map_size; | 1079 | int keymap_size = d->props.rc.legacy.rc_map_size; |
1080 | u8 key[2]; | 1080 | u8 key[2]; |
1081 | struct i2c_msg msg = { | 1081 | struct i2c_msg msg = { |
1082 | .addr = DW2102_RC_QUERY, | 1082 | .addr = DW2102_RC_QUERY, |
@@ -1185,14 +1185,14 @@ static int dw2102_load_firmware(struct usb_device *dev, | |||
1185 | /* init registers */ | 1185 | /* init registers */ |
1186 | switch (dev->descriptor.idProduct) { | 1186 | switch (dev->descriptor.idProduct) { |
1187 | case USB_PID_PROF_1100: | 1187 | case USB_PID_PROF_1100: |
1188 | s6x0_properties.rc.legacy.rc_key_map = ir_codes_tbs_table; | 1188 | s6x0_properties.rc.legacy.rc_map_table = rc_map_tbs_table; |
1189 | s6x0_properties.rc.legacy.rc_key_map_size = | 1189 | s6x0_properties.rc.legacy.rc_map_size = |
1190 | ARRAY_SIZE(ir_codes_tbs_table); | 1190 | ARRAY_SIZE(rc_map_tbs_table); |
1191 | break; | 1191 | break; |
1192 | case USB_PID_TEVII_S650: | 1192 | case USB_PID_TEVII_S650: |
1193 | dw2104_properties.rc.legacy.rc_key_map = ir_codes_tevii_table; | 1193 | dw2104_properties.rc.legacy.rc_map_table = rc_map_tevii_table; |
1194 | dw2104_properties.rc.legacy.rc_key_map_size = | 1194 | dw2104_properties.rc.legacy.rc_map_size = |
1195 | ARRAY_SIZE(ir_codes_tevii_table); | 1195 | ARRAY_SIZE(rc_map_tevii_table); |
1196 | case USB_PID_DW2104: | 1196 | case USB_PID_DW2104: |
1197 | reset = 1; | 1197 | reset = 1; |
1198 | dw210x_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1, | 1198 | dw210x_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1, |
@@ -1257,8 +1257,8 @@ static struct dvb_usb_device_properties dw2102_properties = { | |||
1257 | .i2c_algo = &dw2102_serit_i2c_algo, | 1257 | .i2c_algo = &dw2102_serit_i2c_algo, |
1258 | 1258 | ||
1259 | .rc.legacy = { | 1259 | .rc.legacy = { |
1260 | .rc_key_map = ir_codes_dw210x_table, | 1260 | .rc_map_table = rc_map_dw210x_table, |
1261 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), | 1261 | .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table), |
1262 | .rc_interval = 150, | 1262 | .rc_interval = 150, |
1263 | .rc_query = dw2102_rc_query, | 1263 | .rc_query = dw2102_rc_query, |
1264 | }, | 1264 | }, |
@@ -1310,8 +1310,8 @@ static struct dvb_usb_device_properties dw2104_properties = { | |||
1310 | 1310 | ||
1311 | .i2c_algo = &dw2104_i2c_algo, | 1311 | .i2c_algo = &dw2104_i2c_algo, |
1312 | .rc.legacy = { | 1312 | .rc.legacy = { |
1313 | .rc_key_map = ir_codes_dw210x_table, | 1313 | .rc_map_table = rc_map_dw210x_table, |
1314 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), | 1314 | .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table), |
1315 | .rc_interval = 150, | 1315 | .rc_interval = 150, |
1316 | .rc_query = dw2102_rc_query, | 1316 | .rc_query = dw2102_rc_query, |
1317 | }, | 1317 | }, |
@@ -1359,8 +1359,8 @@ static struct dvb_usb_device_properties dw3101_properties = { | |||
1359 | 1359 | ||
1360 | .i2c_algo = &dw3101_i2c_algo, | 1360 | .i2c_algo = &dw3101_i2c_algo, |
1361 | .rc.legacy = { | 1361 | .rc.legacy = { |
1362 | .rc_key_map = ir_codes_dw210x_table, | 1362 | .rc_map_table = rc_map_dw210x_table, |
1363 | .rc_key_map_size = ARRAY_SIZE(ir_codes_dw210x_table), | 1363 | .rc_map_size = ARRAY_SIZE(rc_map_dw210x_table), |
1364 | .rc_interval = 150, | 1364 | .rc_interval = 150, |
1365 | .rc_query = dw2102_rc_query, | 1365 | .rc_query = dw2102_rc_query, |
1366 | }, | 1366 | }, |
@@ -1404,8 +1404,8 @@ static struct dvb_usb_device_properties s6x0_properties = { | |||
1404 | 1404 | ||
1405 | .i2c_algo = &s6x0_i2c_algo, | 1405 | .i2c_algo = &s6x0_i2c_algo, |
1406 | .rc.legacy = { | 1406 | .rc.legacy = { |
1407 | .rc_key_map = ir_codes_tevii_table, | 1407 | .rc_map_table = rc_map_tevii_table, |
1408 | .rc_key_map_size = ARRAY_SIZE(ir_codes_tevii_table), | 1408 | .rc_map_size = ARRAY_SIZE(rc_map_tevii_table), |
1409 | .rc_interval = 150, | 1409 | .rc_interval = 150, |
1410 | .rc_query = dw2102_rc_query, | 1410 | .rc_query = dw2102_rc_query, |
1411 | }, | 1411 | }, |
@@ -1468,8 +1468,8 @@ static int dw2102_probe(struct usb_interface *intf, | |||
1468 | /* fill only different fields */ | 1468 | /* fill only different fields */ |
1469 | p7500->firmware = "dvb-usb-p7500.fw"; | 1469 | p7500->firmware = "dvb-usb-p7500.fw"; |
1470 | p7500->devices[0] = d7500; | 1470 | p7500->devices[0] = d7500; |
1471 | p7500->rc.legacy.rc_key_map = ir_codes_tbs_table; | 1471 | p7500->rc.legacy.rc_map_table = rc_map_tbs_table; |
1472 | p7500->rc.legacy.rc_key_map_size = ARRAY_SIZE(ir_codes_tbs_table); | 1472 | p7500->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table); |
1473 | p7500->adapter->frontend_attach = prof_7500_frontend_attach; | 1473 | p7500->adapter->frontend_attach = prof_7500_frontend_attach; |
1474 | 1474 | ||
1475 | if (0 == dvb_usb_device_init(intf, &dw2102_properties, | 1475 | if (0 == dvb_usb_device_init(intf, &dw2102_properties, |
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c index c821293dbc22..1cb3d9a66e02 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.c +++ b/drivers/media/dvb/dvb-usb/gp8psk.c | |||
@@ -24,6 +24,33 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,xfer=2,rc=4 (or-able))." DV | |||
24 | 24 | ||
25 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 25 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
26 | 26 | ||
27 | static int gp8psk_get_fw_version(struct dvb_usb_device *d, u8 *fw_vers) | ||
28 | { | ||
29 | return (gp8psk_usb_in_op(d, GET_FW_VERS, 0, 0, fw_vers, 6)); | ||
30 | } | ||
31 | |||
32 | static int gp8psk_get_fpga_version(struct dvb_usb_device *d, u8 *fpga_vers) | ||
33 | { | ||
34 | return (gp8psk_usb_in_op(d, GET_FPGA_VERS, 0, 0, fpga_vers, 1)); | ||
35 | } | ||
36 | |||
37 | static void gp8psk_info(struct dvb_usb_device *d) | ||
38 | { | ||
39 | u8 fpga_vers, fw_vers[6]; | ||
40 | |||
41 | if (!gp8psk_get_fw_version(d, fw_vers)) | ||
42 | info("FW Version = %i.%02i.%i (0x%x) Build %4i/%02i/%02i", | ||
43 | fw_vers[2], fw_vers[1], fw_vers[0], GP8PSK_FW_VERS(fw_vers), | ||
44 | 2000 + fw_vers[5], fw_vers[4], fw_vers[3]); | ||
45 | else | ||
46 | info("failed to get FW version"); | ||
47 | |||
48 | if (!gp8psk_get_fpga_version(d, &fpga_vers)) | ||
49 | info("FPGA Version = %i", fpga_vers); | ||
50 | else | ||
51 | info("failed to get FPGA version"); | ||
52 | } | ||
53 | |||
27 | int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen) | 54 | int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen) |
28 | { | 55 | { |
29 | int ret = 0,try = 0; | 56 | int ret = 0,try = 0; |
@@ -146,6 +173,7 @@ static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff) | |||
146 | gp8psk_usb_out_op(d, CW3K_INIT, 1, 0, NULL, 0); | 173 | gp8psk_usb_out_op(d, CW3K_INIT, 1, 0, NULL, 0); |
147 | if (gp8psk_usb_in_op(d, BOOT_8PSK, 1, 0, &buf, 1)) | 174 | if (gp8psk_usb_in_op(d, BOOT_8PSK, 1, 0, &buf, 1)) |
148 | return -EINVAL; | 175 | return -EINVAL; |
176 | gp8psk_info(d); | ||
149 | } | 177 | } |
150 | 178 | ||
151 | if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) | 179 | if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) |
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.h b/drivers/media/dvb/dvb-usb/gp8psk.h index e83a57506cfa..831749a518cb 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.h +++ b/drivers/media/dvb/dvb-usb/gp8psk.h | |||
@@ -25,7 +25,6 @@ extern int dvb_usb_gp8psk_debug; | |||
25 | #define deb_xfer(args...) dprintk(dvb_usb_gp8psk_debug,0x02,args) | 25 | #define deb_xfer(args...) dprintk(dvb_usb_gp8psk_debug,0x02,args) |
26 | #define deb_rc(args...) dprintk(dvb_usb_gp8psk_debug,0x04,args) | 26 | #define deb_rc(args...) dprintk(dvb_usb_gp8psk_debug,0x04,args) |
27 | #define deb_fe(args...) dprintk(dvb_usb_gp8psk_debug,0x08,args) | 27 | #define deb_fe(args...) dprintk(dvb_usb_gp8psk_debug,0x08,args) |
28 | /* gp8psk commands */ | ||
29 | 28 | ||
30 | /* Twinhan Vendor requests */ | 29 | /* Twinhan Vendor requests */ |
31 | #define TH_COMMAND_IN 0xC0 | 30 | #define TH_COMMAND_IN 0xC0 |
@@ -49,8 +48,10 @@ extern int dvb_usb_gp8psk_debug; | |||
49 | #define SET_DVB_MODE 0x8E | 48 | #define SET_DVB_MODE 0x8E |
50 | #define SET_DN_SWITCH 0x8F | 49 | #define SET_DN_SWITCH 0x8F |
51 | #define GET_SIGNAL_LOCK 0x90 /* in */ | 50 | #define GET_SIGNAL_LOCK 0x90 /* in */ |
51 | #define GET_FW_VERS 0x92 | ||
52 | #define GET_SERIAL_NUMBER 0x93 /* in */ | 52 | #define GET_SERIAL_NUMBER 0x93 /* in */ |
53 | #define USE_EXTRA_VOLT 0x94 | 53 | #define USE_EXTRA_VOLT 0x94 |
54 | #define GET_FPGA_VERS 0x95 | ||
54 | #define CW3K_INIT 0x9d | 55 | #define CW3K_INIT 0x9d |
55 | 56 | ||
56 | /* PSK_configuration bits */ | 57 | /* PSK_configuration bits */ |
@@ -88,6 +89,11 @@ extern int dvb_usb_gp8psk_debug; | |||
88 | #define PRODUCT_STRING_READ 0x0D | 89 | #define PRODUCT_STRING_READ 0x0D |
89 | #define FW_BCD_VERSION_READ 0x14 | 90 | #define FW_BCD_VERSION_READ 0x14 |
90 | 91 | ||
92 | /* firmware revision id's */ | ||
93 | #define GP8PSK_FW_REV1 0x020604 | ||
94 | #define GP8PSK_FW_REV2 0x020704 | ||
95 | #define GP8PSK_FW_VERS(_fw_vers) ((_fw_vers)[2]<<0x10 | (_fw_vers)[1]<<0x08 | (_fw_vers)[0]) | ||
96 | |||
91 | extern struct dvb_frontend * gp8psk_fe_attach(struct dvb_usb_device *d); | 97 | extern struct dvb_frontend * gp8psk_fe_attach(struct dvb_usb_device *d); |
92 | extern int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen); | 98 | extern int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen); |
93 | extern int gp8psk_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value, | 99 | extern int gp8psk_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value, |
diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c index d939fbbf9fe6..9eea4188303b 100644 --- a/drivers/media/dvb/dvb-usb/lmedm04.c +++ b/drivers/media/dvb/dvb-usb/lmedm04.c | |||
@@ -61,7 +61,7 @@ | |||
61 | #define DVB_USB_LOG_PREFIX "LME2510(C)" | 61 | #define DVB_USB_LOG_PREFIX "LME2510(C)" |
62 | #include <linux/usb.h> | 62 | #include <linux/usb.h> |
63 | #include <linux/usb/input.h> | 63 | #include <linux/usb/input.h> |
64 | #include <media/ir-core.h> | 64 | #include <media/rc-core.h> |
65 | 65 | ||
66 | #include "dvb-usb.h" | 66 | #include "dvb-usb.h" |
67 | #include "lmedm04.h" | 67 | #include "lmedm04.h" |
@@ -112,7 +112,6 @@ struct lme2510_state { | |||
112 | u8 i2c_tuner_gate_r; | 112 | u8 i2c_tuner_gate_r; |
113 | u8 i2c_tuner_addr; | 113 | u8 i2c_tuner_addr; |
114 | u8 stream_on; | 114 | u8 stream_on; |
115 | u8 one_tune; | ||
116 | void *buffer; | 115 | void *buffer; |
117 | struct urb *lme_urb; | 116 | struct urb *lme_urb; |
118 | void *usb_buffer; | 117 | void *usb_buffer; |
@@ -125,7 +124,7 @@ static int lme2510_bulk_write(struct usb_device *dev, | |||
125 | int ret, actual_l; | 124 | int ret, actual_l; |
126 | 125 | ||
127 | ret = usb_bulk_msg(dev, usb_sndbulkpipe(dev, pipe), | 126 | ret = usb_bulk_msg(dev, usb_sndbulkpipe(dev, pipe), |
128 | snd, len , &actual_l, 500); | 127 | snd, len , &actual_l, 100); |
129 | return ret; | 128 | return ret; |
130 | } | 129 | } |
131 | 130 | ||
@@ -135,7 +134,7 @@ static int lme2510_bulk_read(struct usb_device *dev, | |||
135 | int ret, actual_l; | 134 | int ret, actual_l; |
136 | 135 | ||
137 | ret = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, pipe), | 136 | ret = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, pipe), |
138 | rev, len , &actual_l, 500); | 137 | rev, len , &actual_l, 200); |
139 | return ret; | 138 | return ret; |
140 | } | 139 | } |
141 | 140 | ||
@@ -167,7 +166,7 @@ static int lme2510_usb_talk(struct dvb_usb_device *d, | |||
167 | 166 | ||
168 | ret |= lme2510_bulk_write(d->udev, buff, wlen , 0x01); | 167 | ret |= lme2510_bulk_write(d->udev, buff, wlen , 0x01); |
169 | 168 | ||
170 | msleep(12); | 169 | msleep(10); |
171 | 170 | ||
172 | ret |= usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, 0x01)); | 171 | ret |= usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, 0x01)); |
173 | 172 | ||
@@ -182,15 +181,13 @@ static int lme2510_usb_talk(struct dvb_usb_device *d, | |||
182 | return (ret < 0) ? -ENODEV : 0; | 181 | return (ret < 0) ? -ENODEV : 0; |
183 | } | 182 | } |
184 | 183 | ||
185 | static int lme2510_usb_talk_restart(struct dvb_usb_device *d, | 184 | static int lme2510_stream_restart(struct dvb_usb_device *d) |
186 | u8 *wbuf, int wlen, u8 *rbuf, int rlen) { | 185 | { |
187 | static u8 stream_on[] = LME_ST_ON_W; | 186 | static u8 stream_on[] = LME_ST_ON_W; |
188 | int ret; | 187 | int ret; |
189 | u8 rbuff[10]; | 188 | u8 rbuff[10]; |
190 | /*Send Normal Command*/ | ||
191 | ret = lme2510_usb_talk(d, wbuf, wlen, rbuf, rlen); | ||
192 | /*Restart Stream Command*/ | 189 | /*Restart Stream Command*/ |
193 | ret |= lme2510_usb_talk(d, stream_on, sizeof(stream_on), | 190 | ret = lme2510_usb_talk(d, stream_on, sizeof(stream_on), |
194 | rbuff, sizeof(rbuff)); | 191 | rbuff, sizeof(rbuff)); |
195 | return ret; | 192 | return ret; |
196 | } | 193 | } |
@@ -201,7 +198,7 @@ static int lme2510_remote_keypress(struct dvb_usb_adapter *adap, u16 keypress) | |||
201 | deb_info(1, "INT Key Keypress =%04x", keypress); | 198 | deb_info(1, "INT Key Keypress =%04x", keypress); |
202 | 199 | ||
203 | if (keypress > 0) | 200 | if (keypress > 0) |
204 | ir_keydown(d->rc_input_dev, keypress, 0); | 201 | rc_keydown(d->rc_dev, keypress, 0); |
205 | 202 | ||
206 | return 0; | 203 | return 0; |
207 | } | 204 | } |
@@ -254,11 +251,16 @@ static void lme2510_int_response(struct urb *lme_urb) | |||
254 | case TUNER_S7395: | 251 | case TUNER_S7395: |
255 | /* Tweak for earlier firmware*/ | 252 | /* Tweak for earlier firmware*/ |
256 | if (ibuf[1] == 0x03) { | 253 | if (ibuf[1] == 0x03) { |
254 | if (ibuf[2] > 1) | ||
255 | st->signal_lock = ibuf[2]; | ||
257 | st->signal_level = ibuf[3]; | 256 | st->signal_level = ibuf[3]; |
258 | st->signal_sn = ibuf[4]; | 257 | st->signal_sn = ibuf[4]; |
259 | } else { | 258 | } else { |
260 | st->signal_level = ibuf[4]; | 259 | st->signal_level = ibuf[4]; |
261 | st->signal_sn = ibuf[5]; | 260 | st->signal_sn = ibuf[5]; |
261 | st->signal_lock = | ||
262 | (st->signal_lock & 0xf7) + | ||
263 | ((ibuf[2] & 0x01) << 0x03); | ||
262 | } | 264 | } |
263 | break; | 265 | break; |
264 | default: | 266 | default: |
@@ -341,11 +343,10 @@ static int lme2510_msg(struct dvb_usb_device *d, | |||
341 | st->signal_lock = rbuf[1]; | 343 | st->signal_lock = rbuf[1]; |
342 | if ((st->stream_on & 1) && | 344 | if ((st->stream_on & 1) && |
343 | (st->signal_lock & 0x10)) { | 345 | (st->signal_lock & 0x10)) { |
344 | lme2510_usb_talk_restart(d, | 346 | lme2510_stream_restart(d); |
345 | wbuf, wlen, rbuf, rlen); | ||
346 | st->i2c_talk_onoff = 0; | 347 | st->i2c_talk_onoff = 0; |
347 | } | 348 | } |
348 | msleep(80); | 349 | msleep(80); |
349 | } | 350 | } |
350 | } | 351 | } |
351 | break; | 352 | break; |
@@ -355,15 +356,12 @@ static int lme2510_msg(struct dvb_usb_device *d, | |||
355 | st->signal_lock = rbuf[1]; | 356 | st->signal_lock = rbuf[1]; |
356 | if ((st->stream_on & 1) && | 357 | if ((st->stream_on & 1) && |
357 | (st->signal_lock & 0x8)) { | 358 | (st->signal_lock & 0x8)) { |
358 | lme2510_usb_talk_restart(d, | 359 | lme2510_stream_restart(d); |
359 | wbuf, wlen, rbuf, rlen); | ||
360 | st->i2c_talk_onoff = 0; | 360 | st->i2c_talk_onoff = 0; |
361 | } | 361 | } |
362 | } | 362 | } |
363 | if ((wbuf[3] != 0x6) & (wbuf[3] != 0x5)) | 363 | if ((wbuf[3] != 0x6) & (wbuf[3] != 0x5)) |
364 | msleep(5); | 364 | msleep(5); |
365 | |||
366 | |||
367 | } | 365 | } |
368 | break; | 366 | break; |
369 | default: | 367 | default: |
@@ -385,18 +383,16 @@ static int lme2510_msg(struct dvb_usb_device *d, | |||
385 | rbuf[0] = 0x55; | 383 | rbuf[0] = 0x55; |
386 | rbuf[1] = st->signal_sn; | 384 | rbuf[1] = st->signal_sn; |
387 | break; | 385 | break; |
388 | /*DiSEqC functions as per TDA10086*/ | 386 | case 0x15: |
389 | case 0x36: | 387 | case 0x16: |
390 | case 0x48: | 388 | case 0x17: |
391 | case 0x49: | 389 | case 0x18: |
392 | case 0x4a: | 390 | rbuf[0] = 0x55; |
393 | case 0x4b: | 391 | rbuf[1] = 0x00; |
394 | case 0x4c: | 392 | break; |
395 | case 0x4d: | ||
396 | if (wbuf[2] == 0x1c) | ||
397 | lme2510_usb_talk_restart(d, | ||
398 | wbuf, wlen, rbuf, rlen); | ||
399 | default: | 393 | default: |
394 | lme2510_usb_talk(d, wbuf, wlen, rbuf, rlen); | ||
395 | st->i2c_talk_onoff = 1; | ||
400 | break; | 396 | break; |
401 | } | 397 | } |
402 | break; | 398 | break; |
@@ -413,39 +409,22 @@ static int lme2510_msg(struct dvb_usb_device *d, | |||
413 | break; | 409 | break; |
414 | case 0x24: | 410 | case 0x24: |
415 | rbuf[0] = 0x55; | 411 | rbuf[0] = 0x55; |
416 | rbuf[1] = (st->signal_level & 0x80) | 412 | rbuf[1] = st->signal_lock; |
417 | ? 0 : st->signal_lock; | ||
418 | break; | ||
419 | case 0x6: | ||
420 | if (wbuf[2] == 0xd0) | ||
421 | lme2510_usb_talk(d, | ||
422 | wbuf, wlen, rbuf, rlen); | ||
423 | break; | ||
424 | case 0x1: | ||
425 | if (st->one_tune > 0) | ||
426 | break; | ||
427 | st->one_tune++; | ||
428 | st->i2c_talk_onoff = 1; | ||
429 | /*DiSEqC functions as per STV0288*/ | ||
430 | case 0x5: | ||
431 | case 0x7: | ||
432 | case 0x8: | ||
433 | case 0x9: | ||
434 | case 0xa: | ||
435 | case 0xb: | ||
436 | if (wbuf[2] == 0xd0) | ||
437 | lme2510_usb_talk_restart(d, | ||
438 | wbuf, wlen, rbuf, rlen); | ||
439 | break; | 413 | break; |
440 | default: | 414 | case 0x2e: |
415 | case 0x26: | ||
416 | case 0x27: | ||
441 | rbuf[0] = 0x55; | 417 | rbuf[0] = 0x55; |
442 | rbuf[1] = 0x00; | 418 | rbuf[1] = 0x00; |
443 | break; | 419 | break; |
420 | default: | ||
421 | lme2510_usb_talk(d, wbuf, wlen, rbuf, rlen); | ||
422 | st->i2c_talk_onoff = 1; | ||
423 | break; | ||
444 | } | 424 | } |
445 | break; | 425 | break; |
446 | default: | 426 | default: |
447 | break; | 427 | break; |
448 | |||
449 | } | 428 | } |
450 | 429 | ||
451 | deb_info(4, "I2C From Interupt Message out(%02x) in(%02x)", | 430 | deb_info(4, "I2C From Interupt Message out(%02x) in(%02x)", |
@@ -548,35 +527,26 @@ static int lme2510_identify_state(struct usb_device *udev, | |||
548 | static int lme2510_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | 527 | static int lme2510_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) |
549 | { | 528 | { |
550 | struct lme2510_state *st = adap->dev->priv; | 529 | struct lme2510_state *st = adap->dev->priv; |
551 | static u8 stream_on[] = LME_ST_ON_W; | ||
552 | static u8 clear_reg_3[] = LME_CLEAR_PID; | 530 | static u8 clear_reg_3[] = LME_CLEAR_PID; |
553 | static u8 rbuf[1]; | 531 | static u8 rbuf[1]; |
554 | static u8 timeout; | 532 | int ret = 0, rlen = sizeof(rbuf); |
555 | int ret = 0, len = 2, rlen = sizeof(rbuf); | ||
556 | 533 | ||
557 | deb_info(1, "STM (%02x)", onoff); | 534 | deb_info(1, "STM (%02x)", onoff); |
558 | 535 | ||
559 | if (onoff == 1) { | 536 | /* Streaming is started by FE_HAS_LOCK */ |
560 | st->i2c_talk_onoff = 0; | 537 | if (onoff == 1) |
561 | timeout = 0; | ||
562 | /* wait for i2C to be free */ | ||
563 | while (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) { | ||
564 | timeout++; | ||
565 | if (timeout > 5) | ||
566 | return -ENODEV; | ||
567 | } | ||
568 | msleep(100); | ||
569 | ret |= lme2510_usb_talk(adap->dev, | ||
570 | stream_on, len, rbuf, rlen); | ||
571 | st->stream_on = 1; | 538 | st->stream_on = 1; |
572 | st->one_tune = 0; | 539 | else { |
573 | mutex_unlock(&adap->dev->i2c_mutex); | ||
574 | } else { | ||
575 | deb_info(1, "STM Steam Off"); | 540 | deb_info(1, "STM Steam Off"); |
541 | /* mutex is here only to avoid collision with I2C */ | ||
542 | ret = mutex_lock_interruptible(&adap->dev->i2c_mutex); | ||
543 | |||
576 | ret |= lme2510_usb_talk(adap->dev, clear_reg_3, | 544 | ret |= lme2510_usb_talk(adap->dev, clear_reg_3, |
577 | sizeof(clear_reg_3), rbuf, rlen); | 545 | sizeof(clear_reg_3), rbuf, rlen); |
578 | st->stream_on = 0; | 546 | st->stream_on = 0; |
579 | st->i2c_talk_onoff = 1; | 547 | st->i2c_talk_onoff = 1; |
548 | |||
549 | mutex_unlock(&adap->dev->i2c_mutex); | ||
580 | } | 550 | } |
581 | 551 | ||
582 | return (ret < 0) ? -ENODEV : 0; | 552 | return (ret < 0) ? -ENODEV : 0; |
@@ -585,41 +555,40 @@ static int lme2510_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
585 | static int lme2510_int_service(struct dvb_usb_adapter *adap) | 555 | static int lme2510_int_service(struct dvb_usb_adapter *adap) |
586 | { | 556 | { |
587 | struct dvb_usb_device *d = adap->dev; | 557 | struct dvb_usb_device *d = adap->dev; |
588 | struct input_dev *input_dev; | 558 | struct rc_dev *rc; |
589 | char *ir_codes = RC_MAP_LME2510; | 559 | int ret; |
590 | int ret = 0; | ||
591 | 560 | ||
592 | info("STA Configuring Remote"); | 561 | info("STA Configuring Remote"); |
593 | 562 | ||
594 | usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys)); | 563 | rc = rc_allocate_device(); |
595 | 564 | if (!rc) | |
596 | strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys)); | ||
597 | |||
598 | input_dev = input_allocate_device(); | ||
599 | if (!input_dev) | ||
600 | return -ENOMEM; | 565 | return -ENOMEM; |
601 | 566 | ||
602 | input_dev->name = "LME2510 Remote Control"; | 567 | usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys)); |
603 | input_dev->phys = d->rc_phys; | 568 | strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys)); |
604 | |||
605 | usb_to_input_id(d->udev, &input_dev->id); | ||
606 | 569 | ||
607 | ret |= ir_input_register(input_dev, ir_codes, NULL, "LME 2510"); | 570 | rc->input_name = "LME2510 Remote Control"; |
571 | rc->input_phys = d->rc_phys; | ||
572 | rc->map_name = RC_MAP_LME2510; | ||
573 | rc->driver_name = "LME 2510"; | ||
574 | usb_to_input_id(d->udev, &rc->input_id); | ||
608 | 575 | ||
576 | ret = rc_register_device(rc); | ||
609 | if (ret) { | 577 | if (ret) { |
610 | input_free_device(input_dev); | 578 | rc_free_device(rc); |
611 | return ret; | 579 | return ret; |
612 | } | 580 | } |
581 | d->rc_dev = rc; | ||
613 | 582 | ||
614 | d->rc_input_dev = input_dev; | ||
615 | /* Start the Interupt */ | 583 | /* Start the Interupt */ |
616 | ret = lme2510_int_read(adap); | 584 | ret = lme2510_int_read(adap); |
617 | |||
618 | if (ret < 0) { | 585 | if (ret < 0) { |
619 | ir_input_unregister(input_dev); | 586 | rc_unregister_device(rc); |
620 | input_free_device(input_dev); | 587 | info("INT Unable to start Interupt Service"); |
588 | return -ENODEV; | ||
621 | } | 589 | } |
622 | return (ret < 0) ? -ENODEV : 0; | 590 | |
591 | return 0; | ||
623 | } | 592 | } |
624 | 593 | ||
625 | static u8 check_sum(u8 *p, u8 len) | 594 | static u8 check_sum(u8 *p, u8 len) |
@@ -668,6 +637,7 @@ static int lme2510_download_firmware(struct usb_device *dev, | |||
668 | ret |= (data[0] == 0x88) ? 0 : -1; | 637 | ret |= (data[0] == 0x88) ? 0 : -1; |
669 | } | 638 | } |
670 | } | 639 | } |
640 | |||
671 | usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), | 641 | usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), |
672 | 0x06, 0x80, 0x0200, 0x00, data, 0x0109, 1000); | 642 | 0x06, 0x80, 0x0200, 0x00, data, 0x0109, 1000); |
673 | 643 | ||
@@ -701,10 +671,11 @@ static void lme_coldreset(struct usb_device *dev) | |||
701 | info("FRM Firmware Cold Reset"); | 671 | info("FRM Firmware Cold Reset"); |
702 | ret |= lme2510_bulk_write(dev, data , len_in, 1); /*Cold Resetting*/ | 672 | ret |= lme2510_bulk_write(dev, data , len_in, 1); /*Cold Resetting*/ |
703 | ret |= lme2510_bulk_read(dev, data, len_in, 1); | 673 | ret |= lme2510_bulk_read(dev, data, len_in, 1); |
674 | |||
704 | return; | 675 | return; |
705 | } | 676 | } |
706 | 677 | ||
707 | static void lme_firmware_switch(struct usb_device *udev, int cold) | 678 | static int lme_firmware_switch(struct usb_device *udev, int cold) |
708 | { | 679 | { |
709 | const struct firmware *fw = NULL; | 680 | const struct firmware *fw = NULL; |
710 | char lme2510c_s7395[] = "dvb-usb-lme2510c-s7395.fw"; | 681 | char lme2510c_s7395[] = "dvb-usb-lme2510c-s7395.fw"; |
@@ -712,8 +683,10 @@ static void lme_firmware_switch(struct usb_device *udev, int cold) | |||
712 | char *firm_msg[] = {"Loading", "Switching to"}; | 683 | char *firm_msg[] = {"Loading", "Switching to"}; |
713 | int ret; | 684 | int ret; |
714 | 685 | ||
686 | cold = (cold > 0) ? (cold & 1) : 0; | ||
687 | |||
715 | if (udev->descriptor.idProduct == 0x1122) | 688 | if (udev->descriptor.idProduct == 0x1122) |
716 | return; | 689 | return 0; |
717 | 690 | ||
718 | switch (dvb_usb_lme2510_firmware) { | 691 | switch (dvb_usb_lme2510_firmware) { |
719 | case 0: | 692 | case 0: |
@@ -740,22 +713,28 @@ static void lme_firmware_switch(struct usb_device *udev, int cold) | |||
740 | cold = 0; | 713 | cold = 0; |
741 | break; | 714 | break; |
742 | } | 715 | } |
716 | |||
743 | release_firmware(fw); | 717 | release_firmware(fw); |
744 | if (cold) | 718 | |
719 | if (cold) { | ||
745 | lme_coldreset(udev); | 720 | lme_coldreset(udev); |
746 | return; | 721 | return -ENODEV; |
722 | } | ||
723 | |||
724 | return ret; | ||
747 | } | 725 | } |
748 | 726 | ||
749 | static int lme2510_kill_urb(struct usb_data_stream *stream) | 727 | static int lme2510_kill_urb(struct usb_data_stream *stream) |
750 | { | 728 | { |
751 | int i; | 729 | int i; |
730 | |||
752 | for (i = 0; i < stream->urbs_submitted; i++) { | 731 | for (i = 0; i < stream->urbs_submitted; i++) { |
753 | deb_info(3, "killing URB no. %d.", i); | 732 | deb_info(3, "killing URB no. %d.", i); |
754 | |||
755 | /* stop the URB */ | 733 | /* stop the URB */ |
756 | usb_kill_urb(stream->urb_list[i]); | 734 | usb_kill_urb(stream->urb_list[i]); |
757 | } | 735 | } |
758 | stream->urbs_submitted = 0; | 736 | stream->urbs_submitted = 0; |
737 | |||
759 | return 0; | 738 | return 0; |
760 | } | 739 | } |
761 | 740 | ||
@@ -783,18 +762,13 @@ static int dm04_lme2510_set_voltage(struct dvb_frontend *fe, | |||
783 | fe_sec_voltage_t voltage) | 762 | fe_sec_voltage_t voltage) |
784 | { | 763 | { |
785 | struct dvb_usb_adapter *adap = fe->dvb->priv; | 764 | struct dvb_usb_adapter *adap = fe->dvb->priv; |
786 | struct lme2510_state *st = adap->dev->priv; | ||
787 | static u8 voltage_low[] = LME_VOLTAGE_L; | 765 | static u8 voltage_low[] = LME_VOLTAGE_L; |
788 | static u8 voltage_high[] = LME_VOLTAGE_H; | 766 | static u8 voltage_high[] = LME_VOLTAGE_H; |
789 | static u8 lnb_on[] = LNB_ON; | ||
790 | static u8 lnb_off[] = LNB_OFF; | ||
791 | static u8 rbuf[1]; | 767 | static u8 rbuf[1]; |
792 | int ret = 0, len = 3, rlen = 1; | 768 | int ret = 0, len = 3, rlen = 1; |
793 | 769 | ||
794 | if (st->stream_on == 1) | 770 | if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) |
795 | return 0; | 771 | return -EAGAIN; |
796 | |||
797 | ret |= lme2510_usb_talk(adap->dev, lnb_on, len, rbuf, rlen); | ||
798 | 772 | ||
799 | switch (voltage) { | 773 | switch (voltage) { |
800 | case SEC_VOLTAGE_18: | 774 | case SEC_VOLTAGE_18: |
@@ -803,94 +777,143 @@ static int dm04_lme2510_set_voltage(struct dvb_frontend *fe, | |||
803 | break; | 777 | break; |
804 | 778 | ||
805 | case SEC_VOLTAGE_OFF: | 779 | case SEC_VOLTAGE_OFF: |
806 | ret |= lme2510_usb_talk(adap->dev, | ||
807 | lnb_off, len, rbuf, rlen); | ||
808 | case SEC_VOLTAGE_13: | 780 | case SEC_VOLTAGE_13: |
809 | default: | 781 | default: |
810 | ret |= lme2510_usb_talk(adap->dev, | 782 | ret |= lme2510_usb_talk(adap->dev, |
811 | voltage_low, len, rbuf, rlen); | 783 | voltage_low, len, rbuf, rlen); |
812 | break; | 784 | break; |
785 | } | ||
813 | 786 | ||
787 | mutex_unlock(&adap->dev->i2c_mutex); | ||
814 | 788 | ||
815 | }; | ||
816 | st->i2c_talk_onoff = 1; | ||
817 | return (ret < 0) ? -ENODEV : 0; | 789 | return (ret < 0) ? -ENODEV : 0; |
818 | } | 790 | } |
819 | 791 | ||
792 | static int lme_name(struct dvb_usb_adapter *adap) | ||
793 | { | ||
794 | struct lme2510_state *st = adap->dev->priv; | ||
795 | const char *desc = adap->dev->desc->name; | ||
796 | char *fe_name[] = {"", " LG TDQY-P001F", " SHARP:BS2F7HZ7395"}; | ||
797 | char *name = adap->fe->ops.info.name; | ||
798 | |||
799 | strlcpy(name, desc, 128); | ||
800 | strlcat(name, fe_name[st->tuner_config], 128); | ||
801 | |||
802 | return 0; | ||
803 | } | ||
804 | |||
820 | static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap) | 805 | static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap) |
821 | { | 806 | { |
822 | int ret = 0; | ||
823 | struct lme2510_state *st = adap->dev->priv; | 807 | struct lme2510_state *st = adap->dev->priv; |
824 | 808 | ||
825 | /* Interupt Start */ | 809 | int ret = 0; |
826 | ret = lme2510_int_service(adap); | ||
827 | if (ret < 0) { | ||
828 | info("INT Unable to start Interupt Service"); | ||
829 | return -ENODEV; | ||
830 | } | ||
831 | 810 | ||
832 | st->i2c_talk_onoff = 1; | 811 | st->i2c_talk_onoff = 1; |
833 | st->i2c_gate = 4; | ||
834 | 812 | ||
813 | st->i2c_gate = 4; | ||
835 | adap->fe = dvb_attach(tda10086_attach, &tda10086_config, | 814 | adap->fe = dvb_attach(tda10086_attach, &tda10086_config, |
836 | &adap->dev->i2c_adap); | 815 | &adap->dev->i2c_adap); |
837 | 816 | ||
838 | if (adap->fe) { | 817 | if (adap->fe) { |
839 | info("TUN Found Frontend TDA10086"); | 818 | info("TUN Found Frontend TDA10086"); |
840 | memcpy(&adap->fe->ops.info.name, | ||
841 | &"DM04_LG_TDQY-P001F DVB-S", 24); | ||
842 | adap->fe->ops.set_voltage = dm04_lme2510_set_voltage; | ||
843 | st->i2c_tuner_gate_w = 4; | 819 | st->i2c_tuner_gate_w = 4; |
844 | st->i2c_tuner_gate_r = 4; | 820 | st->i2c_tuner_gate_r = 4; |
845 | st->i2c_tuner_addr = 0xc0; | 821 | st->i2c_tuner_addr = 0xc0; |
846 | if (dvb_attach(tda826x_attach, adap->fe, 0xc0, | 822 | st->tuner_config = TUNER_LG; |
847 | &adap->dev->i2c_adap, 1)) { | 823 | if (dvb_usb_lme2510_firmware != 1) { |
848 | info("TUN TDA8263 Found"); | 824 | dvb_usb_lme2510_firmware = 1; |
849 | st->tuner_config = TUNER_LG; | 825 | ret = lme_firmware_switch(adap->dev->udev, 1); |
850 | if (dvb_usb_lme2510_firmware != 1) { | 826 | } else /*stops LG/Sharp multi tuner problems*/ |
851 | dvb_usb_lme2510_firmware = 1; | 827 | dvb_usb_lme2510_firmware = 0; |
852 | lme_firmware_switch(adap->dev->udev, 1); | 828 | goto end; |
853 | } | ||
854 | return 0; | ||
855 | } | ||
856 | kfree(adap->fe); | ||
857 | adap->fe = NULL; | ||
858 | } | 829 | } |
830 | |||
859 | st->i2c_gate = 5; | 831 | st->i2c_gate = 5; |
860 | adap->fe = dvb_attach(stv0288_attach, &lme_config, | 832 | adap->fe = dvb_attach(stv0288_attach, &lme_config, |
861 | &adap->dev->i2c_adap); | 833 | &adap->dev->i2c_adap); |
862 | 834 | ||
863 | if (adap->fe) { | 835 | if (adap->fe) { |
864 | info("FE Found Stv0288"); | 836 | info("FE Found Stv0288"); |
865 | memcpy(&adap->fe->ops.info.name, | ||
866 | &"DM04_SHARP:BS2F7HZ7395", 22); | ||
867 | adap->fe->ops.set_voltage = dm04_lme2510_set_voltage; | ||
868 | st->i2c_tuner_gate_w = 4; | 837 | st->i2c_tuner_gate_w = 4; |
869 | st->i2c_tuner_gate_r = 5; | 838 | st->i2c_tuner_gate_r = 5; |
870 | st->i2c_tuner_addr = 0xc0; | 839 | st->i2c_tuner_addr = 0xc0; |
871 | if (dvb_attach(ix2505v_attach , adap->fe, &lme_tuner, | 840 | st->tuner_config = TUNER_S7395; |
872 | &adap->dev->i2c_adap)) { | 841 | if (dvb_usb_lme2510_firmware != 0) { |
873 | st->tuner_config = TUNER_S7395; | 842 | dvb_usb_lme2510_firmware = 0; |
874 | info("TUN Sharp IX2505V silicon tuner"); | 843 | ret = lme_firmware_switch(adap->dev->udev, 1); |
875 | if (dvb_usb_lme2510_firmware != 0) { | ||
876 | dvb_usb_lme2510_firmware = 0; | ||
877 | lme_firmware_switch(adap->dev->udev, 1); | ||
878 | } | ||
879 | return 0; | ||
880 | } | 844 | } |
845 | } else { | ||
846 | info("DM04 Not Supported"); | ||
847 | return -ENODEV; | ||
848 | } | ||
849 | |||
850 | end: if (ret) { | ||
881 | kfree(adap->fe); | 851 | kfree(adap->fe); |
882 | adap->fe = NULL; | 852 | adap->fe = NULL; |
853 | return -ENODEV; | ||
883 | } | 854 | } |
884 | 855 | ||
885 | info("DM04 Not Supported"); | 856 | adap->fe->ops.set_voltage = dm04_lme2510_set_voltage; |
886 | return -ENODEV; | 857 | ret = lme_name(adap); |
858 | |||
859 | return ret; | ||
860 | } | ||
861 | |||
862 | static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap) | ||
863 | { | ||
864 | struct lme2510_state *st = adap->dev->priv; | ||
865 | char *tun_msg[] = {"", "TDA8263", "IX2505V"}; | ||
866 | int ret = 0; | ||
867 | |||
868 | switch (st->tuner_config) { | ||
869 | case TUNER_LG: | ||
870 | if (dvb_attach(tda826x_attach, adap->fe, 0xc0, | ||
871 | &adap->dev->i2c_adap, 1)) | ||
872 | ret = st->tuner_config; | ||
873 | break; | ||
874 | case TUNER_S7395: | ||
875 | if (dvb_attach(ix2505v_attach , adap->fe, &lme_tuner, | ||
876 | &adap->dev->i2c_adap)) | ||
877 | ret = st->tuner_config; | ||
878 | break; | ||
879 | default: | ||
880 | break; | ||
881 | } | ||
882 | |||
883 | if (ret) | ||
884 | info("TUN Found %s tuner", tun_msg[ret]); | ||
885 | else { | ||
886 | info("TUN No tuner found --- reseting device"); | ||
887 | lme_coldreset(adap->dev->udev); | ||
888 | return -ENODEV; | ||
889 | } | ||
890 | |||
891 | /* Start the Interupt & Remote*/ | ||
892 | ret = lme2510_int_service(adap); | ||
893 | |||
894 | return ret; | ||
887 | } | 895 | } |
888 | 896 | ||
889 | static int lme2510_powerup(struct dvb_usb_device *d, int onoff) | 897 | static int lme2510_powerup(struct dvb_usb_device *d, int onoff) |
890 | { | 898 | { |
891 | struct lme2510_state *st = d->priv; | 899 | struct lme2510_state *st = d->priv; |
900 | static u8 lnb_on[] = LNB_ON; | ||
901 | static u8 lnb_off[] = LNB_OFF; | ||
902 | static u8 rbuf[1]; | ||
903 | int ret, len = 3, rlen = 1; | ||
904 | |||
905 | ret = mutex_lock_interruptible(&d->i2c_mutex); | ||
906 | |||
907 | if (onoff) | ||
908 | ret |= lme2510_usb_talk(d, lnb_on, len, rbuf, rlen); | ||
909 | else | ||
910 | ret |= lme2510_usb_talk(d, lnb_off, len, rbuf, rlen); | ||
911 | |||
892 | st->i2c_talk_onoff = 1; | 912 | st->i2c_talk_onoff = 1; |
893 | return 0; | 913 | |
914 | mutex_unlock(&d->i2c_mutex); | ||
915 | |||
916 | return ret; | ||
894 | } | 917 | } |
895 | 918 | ||
896 | /* DVB USB Driver stuff */ | 919 | /* DVB USB Driver stuff */ |
@@ -951,6 +974,7 @@ static struct dvb_usb_device_properties lme2510_properties = { | |||
951 | { | 974 | { |
952 | .streaming_ctrl = lme2510_streaming_ctrl, | 975 | .streaming_ctrl = lme2510_streaming_ctrl, |
953 | .frontend_attach = dm04_lme2510_frontend_attach, | 976 | .frontend_attach = dm04_lme2510_frontend_attach, |
977 | .tuner_attach = dm04_lme2510_tuner, | ||
954 | /* parameter for the MPEG2-data transfer */ | 978 | /* parameter for the MPEG2-data transfer */ |
955 | .stream = { | 979 | .stream = { |
956 | .type = USB_BULK, | 980 | .type = USB_BULK, |
@@ -971,7 +995,7 @@ static struct dvb_usb_device_properties lme2510_properties = { | |||
971 | .generic_bulk_ctrl_endpoint = 0, | 995 | .generic_bulk_ctrl_endpoint = 0, |
972 | .num_device_descs = 1, | 996 | .num_device_descs = 1, |
973 | .devices = { | 997 | .devices = { |
974 | { "DM04 LME2510 DVB-S USB 2.0", | 998 | { "DM04_LME2510_DVB-S", |
975 | { &lme2510_table[0], NULL }, | 999 | { &lme2510_table[0], NULL }, |
976 | }, | 1000 | }, |
977 | 1001 | ||
@@ -989,6 +1013,7 @@ static struct dvb_usb_device_properties lme2510c_properties = { | |||
989 | { | 1013 | { |
990 | .streaming_ctrl = lme2510_streaming_ctrl, | 1014 | .streaming_ctrl = lme2510_streaming_ctrl, |
991 | .frontend_attach = dm04_lme2510_frontend_attach, | 1015 | .frontend_attach = dm04_lme2510_frontend_attach, |
1016 | .tuner_attach = dm04_lme2510_tuner, | ||
992 | /* parameter for the MPEG2-data transfer */ | 1017 | /* parameter for the MPEG2-data transfer */ |
993 | .stream = { | 1018 | .stream = { |
994 | .type = USB_BULK, | 1019 | .type = USB_BULK, |
@@ -1009,7 +1034,7 @@ static struct dvb_usb_device_properties lme2510c_properties = { | |||
1009 | .generic_bulk_ctrl_endpoint = 0, | 1034 | .generic_bulk_ctrl_endpoint = 0, |
1010 | .num_device_descs = 1, | 1035 | .num_device_descs = 1, |
1011 | .devices = { | 1036 | .devices = { |
1012 | { "DM04 LME2510C USB2.0", | 1037 | { "DM04_LME2510C_DVB-S", |
1013 | { &lme2510_table[1], NULL }, | 1038 | { &lme2510_table[1], NULL }, |
1014 | }, | 1039 | }, |
1015 | } | 1040 | } |
@@ -1036,7 +1061,7 @@ void *lme2510_exit_int(struct dvb_usb_device *d) | |||
1036 | usb_free_coherent(d->udev, 5000, st->buffer, | 1061 | usb_free_coherent(d->udev, 5000, st->buffer, |
1037 | st->lme_urb->transfer_dma); | 1062 | st->lme_urb->transfer_dma); |
1038 | info("Interupt Service Stopped"); | 1063 | info("Interupt Service Stopped"); |
1039 | ir_input_unregister(d->rc_input_dev); | 1064 | rc_unregister_device(d->rc_dev); |
1040 | info("Remote Stopped"); | 1065 | info("Remote Stopped"); |
1041 | } | 1066 | } |
1042 | return buffer; | 1067 | return buffer; |
@@ -1055,7 +1080,7 @@ void lme2510_exit(struct usb_interface *intf) | |||
1055 | } | 1080 | } |
1056 | 1081 | ||
1057 | static struct usb_driver lme2510_driver = { | 1082 | static struct usb_driver lme2510_driver = { |
1058 | .name = "LME2510C_DVBS", | 1083 | .name = "LME2510C_DVB-S", |
1059 | .probe = lme2510_probe, | 1084 | .probe = lme2510_probe, |
1060 | .disconnect = lme2510_exit, | 1085 | .disconnect = lme2510_exit, |
1061 | .id_table = lme2510_table, | 1086 | .id_table = lme2510_table, |
@@ -1083,6 +1108,6 @@ module_init(lme2510_module_init); | |||
1083 | module_exit(lme2510_module_exit); | 1108 | module_exit(lme2510_module_exit); |
1084 | 1109 | ||
1085 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); | 1110 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); |
1086 | MODULE_DESCRIPTION("LM2510(C) DVB-S USB2.0"); | 1111 | MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); |
1087 | MODULE_VERSION("1.60"); | 1112 | MODULE_VERSION("1.74"); |
1088 | MODULE_LICENSE("GPL"); | 1113 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index bdef1a18b664..da9dc91ce910 100644 --- a/drivers/media/dvb/dvb-usb/m920x.c +++ b/drivers/media/dvb/dvb-usb/m920x.c | |||
@@ -142,9 +142,9 @@ static int m920x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
142 | if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0) | 142 | if ((ret = m920x_read(d->udev, M9206_CORE, 0x0, M9206_RC_KEY, rc_state + 1, 1)) != 0) |
143 | goto unlock; | 143 | goto unlock; |
144 | 144 | ||
145 | for (i = 0; i < d->props.rc.legacy.rc_key_map_size; i++) | 145 | for (i = 0; i < d->props.rc.legacy.rc_map_size; i++) |
146 | if (rc5_data(&d->props.rc.legacy.rc_key_map[i]) == rc_state[1]) { | 146 | if (rc5_data(&d->props.rc.legacy.rc_map_table[i]) == rc_state[1]) { |
147 | *event = d->props.rc.legacy.rc_key_map[i].keycode; | 147 | *event = d->props.rc.legacy.rc_map_table[i].keycode; |
148 | 148 | ||
149 | switch(rc_state[0]) { | 149 | switch(rc_state[0]) { |
150 | case 0x80: | 150 | case 0x80: |
@@ -589,7 +589,7 @@ static struct m920x_inits pinnacle310e_init[] = { | |||
589 | }; | 589 | }; |
590 | 590 | ||
591 | /* ir keymaps */ | 591 | /* ir keymaps */ |
592 | static struct ir_scancode ir_codes_megasky_table[] = { | 592 | static struct rc_map_table rc_map_megasky_table[] = { |
593 | { 0x0012, KEY_POWER }, | 593 | { 0x0012, KEY_POWER }, |
594 | { 0x001e, KEY_CYCLEWINDOWS }, /* min/max */ | 594 | { 0x001e, KEY_CYCLEWINDOWS }, /* min/max */ |
595 | { 0x0002, KEY_CHANNELUP }, | 595 | { 0x0002, KEY_CHANNELUP }, |
@@ -608,7 +608,7 @@ static struct ir_scancode ir_codes_megasky_table[] = { | |||
608 | { 0x000e, KEY_COFFEE }, /* "MTS" */ | 608 | { 0x000e, KEY_COFFEE }, /* "MTS" */ |
609 | }; | 609 | }; |
610 | 610 | ||
611 | static struct ir_scancode ir_codes_tvwalkertwin_table[] = { | 611 | static struct rc_map_table rc_map_tvwalkertwin_table[] = { |
612 | { 0x0001, KEY_ZOOM }, /* Full Screen */ | 612 | { 0x0001, KEY_ZOOM }, /* Full Screen */ |
613 | { 0x0002, KEY_CAMERA }, /* snapshot */ | 613 | { 0x0002, KEY_CAMERA }, /* snapshot */ |
614 | { 0x0003, KEY_MUTE }, | 614 | { 0x0003, KEY_MUTE }, |
@@ -628,7 +628,7 @@ static struct ir_scancode ir_codes_tvwalkertwin_table[] = { | |||
628 | { 0x001e, KEY_VOLUMEUP }, | 628 | { 0x001e, KEY_VOLUMEUP }, |
629 | }; | 629 | }; |
630 | 630 | ||
631 | static struct ir_scancode ir_codes_pinnacle310e_table[] = { | 631 | static struct rc_map_table rc_map_pinnacle310e_table[] = { |
632 | { 0x16, KEY_POWER }, | 632 | { 0x16, KEY_POWER }, |
633 | { 0x17, KEY_FAVORITES }, | 633 | { 0x17, KEY_FAVORITES }, |
634 | { 0x0f, KEY_TEXT }, | 634 | { 0x0f, KEY_TEXT }, |
@@ -786,8 +786,8 @@ static struct dvb_usb_device_properties megasky_properties = { | |||
786 | 786 | ||
787 | .rc.legacy = { | 787 | .rc.legacy = { |
788 | .rc_interval = 100, | 788 | .rc_interval = 100, |
789 | .rc_key_map = ir_codes_megasky_table, | 789 | .rc_map_table = rc_map_megasky_table, |
790 | .rc_key_map_size = ARRAY_SIZE(ir_codes_megasky_table), | 790 | .rc_map_size = ARRAY_SIZE(rc_map_megasky_table), |
791 | .rc_query = m920x_rc_query, | 791 | .rc_query = m920x_rc_query, |
792 | }, | 792 | }, |
793 | 793 | ||
@@ -889,8 +889,8 @@ static struct dvb_usb_device_properties tvwalkertwin_properties = { | |||
889 | 889 | ||
890 | .rc.legacy = { | 890 | .rc.legacy = { |
891 | .rc_interval = 100, | 891 | .rc_interval = 100, |
892 | .rc_key_map = ir_codes_tvwalkertwin_table, | 892 | .rc_map_table = rc_map_tvwalkertwin_table, |
893 | .rc_key_map_size = ARRAY_SIZE(ir_codes_tvwalkertwin_table), | 893 | .rc_map_size = ARRAY_SIZE(rc_map_tvwalkertwin_table), |
894 | .rc_query = m920x_rc_query, | 894 | .rc_query = m920x_rc_query, |
895 | }, | 895 | }, |
896 | 896 | ||
@@ -998,8 +998,8 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = { | |||
998 | 998 | ||
999 | .rc.legacy = { | 999 | .rc.legacy = { |
1000 | .rc_interval = 100, | 1000 | .rc_interval = 100, |
1001 | .rc_key_map = ir_codes_pinnacle310e_table, | 1001 | .rc_map_table = rc_map_pinnacle310e_table, |
1002 | .rc_key_map_size = ARRAY_SIZE(ir_codes_pinnacle310e_table), | 1002 | .rc_map_size = ARRAY_SIZE(rc_map_pinnacle310e_table), |
1003 | .rc_query = m920x_rc_query, | 1003 | .rc_query = m920x_rc_query, |
1004 | }, | 1004 | }, |
1005 | 1005 | ||
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c index 181f36a12e2a..9d3cd2de46fc 100644 --- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c | |||
@@ -21,7 +21,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | |||
21 | #define deb_ee(args...) dprintk(debug,0x02,args) | 21 | #define deb_ee(args...) dprintk(debug,0x02,args) |
22 | 22 | ||
23 | /* Hauppauge NOVA-T USB2 keys */ | 23 | /* Hauppauge NOVA-T USB2 keys */ |
24 | static struct ir_scancode ir_codes_haupp_table[] = { | 24 | static struct rc_map_table rc_map_haupp_table[] = { |
25 | { 0x1e00, KEY_0 }, | 25 | { 0x1e00, KEY_0 }, |
26 | { 0x1e01, KEY_1 }, | 26 | { 0x1e01, KEY_1 }, |
27 | { 0x1e02, KEY_2 }, | 27 | { 0x1e02, KEY_2 }, |
@@ -91,14 +91,14 @@ static int nova_t_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
91 | 91 | ||
92 | deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x to c: %02x d: %02x toggle: %d\n",key[1],key[2],key[3],custom,data,toggle); | 92 | deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x to c: %02x d: %02x toggle: %d\n",key[1],key[2],key[3],custom,data,toggle); |
93 | 93 | ||
94 | for (i = 0; i < ARRAY_SIZE(ir_codes_haupp_table); i++) { | 94 | for (i = 0; i < ARRAY_SIZE(rc_map_haupp_table); i++) { |
95 | if (rc5_data(&ir_codes_haupp_table[i]) == data && | 95 | if (rc5_data(&rc_map_haupp_table[i]) == data && |
96 | rc5_custom(&ir_codes_haupp_table[i]) == custom) { | 96 | rc5_custom(&rc_map_haupp_table[i]) == custom) { |
97 | 97 | ||
98 | deb_rc("c: %x, d: %x\n", rc5_data(&ir_codes_haupp_table[i]), | 98 | deb_rc("c: %x, d: %x\n", rc5_data(&rc_map_haupp_table[i]), |
99 | rc5_custom(&ir_codes_haupp_table[i])); | 99 | rc5_custom(&rc_map_haupp_table[i])); |
100 | 100 | ||
101 | *event = ir_codes_haupp_table[i].keycode; | 101 | *event = rc_map_haupp_table[i].keycode; |
102 | *state = REMOTE_KEY_PRESSED; | 102 | *state = REMOTE_KEY_PRESSED; |
103 | if (st->old_toggle == toggle) { | 103 | if (st->old_toggle == toggle) { |
104 | if (st->last_repeat_count++ < 2) | 104 | if (st->last_repeat_count++ < 2) |
@@ -197,8 +197,8 @@ static struct dvb_usb_device_properties nova_t_properties = { | |||
197 | 197 | ||
198 | .rc.legacy = { | 198 | .rc.legacy = { |
199 | .rc_interval = 100, | 199 | .rc_interval = 100, |
200 | .rc_key_map = ir_codes_haupp_table, | 200 | .rc_map_table = rc_map_haupp_table, |
201 | .rc_key_map_size = ARRAY_SIZE(ir_codes_haupp_table), | 201 | .rc_map_size = ARRAY_SIZE(rc_map_haupp_table), |
202 | .rc_query = nova_t_rc_query, | 202 | .rc_query = nova_t_rc_query, |
203 | }, | 203 | }, |
204 | 204 | ||
diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index f896337b4535..1f1b7d6980a5 100644 --- a/drivers/media/dvb/dvb-usb/opera1.c +++ b/drivers/media/dvb/dvb-usb/opera1.c | |||
@@ -35,7 +35,7 @@ | |||
35 | struct opera1_state { | 35 | struct opera1_state { |
36 | u32 last_key_pressed; | 36 | u32 last_key_pressed; |
37 | }; | 37 | }; |
38 | struct ir_codes_opera_table { | 38 | struct rc_map_opera_table { |
39 | u32 keycode; | 39 | u32 keycode; |
40 | u32 event; | 40 | u32 event; |
41 | }; | 41 | }; |
@@ -331,7 +331,7 @@ static int opera1_pid_filter_control(struct dvb_usb_adapter *adap, int onoff) | |||
331 | return 0; | 331 | return 0; |
332 | } | 332 | } |
333 | 333 | ||
334 | static struct ir_scancode ir_codes_opera1_table[] = { | 334 | static struct rc_map_table rc_map_opera1_table[] = { |
335 | {0x5fa0, KEY_1}, | 335 | {0x5fa0, KEY_1}, |
336 | {0x51af, KEY_2}, | 336 | {0x51af, KEY_2}, |
337 | {0x5da2, KEY_3}, | 337 | {0x5da2, KEY_3}, |
@@ -404,12 +404,12 @@ static int opera1_rc_query(struct dvb_usb_device *dev, u32 * event, int *state) | |||
404 | 404 | ||
405 | send_key = (send_key & 0xffff) | 0x0100; | 405 | send_key = (send_key & 0xffff) | 0x0100; |
406 | 406 | ||
407 | for (i = 0; i < ARRAY_SIZE(ir_codes_opera1_table); i++) { | 407 | for (i = 0; i < ARRAY_SIZE(rc_map_opera1_table); i++) { |
408 | if (rc5_scan(&ir_codes_opera1_table[i]) == (send_key & 0xffff)) { | 408 | if (rc5_scan(&rc_map_opera1_table[i]) == (send_key & 0xffff)) { |
409 | *state = REMOTE_KEY_PRESSED; | 409 | *state = REMOTE_KEY_PRESSED; |
410 | *event = ir_codes_opera1_table[i].keycode; | 410 | *event = rc_map_opera1_table[i].keycode; |
411 | opst->last_key_pressed = | 411 | opst->last_key_pressed = |
412 | ir_codes_opera1_table[i].keycode; | 412 | rc_map_opera1_table[i].keycode; |
413 | break; | 413 | break; |
414 | } | 414 | } |
415 | opst->last_key_pressed = 0; | 415 | opst->last_key_pressed = 0; |
@@ -497,8 +497,8 @@ static struct dvb_usb_device_properties opera1_properties = { | |||
497 | .i2c_algo = &opera1_i2c_algo, | 497 | .i2c_algo = &opera1_i2c_algo, |
498 | 498 | ||
499 | .rc.legacy = { | 499 | .rc.legacy = { |
500 | .rc_key_map = ir_codes_opera1_table, | 500 | .rc_map_table = rc_map_opera1_table, |
501 | .rc_key_map_size = ARRAY_SIZE(ir_codes_opera1_table), | 501 | .rc_map_size = ARRAY_SIZE(rc_map_opera1_table), |
502 | .rc_interval = 200, | 502 | .rc_interval = 200, |
503 | .rc_query = opera1_rc_query, | 503 | .rc_query = opera1_rc_query, |
504 | }, | 504 | }, |
diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c index a6de489a6a39..0d4709ff9cbb 100644 --- a/drivers/media/dvb/dvb-usb/ttusb2.c +++ b/drivers/media/dvb/dvb-usb/ttusb2.c | |||
@@ -43,6 +43,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | |||
43 | 43 | ||
44 | struct ttusb2_state { | 44 | struct ttusb2_state { |
45 | u8 id; | 45 | u8 id; |
46 | u16 last_rc_key; | ||
46 | }; | 47 | }; |
47 | 48 | ||
48 | static int ttusb2_msg(struct dvb_usb_device *d, u8 cmd, | 49 | static int ttusb2_msg(struct dvb_usb_device *d, u8 cmd, |
@@ -128,6 +129,33 @@ static struct i2c_algorithm ttusb2_i2c_algo = { | |||
128 | .functionality = ttusb2_i2c_func, | 129 | .functionality = ttusb2_i2c_func, |
129 | }; | 130 | }; |
130 | 131 | ||
132 | /* command to poll IR receiver (copied from pctv452e.c) */ | ||
133 | #define CMD_GET_IR_CODE 0x1b | ||
134 | |||
135 | /* IR */ | ||
136 | static int tt3650_rc_query(struct dvb_usb_device *d) | ||
137 | { | ||
138 | int ret; | ||
139 | u8 rx[9]; /* A CMD_GET_IR_CODE reply is 9 bytes long */ | ||
140 | struct ttusb2_state *st = d->priv; | ||
141 | ret = ttusb2_msg(d, CMD_GET_IR_CODE, NULL, 0, rx, sizeof(rx)); | ||
142 | if (ret != 0) | ||
143 | return ret; | ||
144 | |||
145 | if (rx[8] & 0x01) { | ||
146 | /* got a "press" event */ | ||
147 | st->last_rc_key = (rx[3] << 8) | rx[2]; | ||
148 | deb_info("%s: cmd=0x%02x sys=0x%02x\n", __func__, rx[2], rx[3]); | ||
149 | rc_keydown(d->rc_dev, st->last_rc_key, 0); | ||
150 | } else if (st->last_rc_key) { | ||
151 | rc_keyup(d->rc_dev); | ||
152 | st->last_rc_key = 0; | ||
153 | } | ||
154 | |||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | |||
131 | /* Callbacks for DVB USB */ | 159 | /* Callbacks for DVB USB */ |
132 | static int ttusb2_identify_state (struct usb_device *udev, struct | 160 | static int ttusb2_identify_state (struct usb_device *udev, struct |
133 | dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, | 161 | dvb_usb_device_properties *props, struct dvb_usb_device_description **desc, |
@@ -345,6 +373,13 @@ static struct dvb_usb_device_properties ttusb2_properties_ct3650 = { | |||
345 | 373 | ||
346 | .size_of_priv = sizeof(struct ttusb2_state), | 374 | .size_of_priv = sizeof(struct ttusb2_state), |
347 | 375 | ||
376 | .rc.core = { | ||
377 | .rc_interval = 150, /* Less than IR_KEYPRESS_TIMEOUT */ | ||
378 | .rc_codes = RC_MAP_TT_1500, | ||
379 | .rc_query = tt3650_rc_query, | ||
380 | .allowed_protos = RC_TYPE_UNKNOWN, | ||
381 | }, | ||
382 | |||
348 | .num_adapters = 1, | 383 | .num_adapters = 1, |
349 | .adapter = { | 384 | .adapter = { |
350 | { | 385 | { |
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c index 5c9f3275aaa0..7890e75600df 100644 --- a/drivers/media/dvb/dvb-usb/vp702x.c +++ b/drivers/media/dvb/dvb-usb/vp702x.c | |||
@@ -174,7 +174,7 @@ static int vp702x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
174 | } | 174 | } |
175 | 175 | ||
176 | /* keys for the enclosed remote control */ | 176 | /* keys for the enclosed remote control */ |
177 | static struct ir_scancode ir_codes_vp702x_table[] = { | 177 | static struct rc_map_table rc_map_vp702x_table[] = { |
178 | { 0x0001, KEY_1 }, | 178 | { 0x0001, KEY_1 }, |
179 | { 0x0002, KEY_2 }, | 179 | { 0x0002, KEY_2 }, |
180 | }; | 180 | }; |
@@ -197,10 +197,10 @@ static int vp702x_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
197 | return 0; | 197 | return 0; |
198 | } | 198 | } |
199 | 199 | ||
200 | for (i = 0; i < ARRAY_SIZE(ir_codes_vp702x_table); i++) | 200 | for (i = 0; i < ARRAY_SIZE(rc_map_vp702x_table); i++) |
201 | if (rc5_custom(&ir_codes_vp702x_table[i]) == key[1]) { | 201 | if (rc5_custom(&rc_map_vp702x_table[i]) == key[1]) { |
202 | *state = REMOTE_KEY_PRESSED; | 202 | *state = REMOTE_KEY_PRESSED; |
203 | *event = ir_codes_vp702x_table[i].keycode; | 203 | *event = rc_map_vp702x_table[i].keycode; |
204 | break; | 204 | break; |
205 | } | 205 | } |
206 | return 0; | 206 | return 0; |
@@ -284,8 +284,8 @@ static struct dvb_usb_device_properties vp702x_properties = { | |||
284 | .read_mac_address = vp702x_read_mac_addr, | 284 | .read_mac_address = vp702x_read_mac_addr, |
285 | 285 | ||
286 | .rc.legacy = { | 286 | .rc.legacy = { |
287 | .rc_key_map = ir_codes_vp702x_table, | 287 | .rc_map_table = rc_map_vp702x_table, |
288 | .rc_key_map_size = ARRAY_SIZE(ir_codes_vp702x_table), | 288 | .rc_map_size = ARRAY_SIZE(rc_map_vp702x_table), |
289 | .rc_interval = 400, | 289 | .rc_interval = 400, |
290 | .rc_query = vp702x_rc_query, | 290 | .rc_query = vp702x_rc_query, |
291 | }, | 291 | }, |
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c index f13791ca5994..ab0ab3c35e80 100644 --- a/drivers/media/dvb/dvb-usb/vp7045.c +++ b/drivers/media/dvb/dvb-usb/vp7045.c | |||
@@ -99,7 +99,7 @@ static int vp7045_power_ctrl(struct dvb_usb_device *d, int onoff) | |||
99 | 99 | ||
100 | /* The keymapping struct. Somehow this should be loaded to the driver, but | 100 | /* The keymapping struct. Somehow this should be loaded to the driver, but |
101 | * currently it is hardcoded. */ | 101 | * currently it is hardcoded. */ |
102 | static struct ir_scancode ir_codes_vp7045_table[] = { | 102 | static struct rc_map_table rc_map_vp7045_table[] = { |
103 | { 0x0016, KEY_POWER }, | 103 | { 0x0016, KEY_POWER }, |
104 | { 0x0010, KEY_MUTE }, | 104 | { 0x0010, KEY_MUTE }, |
105 | { 0x0003, KEY_1 }, | 105 | { 0x0003, KEY_1 }, |
@@ -165,10 +165,10 @@ static int vp7045_rc_query(struct dvb_usb_device *d, u32 *event, int *state) | |||
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | 167 | ||
168 | for (i = 0; i < ARRAY_SIZE(ir_codes_vp7045_table); i++) | 168 | for (i = 0; i < ARRAY_SIZE(rc_map_vp7045_table); i++) |
169 | if (rc5_data(&ir_codes_vp7045_table[i]) == key) { | 169 | if (rc5_data(&rc_map_vp7045_table[i]) == key) { |
170 | *state = REMOTE_KEY_PRESSED; | 170 | *state = REMOTE_KEY_PRESSED; |
171 | *event = ir_codes_vp7045_table[i].keycode; | 171 | *event = rc_map_vp7045_table[i].keycode; |
172 | break; | 172 | break; |
173 | } | 173 | } |
174 | return 0; | 174 | return 0; |
@@ -261,8 +261,8 @@ static struct dvb_usb_device_properties vp7045_properties = { | |||
261 | 261 | ||
262 | .rc.legacy = { | 262 | .rc.legacy = { |
263 | .rc_interval = 400, | 263 | .rc_interval = 400, |
264 | .rc_key_map = ir_codes_vp7045_table, | 264 | .rc_map_table = rc_map_vp7045_table, |
265 | .rc_key_map_size = ARRAY_SIZE(ir_codes_vp7045_table), | 265 | .rc_map_size = ARRAY_SIZE(rc_map_vp7045_table), |
266 | .rc_query = vp7045_rc_query, | 266 | .rc_query = vp7045_rc_query, |
267 | }, | 267 | }, |
268 | 268 | ||