aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2012-10-11 18:11:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-27 09:49:51 -0400
commitc003ab1bedf028db15b0185b683d5c387204e8f5 (patch)
tree00f608e80e897589492eb2274c46ffb9fde769cf /drivers/media/rc
parent304ce75dd501d84d33dbca3c544e903f1d3377f7 (diff)
[media] rc-core: add separate defines for protocol bitmaps and numbers
The RC_TYPE_* defines are currently used both where a single protocol is expected and where a bitmap of protocols is expected. Functions like rc_keydown() and functions which add/remove entries to the keytable want a single protocol. Future userspace APIs would also benefit from numeric protocols (rather than bitmap ones). Keytables are smaller if they can use a small(ish) integer rather than a bitmap. Other functions or struct members (e.g. allowed_protos, enabled_protocols, etc) accept multiple protocols and need a bitmap. Using different types reduces the risk of programmer error. Using a protocol enum whereever possible also makes for a more future-proof user-space API as we don't need to worry about a sufficient number of bits being available (e.g. in structs used for ioctl() calls). The use of both a number and a corresponding bit is dalso one in e.g. the input subsystem as well (see all the references to set/clear bit when changing keytables for example). This patch separate the different usages in preparation for upcoming patches. Where a single protocol is expected, enum rc_type is used; where one or more protocol(s) are expected, something like u64 is used. The patch has been rewritten so that the format of the sysfs "protocols" file is no longer altered (at the loss of some detail). The file itself should probably be deprecated in the future though. Signed-off-by: David Härdeman <david@hardeman.nu> Cc: Andy Walls <awalls@md.metrocast.net> Cc: Maxim Levitsky <maximlevitsky@gmail.com> Cc: Antti Palosaari <crope@iki.fi> Cc: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/ati_remote.c2
-rw-r--r--drivers/media/rc/ene_ir.c2
-rw-r--r--drivers/media/rc/fintek-cir.c2
-rw-r--r--drivers/media/rc/gpio-ir-recv.c2
-rw-r--r--drivers/media/rc/iguanair.c2
-rw-r--r--drivers/media/rc/imon.c40
-rw-r--r--drivers/media/rc/ir-jvc-decoder.c4
-rw-r--r--drivers/media/rc/ir-lirc-codec.c4
-rw-r--r--drivers/media/rc/ir-mce_kbd-decoder.c4
-rw-r--r--drivers/media/rc/ir-nec-decoder.c4
-rw-r--r--drivers/media/rc/ir-rc5-decoder.c14
-rw-r--r--drivers/media/rc/ir-rc5-sz-decoder.c6
-rw-r--r--drivers/media/rc/ir-rc6-decoder.c8
-rw-r--r--drivers/media/rc/ir-sanyo-decoder.c4
-rw-r--r--drivers/media/rc/ir-sony-decoder.c17
-rw-r--r--drivers/media/rc/ite-cir.c2
-rw-r--r--drivers/media/rc/keymaps/rc-imon-mce.c2
-rw-r--r--drivers/media/rc/keymaps/rc-rc6-mce.c2
-rw-r--r--drivers/media/rc/mceusb.c2
-rw-r--r--drivers/media/rc/nuvoton-cir.c2
-rw-r--r--drivers/media/rc/rc-loopback.c2
-rw-r--r--drivers/media/rc/rc-main.c73
-rw-r--r--drivers/media/rc/redrat3.c2
-rw-r--r--drivers/media/rc/streamzap.c2
-rw-r--r--drivers/media/rc/ttusbir.c2
-rw-r--r--drivers/media/rc/winbond-cir.c2
26 files changed, 119 insertions, 89 deletions
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 49bb356ed14c..2d6fb26a0170 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -784,7 +784,7 @@ static void ati_remote_rc_init(struct ati_remote *ati_remote)
784 784
785 rdev->priv = ati_remote; 785 rdev->priv = ati_remote;
786 rdev->driver_type = RC_DRIVER_SCANCODE; 786 rdev->driver_type = RC_DRIVER_SCANCODE;
787 rdev->allowed_protos = RC_TYPE_OTHER; 787 rdev->allowed_protos = RC_BIT_OTHER;
788 rdev->driver_name = "ati_remote"; 788 rdev->driver_name = "ati_remote";
789 789
790 rdev->open = ati_remote_rc_open; 790 rdev->open = ati_remote_rc_open;
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index d05ac15b5de4..7467a6da39ff 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -1046,7 +1046,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
1046 learning_mode_force = false; 1046 learning_mode_force = false;
1047 1047
1048 rdev->driver_type = RC_DRIVER_IR_RAW; 1048 rdev->driver_type = RC_DRIVER_IR_RAW;
1049 rdev->allowed_protos = RC_TYPE_ALL; 1049 rdev->allowed_protos = RC_BIT_ALL;
1050 rdev->priv = dev; 1050 rdev->priv = dev;
1051 rdev->open = ene_open; 1051 rdev->open = ene_open;
1052 rdev->close = ene_close; 1052 rdev->close = ene_close;
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c
index 52fd7696b1ba..d2d93cbe628c 100644
--- a/drivers/media/rc/fintek-cir.c
+++ b/drivers/media/rc/fintek-cir.c
@@ -541,7 +541,7 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
541 /* Set up the rc device */ 541 /* Set up the rc device */
542 rdev->priv = fintek; 542 rdev->priv = fintek;
543 rdev->driver_type = RC_DRIVER_IR_RAW; 543 rdev->driver_type = RC_DRIVER_IR_RAW;
544 rdev->allowed_protos = RC_TYPE_ALL; 544 rdev->allowed_protos = RC_BIT_ALL;
545 rdev->open = fintek_open; 545 rdev->open = fintek_open;
546 rdev->close = fintek_close; 546 rdev->close = fintek_close;
547 rdev->input_name = FINTEK_DESCRIPTION; 547 rdev->input_name = FINTEK_DESCRIPTION;
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
index 04cb272db16a..ba1a1eb356cf 100644
--- a/drivers/media/rc/gpio-ir-recv.c
+++ b/drivers/media/rc/gpio-ir-recv.c
@@ -95,7 +95,7 @@ static int __devinit gpio_ir_recv_probe(struct platform_device *pdev)
95 if (pdata->allowed_protos) 95 if (pdata->allowed_protos)
96 rcdev->allowed_protos = pdata->allowed_protos; 96 rcdev->allowed_protos = pdata->allowed_protos;
97 else 97 else
98 rcdev->allowed_protos = RC_TYPE_ALL; 98 rcdev->allowed_protos = RC_BIT_ALL;
99 rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY; 99 rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY;
100 100
101 gpio_dev->rcdev = rcdev; 101 gpio_dev->rcdev = rcdev;
diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c
index 51d7057aca04..5a9163da63c3 100644
--- a/drivers/media/rc/iguanair.c
+++ b/drivers/media/rc/iguanair.c
@@ -499,7 +499,7 @@ static int __devinit iguanair_probe(struct usb_interface *intf,
499 usb_to_input_id(ir->udev, &rc->input_id); 499 usb_to_input_id(ir->udev, &rc->input_id);
500 rc->dev.parent = &intf->dev; 500 rc->dev.parent = &intf->dev;
501 rc->driver_type = RC_DRIVER_IR_RAW; 501 rc->driver_type = RC_DRIVER_IR_RAW;
502 rc->allowed_protos = RC_TYPE_ALL; 502 rc->allowed_protos = RC_BIT_ALL;
503 rc->priv = ir; 503 rc->priv = ir;
504 rc->open = iguanair_open; 504 rc->open = iguanair_open;
505 rc->close = iguanair_close; 505 rc->close = iguanair_close;
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 5dd0386604f0..8f6a28921ed4 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -1001,7 +1001,7 @@ static void imon_touch_display_timeout(unsigned long data)
1001 * it is not, so we must acquire it prior to calling send_packet, which 1001 * it is not, so we must acquire it prior to calling send_packet, which
1002 * requires that the lock is held. 1002 * requires that the lock is held.
1003 */ 1003 */
1004static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) 1004static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_type)
1005{ 1005{
1006 int retval; 1006 int retval;
1007 struct imon_context *ictx = rc->priv; 1007 struct imon_context *ictx = rc->priv;
@@ -1010,31 +1010,27 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
1010 unsigned char ir_proto_packet[] = { 1010 unsigned char ir_proto_packet[] = {
1011 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; 1011 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 };
1012 1012
1013 if (rc_type && !(rc_type & rc->allowed_protos)) 1013 if (*rc_type && !(*rc_type & rc->allowed_protos))
1014 dev_warn(dev, "Looks like you're trying to use an IR protocol " 1014 dev_warn(dev, "Looks like you're trying to use an IR protocol "
1015 "this device does not support\n"); 1015 "this device does not support\n");
1016 1016
1017 switch (rc_type) { 1017 if (*rc_type & RC_BIT_RC6_MCE) {
1018 case RC_TYPE_RC6:
1019 dev_dbg(dev, "Configuring IR receiver for MCE protocol\n"); 1018 dev_dbg(dev, "Configuring IR receiver for MCE protocol\n");
1020 ir_proto_packet[0] = 0x01; 1019 ir_proto_packet[0] = 0x01;
1021 break; 1020 *rc_type = RC_BIT_RC6_MCE;
1022 case RC_TYPE_UNKNOWN: 1021 } else if (*rc_type & RC_BIT_OTHER) {
1023 case RC_TYPE_OTHER:
1024 dev_dbg(dev, "Configuring IR receiver for iMON protocol\n"); 1022 dev_dbg(dev, "Configuring IR receiver for iMON protocol\n");
1025 if (!pad_stabilize) 1023 if (!pad_stabilize)
1026 dev_dbg(dev, "PAD stabilize functionality disabled\n"); 1024 dev_dbg(dev, "PAD stabilize functionality disabled\n");
1027 /* ir_proto_packet[0] = 0x00; // already the default */ 1025 /* ir_proto_packet[0] = 0x00; // already the default */
1028 rc_type = RC_TYPE_OTHER; 1026 *rc_type = RC_BIT_OTHER;
1029 break; 1027 } else {
1030 default:
1031 dev_warn(dev, "Unsupported IR protocol specified, overriding " 1028 dev_warn(dev, "Unsupported IR protocol specified, overriding "
1032 "to iMON IR protocol\n"); 1029 "to iMON IR protocol\n");
1033 if (!pad_stabilize) 1030 if (!pad_stabilize)
1034 dev_dbg(dev, "PAD stabilize functionality disabled\n"); 1031 dev_dbg(dev, "PAD stabilize functionality disabled\n");
1035 /* ir_proto_packet[0] = 0x00; // already the default */ 1032 /* ir_proto_packet[0] = 0x00; // already the default */
1036 rc_type = RC_TYPE_OTHER; 1033 *rc_type = RC_BIT_OTHER;
1037 break;
1038 } 1034 }
1039 1035
1040 memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet)); 1036 memcpy(ictx->usb_tx_buf, &ir_proto_packet, sizeof(ir_proto_packet));
@@ -1048,7 +1044,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type)
1048 if (retval) 1044 if (retval)
1049 goto out; 1045 goto out;
1050 1046
1051 ictx->rc_type = rc_type; 1047 ictx->rc_type = *rc_type;
1052 ictx->pad_mouse = false; 1048 ictx->pad_mouse = false;
1053 1049
1054out: 1050out:
@@ -1323,7 +1319,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
1323 rel_x = buf[2]; 1319 rel_x = buf[2];
1324 rel_y = buf[3]; 1320 rel_y = buf[3];
1325 1321
1326 if (ictx->rc_type == RC_TYPE_OTHER && pad_stabilize) { 1322 if (ictx->rc_type == RC_BIT_OTHER && pad_stabilize) {
1327 if ((buf[1] == 0) && ((rel_x != 0) || (rel_y != 0))) { 1323 if ((buf[1] == 0) && ((rel_x != 0) || (rel_y != 0))) {
1328 dir = stabilize((int)rel_x, (int)rel_y, 1324 dir = stabilize((int)rel_x, (int)rel_y,
1329 timeout, threshold); 1325 timeout, threshold);
@@ -1390,7 +1386,7 @@ static void imon_pad_to_keys(struct imon_context *ictx, unsigned char *buf)
1390 buf[0] = 0x01; 1386 buf[0] = 0x01;
1391 buf[1] = buf[4] = buf[5] = buf[6] = buf[7] = 0; 1387 buf[1] = buf[4] = buf[5] = buf[6] = buf[7] = 0;
1392 1388
1393 if (ictx->rc_type == RC_TYPE_OTHER && pad_stabilize) { 1389 if (ictx->rc_type == RC_BIT_OTHER && pad_stabilize) {
1394 dir = stabilize((int)rel_x, (int)rel_y, 1390 dir = stabilize((int)rel_x, (int)rel_y,
1395 timeout, threshold); 1391 timeout, threshold);
1396 if (!dir) { 1392 if (!dir) {
@@ -1511,7 +1507,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
1511 kc = imon_panel_key_lookup(scancode); 1507 kc = imon_panel_key_lookup(scancode);
1512 } else { 1508 } else {
1513 scancode = be32_to_cpu(*((u32 *)buf)); 1509 scancode = be32_to_cpu(*((u32 *)buf));
1514 if (ictx->rc_type == RC_TYPE_RC6) { 1510 if (ictx->rc_type == RC_BIT_RC6_MCE) {
1515 ktype = IMON_KEY_IMON; 1511 ktype = IMON_KEY_IMON;
1516 if (buf[0] == 0x80) 1512 if (buf[0] == 0x80)
1517 ktype = IMON_KEY_MCE; 1513 ktype = IMON_KEY_MCE;
@@ -1744,7 +1740,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
1744{ 1740{
1745 u8 ffdc_cfg_byte = ictx->usb_rx_buf[6]; 1741 u8 ffdc_cfg_byte = ictx->usb_rx_buf[6];
1746 u8 detected_display_type = IMON_DISPLAY_TYPE_NONE; 1742 u8 detected_display_type = IMON_DISPLAY_TYPE_NONE;
1747 u64 allowed_protos = RC_TYPE_OTHER; 1743 u64 allowed_protos = RC_BIT_OTHER;
1748 1744
1749 switch (ffdc_cfg_byte) { 1745 switch (ffdc_cfg_byte) {
1750 /* iMON Knob, no display, iMON IR + vol knob */ 1746 /* iMON Knob, no display, iMON IR + vol knob */
@@ -1775,13 +1771,13 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
1775 case 0x9e: 1771 case 0x9e:
1776 dev_info(ictx->dev, "0xffdc iMON VFD, MCE IR"); 1772 dev_info(ictx->dev, "0xffdc iMON VFD, MCE IR");
1777 detected_display_type = IMON_DISPLAY_TYPE_VFD; 1773 detected_display_type = IMON_DISPLAY_TYPE_VFD;
1778 allowed_protos = RC_TYPE_RC6; 1774 allowed_protos = RC_BIT_RC6_MCE;
1779 break; 1775 break;
1780 /* iMON LCD, MCE IR */ 1776 /* iMON LCD, MCE IR */
1781 case 0x9f: 1777 case 0x9f:
1782 dev_info(ictx->dev, "0xffdc iMON LCD, MCE IR"); 1778 dev_info(ictx->dev, "0xffdc iMON LCD, MCE IR");
1783 detected_display_type = IMON_DISPLAY_TYPE_LCD; 1779 detected_display_type = IMON_DISPLAY_TYPE_LCD;
1784 allowed_protos = RC_TYPE_RC6; 1780 allowed_protos = RC_BIT_RC6_MCE;
1785 break; 1781 break;
1786 default: 1782 default:
1787 dev_info(ictx->dev, "Unknown 0xffdc device, " 1783 dev_info(ictx->dev, "Unknown 0xffdc device, "
@@ -1789,7 +1785,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
1789 detected_display_type = IMON_DISPLAY_TYPE_VFD; 1785 detected_display_type = IMON_DISPLAY_TYPE_VFD;
1790 /* We don't know which one it is, allow user to set the 1786 /* We don't know which one it is, allow user to set the
1791 * RC6 one from userspace if OTHER wasn't correct. */ 1787 * RC6 one from userspace if OTHER wasn't correct. */
1792 allowed_protos |= RC_TYPE_RC6; 1788 allowed_protos |= RC_BIT_RC6_MCE;
1793 break; 1789 break;
1794 } 1790 }
1795 1791
@@ -1875,7 +1871,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
1875 1871
1876 rdev->priv = ictx; 1872 rdev->priv = ictx;
1877 rdev->driver_type = RC_DRIVER_SCANCODE; 1873 rdev->driver_type = RC_DRIVER_SCANCODE;
1878 rdev->allowed_protos = RC_TYPE_OTHER | RC_TYPE_RC6; /* iMON PAD or MCE */ 1874 rdev->allowed_protos = RC_BIT_OTHER | RC_BIT_RC6_MCE; /* iMON PAD or MCE */
1879 rdev->change_protocol = imon_ir_change_protocol; 1875 rdev->change_protocol = imon_ir_change_protocol;
1880 rdev->driver_name = MOD_NAME; 1876 rdev->driver_name = MOD_NAME;
1881 1877
@@ -1893,7 +1889,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
1893 1889
1894 imon_set_display_type(ictx); 1890 imon_set_display_type(ictx);
1895 1891
1896 if (ictx->rc_type == RC_TYPE_RC6) 1892 if (ictx->rc_type == RC_BIT_RC6_MCE)
1897 rdev->map_name = RC_MAP_IMON_MCE; 1893 rdev->map_name = RC_MAP_IMON_MCE;
1898 else 1894 else
1899 rdev->map_name = RC_MAP_IMON_PAD; 1895 rdev->map_name = RC_MAP_IMON_PAD;
diff --git a/drivers/media/rc/ir-jvc-decoder.c b/drivers/media/rc/ir-jvc-decoder.c
index 035668e27f6b..69edffb9fe9a 100644
--- a/drivers/media/rc/ir-jvc-decoder.c
+++ b/drivers/media/rc/ir-jvc-decoder.c
@@ -47,7 +47,7 @@ static int ir_jvc_decode(struct rc_dev *dev, struct ir_raw_event ev)
47{ 47{
48 struct jvc_dec *data = &dev->raw->jvc; 48 struct jvc_dec *data = &dev->raw->jvc;
49 49
50 if (!(dev->raw->enabled_protocols & RC_TYPE_JVC)) 50 if (!(dev->raw->enabled_protocols & RC_BIT_JVC))
51 return 0; 51 return 0;
52 52
53 if (!is_timing_event(ev)) { 53 if (!is_timing_event(ev)) {
@@ -174,7 +174,7 @@ out:
174} 174}
175 175
176static struct ir_raw_handler jvc_handler = { 176static struct ir_raw_handler jvc_handler = {
177 .protocols = RC_TYPE_JVC, 177 .protocols = RC_BIT_JVC,
178 .decode = ir_jvc_decode, 178 .decode = ir_jvc_decode,
179}; 179};
180 180
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index 870c93052fd0..9945e5e7f61a 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -35,7 +35,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev)
35 struct lirc_codec *lirc = &dev->raw->lirc; 35 struct lirc_codec *lirc = &dev->raw->lirc;
36 int sample; 36 int sample;
37 37
38 if (!(dev->raw->enabled_protocols & RC_TYPE_LIRC)) 38 if (!(dev->raw->enabled_protocols & RC_BIT_LIRC))
39 return 0; 39 return 0;
40 40
41 if (!dev->raw->lirc.drv || !dev->raw->lirc.drv->rbuf) 41 if (!dev->raw->lirc.drv || !dev->raw->lirc.drv->rbuf)
@@ -408,7 +408,7 @@ static int ir_lirc_unregister(struct rc_dev *dev)
408} 408}
409 409
410static struct ir_raw_handler lirc_handler = { 410static struct ir_raw_handler lirc_handler = {
411 .protocols = RC_TYPE_LIRC, 411 .protocols = RC_BIT_LIRC,
412 .decode = ir_lirc_decode, 412 .decode = ir_lirc_decode,
413 .raw_register = ir_lirc_register, 413 .raw_register = ir_lirc_register,
414 .raw_unregister = ir_lirc_unregister, 414 .raw_unregister = ir_lirc_unregister,
diff --git a/drivers/media/rc/ir-mce_kbd-decoder.c b/drivers/media/rc/ir-mce_kbd-decoder.c
index 3784ebf80ec7..33fafa4cf7cb 100644
--- a/drivers/media/rc/ir-mce_kbd-decoder.c
+++ b/drivers/media/rc/ir-mce_kbd-decoder.c
@@ -216,7 +216,7 @@ static int ir_mce_kbd_decode(struct rc_dev *dev, struct ir_raw_event ev)
216 u32 scancode; 216 u32 scancode;
217 unsigned long delay; 217 unsigned long delay;
218 218
219 if (!(dev->raw->enabled_protocols & RC_TYPE_MCE_KBD)) 219 if (!(dev->raw->enabled_protocols & RC_BIT_MCE_KBD))
220 return 0; 220 return 0;
221 221
222 if (!is_timing_event(ev)) { 222 if (!is_timing_event(ev)) {
@@ -422,7 +422,7 @@ static int ir_mce_kbd_unregister(struct rc_dev *dev)
422} 422}
423 423
424static struct ir_raw_handler mce_kbd_handler = { 424static struct ir_raw_handler mce_kbd_handler = {
425 .protocols = RC_TYPE_MCE_KBD, 425 .protocols = RC_BIT_MCE_KBD,
426 .decode = ir_mce_kbd_decode, 426 .decode = ir_mce_kbd_decode,
427 .raw_register = ir_mce_kbd_register, 427 .raw_register = ir_mce_kbd_register,
428 .raw_unregister = ir_mce_kbd_unregister, 428 .raw_unregister = ir_mce_kbd_unregister,
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
index 2ca509e6e16b..a47ee3634969 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -52,7 +52,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
52 u8 address, not_address, command, not_command; 52 u8 address, not_address, command, not_command;
53 bool send_32bits = false; 53 bool send_32bits = false;
54 54
55 if (!(dev->raw->enabled_protocols & RC_TYPE_NEC)) 55 if (!(dev->raw->enabled_protocols & RC_BIT_NEC))
56 return 0; 56 return 0;
57 57
58 if (!is_timing_event(ev)) { 58 if (!is_timing_event(ev)) {
@@ -201,7 +201,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
201} 201}
202 202
203static struct ir_raw_handler nec_handler = { 203static struct ir_raw_handler nec_handler = {
204 .protocols = RC_TYPE_NEC, 204 .protocols = RC_BIT_NEC,
205 .decode = ir_nec_decode, 205 .decode = ir_nec_decode,
206}; 206};
207 207
diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c
index 9ab663a507a4..5b4d1ddeac4e 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -52,8 +52,8 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev)
52 u8 toggle; 52 u8 toggle;
53 u32 scancode; 53 u32 scancode;
54 54
55 if (!(dev->raw->enabled_protocols & RC_TYPE_RC5)) 55 if (!(dev->raw->enabled_protocols & (RC_BIT_RC5 | RC_BIT_RC5X)))
56 return 0; 56 return 0;
57 57
58 if (!is_timing_event(ev)) { 58 if (!is_timing_event(ev)) {
59 if (ev.reset) 59 if (ev.reset)
@@ -128,6 +128,10 @@ again:
128 if (data->wanted_bits == RC5X_NBITS) { 128 if (data->wanted_bits == RC5X_NBITS) {
129 /* RC5X */ 129 /* RC5X */
130 u8 xdata, command, system; 130 u8 xdata, command, system;
131 if (!(dev->raw->enabled_protocols & RC_BIT_RC5X)) {
132 data->state = STATE_INACTIVE;
133 return 0;
134 }
131 xdata = (data->bits & 0x0003F) >> 0; 135 xdata = (data->bits & 0x0003F) >> 0;
132 command = (data->bits & 0x00FC0) >> 6; 136 command = (data->bits & 0x00FC0) >> 6;
133 system = (data->bits & 0x1F000) >> 12; 137 system = (data->bits & 0x1F000) >> 12;
@@ -141,6 +145,10 @@ again:
141 } else { 145 } else {
142 /* RC5 */ 146 /* RC5 */
143 u8 command, system; 147 u8 command, system;
148 if (!(dev->raw->enabled_protocols & RC_BIT_RC5)) {
149 data->state = STATE_INACTIVE;
150 return 0;
151 }
144 command = (data->bits & 0x0003F) >> 0; 152 command = (data->bits & 0x0003F) >> 0;
145 system = (data->bits & 0x007C0) >> 6; 153 system = (data->bits & 0x007C0) >> 6;
146 toggle = (data->bits & 0x00800) ? 1 : 0; 154 toggle = (data->bits & 0x00800) ? 1 : 0;
@@ -164,7 +172,7 @@ out:
164} 172}
165 173
166static struct ir_raw_handler rc5_handler = { 174static struct ir_raw_handler rc5_handler = {
167 .protocols = RC_TYPE_RC5, 175 .protocols = RC_BIT_RC5 | RC_BIT_RC5X,
168 .decode = ir_rc5_decode, 176 .decode = ir_rc5_decode,
169}; 177};
170 178
diff --git a/drivers/media/rc/ir-rc5-sz-decoder.c b/drivers/media/rc/ir-rc5-sz-decoder.c
index ec8d4a2e2c5a..fd807a8308d8 100644
--- a/drivers/media/rc/ir-rc5-sz-decoder.c
+++ b/drivers/media/rc/ir-rc5-sz-decoder.c
@@ -48,8 +48,8 @@ static int ir_rc5_sz_decode(struct rc_dev *dev, struct ir_raw_event ev)
48 u8 toggle, command, system; 48 u8 toggle, command, system;
49 u32 scancode; 49 u32 scancode;
50 50
51 if (!(dev->raw->enabled_protocols & RC_TYPE_RC5_SZ)) 51 if (!(dev->raw->enabled_protocols & RC_BIT_RC5_SZ))
52 return 0; 52 return 0;
53 53
54 if (!is_timing_event(ev)) { 54 if (!is_timing_event(ev)) {
55 if (ev.reset) 55 if (ev.reset)
@@ -128,7 +128,7 @@ out:
128} 128}
129 129
130static struct ir_raw_handler rc5_sz_handler = { 130static struct ir_raw_handler rc5_sz_handler = {
131 .protocols = RC_TYPE_RC5_SZ, 131 .protocols = RC_BIT_RC5_SZ,
132 .decode = ir_rc5_sz_decode, 132 .decode = ir_rc5_sz_decode,
133}; 133};
134 134
diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c
index 4cfdd7fa4bbd..e19072ffb36c 100644
--- a/drivers/media/rc/ir-rc6-decoder.c
+++ b/drivers/media/rc/ir-rc6-decoder.c
@@ -89,7 +89,9 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev)
89 u32 scancode; 89 u32 scancode;
90 u8 toggle; 90 u8 toggle;
91 91
92 if (!(dev->raw->enabled_protocols & RC_TYPE_RC6)) 92 if (!(dev->raw->enabled_protocols &
93 (RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 |
94 RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE)))
93 return 0; 95 return 0;
94 96
95 if (!is_timing_event(ev)) { 97 if (!is_timing_event(ev)) {
@@ -271,7 +273,9 @@ out:
271} 273}
272 274
273static struct ir_raw_handler rc6_handler = { 275static struct ir_raw_handler rc6_handler = {
274 .protocols = RC_TYPE_RC6, 276 .protocols = RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 |
277 RC_BIT_RC6_6A_24 | RC_BIT_RC6_6A_32 |
278 RC_BIT_RC6_MCE,
275 .decode = ir_rc6_decode, 279 .decode = ir_rc6_decode,
276}; 280};
277 281
diff --git a/drivers/media/rc/ir-sanyo-decoder.c b/drivers/media/rc/ir-sanyo-decoder.c
index 7e54ec57bcf9..7e69a3b65370 100644
--- a/drivers/media/rc/ir-sanyo-decoder.c
+++ b/drivers/media/rc/ir-sanyo-decoder.c
@@ -58,7 +58,7 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev)
58 u32 scancode; 58 u32 scancode;
59 u8 address, command, not_command; 59 u8 address, command, not_command;
60 60
61 if (!(dev->raw->enabled_protocols & RC_TYPE_SANYO)) 61 if (!(dev->raw->enabled_protocols & RC_BIT_SANYO))
62 return 0; 62 return 0;
63 63
64 if (!is_timing_event(ev)) { 64 if (!is_timing_event(ev)) {
@@ -179,7 +179,7 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev)
179} 179}
180 180
181static struct ir_raw_handler sanyo_handler = { 181static struct ir_raw_handler sanyo_handler = {
182 .protocols = RC_TYPE_SANYO, 182 .protocols = RC_BIT_SANYO,
183 .decode = ir_sanyo_decode, 183 .decode = ir_sanyo_decode,
184}; 184};
185 185
diff --git a/drivers/media/rc/ir-sony-decoder.c b/drivers/media/rc/ir-sony-decoder.c
index dab98b37621a..fb914342cf4d 100644
--- a/drivers/media/rc/ir-sony-decoder.c
+++ b/drivers/media/rc/ir-sony-decoder.c
@@ -45,7 +45,8 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
45 u32 scancode; 45 u32 scancode;
46 u8 device, subdevice, function; 46 u8 device, subdevice, function;
47 47
48 if (!(dev->raw->enabled_protocols & RC_TYPE_SONY)) 48 if (!(dev->raw->enabled_protocols &
49 (RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20)))
49 return 0; 50 return 0;
50 51
51 if (!is_timing_event(ev)) { 52 if (!is_timing_event(ev)) {
@@ -123,16 +124,28 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
123 124
124 switch (data->count) { 125 switch (data->count) {
125 case 12: 126 case 12:
127 if (!(dev->raw->enabled_protocols & RC_BIT_SONY12)) {
128 data->state = STATE_INACTIVE;
129 return 0;
130 }
126 device = bitrev8((data->bits << 3) & 0xF8); 131 device = bitrev8((data->bits << 3) & 0xF8);
127 subdevice = 0; 132 subdevice = 0;
128 function = bitrev8((data->bits >> 4) & 0xFE); 133 function = bitrev8((data->bits >> 4) & 0xFE);
129 break; 134 break;
130 case 15: 135 case 15:
136 if (!(dev->raw->enabled_protocols & RC_BIT_SONY15)) {
137 data->state = STATE_INACTIVE;
138 return 0;
139 }
131 device = bitrev8((data->bits >> 0) & 0xFF); 140 device = bitrev8((data->bits >> 0) & 0xFF);
132 subdevice = 0; 141 subdevice = 0;
133 function = bitrev8((data->bits >> 7) & 0xFE); 142 function = bitrev8((data->bits >> 7) & 0xFE);
134 break; 143 break;
135 case 20: 144 case 20:
145 if (!(dev->raw->enabled_protocols & RC_BIT_SONY20)) {
146 data->state = STATE_INACTIVE;
147 return 0;
148 }
136 device = bitrev8((data->bits >> 5) & 0xF8); 149 device = bitrev8((data->bits >> 5) & 0xF8);
137 subdevice = bitrev8((data->bits >> 0) & 0xFF); 150 subdevice = bitrev8((data->bits >> 0) & 0xFF);
138 function = bitrev8((data->bits >> 12) & 0xFE); 151 function = bitrev8((data->bits >> 12) & 0xFE);
@@ -157,7 +170,7 @@ out:
157} 170}
158 171
159static struct ir_raw_handler sony_handler = { 172static struct ir_raw_handler sony_handler = {
160 .protocols = RC_TYPE_SONY, 173 .protocols = RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20,
161 .decode = ir_sony_decode, 174 .decode = ir_sony_decode,
162}; 175};
163 176
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 24c77a42fc36..d63511511df4 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -1563,7 +1563,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
1563 /* set up ir-core props */ 1563 /* set up ir-core props */
1564 rdev->priv = itdev; 1564 rdev->priv = itdev;
1565 rdev->driver_type = RC_DRIVER_IR_RAW; 1565 rdev->driver_type = RC_DRIVER_IR_RAW;
1566 rdev->allowed_protos = RC_TYPE_ALL; 1566 rdev->allowed_protos = RC_BIT_ALL;
1567 rdev->open = ite_open; 1567 rdev->open = ite_open;
1568 rdev->close = ite_close; 1568 rdev->close = ite_close;
1569 rdev->s_idle = ite_s_idle; 1569 rdev->s_idle = ite_s_idle;
diff --git a/drivers/media/rc/keymaps/rc-imon-mce.c b/drivers/media/rc/keymaps/rc-imon-mce.c
index 124c7228ba8c..f0da960560b0 100644
--- a/drivers/media/rc/keymaps/rc-imon-mce.c
+++ b/drivers/media/rc/keymaps/rc-imon-mce.c
@@ -121,7 +121,7 @@ static struct rc_map_list imon_mce_map = {
121 .scan = imon_mce, 121 .scan = imon_mce,
122 .size = ARRAY_SIZE(imon_mce), 122 .size = ARRAY_SIZE(imon_mce),
123 /* its RC6, but w/a hardware decoder */ 123 /* its RC6, but w/a hardware decoder */
124 .rc_type = RC_TYPE_RC6, 124 .rc_type = RC_TYPE_RC6_MCE,
125 .name = RC_MAP_IMON_MCE, 125 .name = RC_MAP_IMON_MCE,
126 } 126 }
127}; 127};
diff --git a/drivers/media/rc/keymaps/rc-rc6-mce.c b/drivers/media/rc/keymaps/rc-rc6-mce.c
index 753e43ec787b..ef4006fe4de0 100644
--- a/drivers/media/rc/keymaps/rc-rc6-mce.c
+++ b/drivers/media/rc/keymaps/rc-rc6-mce.c
@@ -97,7 +97,7 @@ static struct rc_map_list rc6_mce_map = {
97 .map = { 97 .map = {
98 .scan = rc6_mce, 98 .scan = rc6_mce,
99 .size = ARRAY_SIZE(rc6_mce), 99 .size = ARRAY_SIZE(rc6_mce),
100 .rc_type = RC_TYPE_RC6, 100 .rc_type = RC_TYPE_RC6_MCE,
101 .name = RC_MAP_RC6_MCE, 101 .name = RC_MAP_RC6_MCE,
102 } 102 }
103}; 103};
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c
index 850547fe711c..b2146cd99fd8 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1205,7 +1205,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir)
1205 rc->dev.parent = dev; 1205 rc->dev.parent = dev;
1206 rc->priv = ir; 1206 rc->priv = ir;
1207 rc->driver_type = RC_DRIVER_IR_RAW; 1207 rc->driver_type = RC_DRIVER_IR_RAW;
1208 rc->allowed_protos = RC_TYPE_ALL; 1208 rc->allowed_protos = RC_BIT_ALL;
1209 rc->timeout = MS_TO_NS(100); 1209 rc->timeout = MS_TO_NS(100);
1210 if (!ir->flags.no_tx) { 1210 if (!ir->flags.no_tx) {
1211 rc->s_tx_mask = mceusb_set_tx_mask; 1211 rc->s_tx_mask = mceusb_set_tx_mask;
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 2ea913a44ae8..0190dfc2ad41 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -1045,7 +1045,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
1045 /* Set up the rc device */ 1045 /* Set up the rc device */
1046 rdev->priv = nvt; 1046 rdev->priv = nvt;
1047 rdev->driver_type = RC_DRIVER_IR_RAW; 1047 rdev->driver_type = RC_DRIVER_IR_RAW;
1048 rdev->allowed_protos = RC_TYPE_ALL; 1048 rdev->allowed_protos = RC_BIT_ALL;
1049 rdev->open = nvt_open; 1049 rdev->open = nvt_open;
1050 rdev->close = nvt_close; 1050 rdev->close = nvt_close;
1051 rdev->tx_ir = nvt_tx_ir; 1051 rdev->tx_ir = nvt_tx_ir;
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index f9be68132c67..53d02827a472 100644
--- a/drivers/media/rc/rc-loopback.c
+++ b/drivers/media/rc/rc-loopback.c
@@ -195,7 +195,7 @@ static int __init loop_init(void)
195 rc->map_name = RC_MAP_EMPTY; 195 rc->map_name = RC_MAP_EMPTY;
196 rc->priv = &loopdev; 196 rc->priv = &loopdev;
197 rc->driver_type = RC_DRIVER_IR_RAW; 197 rc->driver_type = RC_DRIVER_IR_RAW;
198 rc->allowed_protos = RC_TYPE_ALL; 198 rc->allowed_protos = RC_BIT_ALL;
199 rc->timeout = 100 * 1000 * 1000; /* 100 ms */ 199 rc->timeout = 100 * 1000 * 1000; /* 100 ms */
200 rc->min_timeout = 1; 200 rc->min_timeout = 1;
201 rc->max_timeout = UINT_MAX; 201 rc->max_timeout = UINT_MAX;
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index cabc19c10515..601d1ac1c688 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -725,25 +725,36 @@ static struct class ir_input_class = {
725 .devnode = ir_devnode, 725 .devnode = ir_devnode,
726}; 726};
727 727
728/*
729 * These are the protocol textual descriptions that are
730 * used by the sysfs protocols file. Note that the order
731 * of the entries is relevant.
732 */
728static struct { 733static struct {
729 u64 type; 734 u64 type;
730 char *name; 735 char *name;
731} proto_names[] = { 736} proto_names[] = {
732 { RC_TYPE_UNKNOWN, "unknown" }, 737 { RC_BIT_NONE, "none" },
733 { RC_TYPE_RC5, "rc-5" }, 738 { RC_BIT_OTHER, "other" },
734 { RC_TYPE_NEC, "nec" }, 739 { RC_BIT_UNKNOWN, "unknown" },
735 { RC_TYPE_RC6, "rc-6" }, 740 { RC_BIT_RC5 |
736 { RC_TYPE_JVC, "jvc" }, 741 RC_BIT_RC5X, "rc-5" },
737 { RC_TYPE_SONY, "sony" }, 742 { RC_BIT_NEC, "nec" },
738 { RC_TYPE_RC5_SZ, "rc-5-sz" }, 743 { RC_BIT_RC6_0 |
739 { RC_TYPE_SANYO, "sanyo" }, 744 RC_BIT_RC6_6A_20 |
740 { RC_TYPE_MCE_KBD, "mce_kbd" }, 745 RC_BIT_RC6_6A_24 |
741 { RC_TYPE_LIRC, "lirc" }, 746 RC_BIT_RC6_6A_32 |
742 { RC_TYPE_OTHER, "other" }, 747 RC_BIT_RC6_MCE, "rc-6" },
748 { RC_BIT_JVC, "jvc" },
749 { RC_BIT_SONY12 |
750 RC_BIT_SONY15 |
751 RC_BIT_SONY20, "sony" },
752 { RC_BIT_RC5_SZ, "rc-5-sz" },
753 { RC_BIT_SANYO, "sanyo" },
754 { RC_BIT_MCE_KBD, "mce_kbd" },
755 { RC_BIT_LIRC, "lirc" },
743}; 756};
744 757
745#define PROTO_NONE "none"
746
747/** 758/**
748 * show_protocols() - shows the current IR protocol(s) 759 * show_protocols() - shows the current IR protocol(s)
749 * @device: the device descriptor 760 * @device: the device descriptor
@@ -790,6 +801,9 @@ static ssize_t show_protocols(struct device *device,
790 tmp += sprintf(tmp, "[%s] ", proto_names[i].name); 801 tmp += sprintf(tmp, "[%s] ", proto_names[i].name);
791 else if (allowed & proto_names[i].type) 802 else if (allowed & proto_names[i].type)
792 tmp += sprintf(tmp, "%s ", proto_names[i].name); 803 tmp += sprintf(tmp, "%s ", proto_names[i].name);
804
805 if (allowed & proto_names[i].type)
806 allowed &= ~proto_names[i].type;
793 } 807 }
794 808
795 if (tmp != buf) 809 if (tmp != buf)
@@ -867,26 +881,20 @@ static ssize_t store_protocols(struct device *device,
867 disable = false; 881 disable = false;
868 } 882 }
869 883
870 if (!enable && !disable && !strncasecmp(tmp, PROTO_NONE, sizeof(PROTO_NONE))) { 884 for (i = 0; i < ARRAY_SIZE(proto_names); i++) {
871 tmp += sizeof(PROTO_NONE); 885 if (!strcasecmp(tmp, proto_names[i].name)) {
872 mask = 0; 886 mask = proto_names[i].type;
873 count++; 887 break;
874 } else {
875 for (i = 0; i < ARRAY_SIZE(proto_names); i++) {
876 if (!strcasecmp(tmp, proto_names[i].name)) {
877 tmp += strlen(proto_names[i].name);
878 mask = proto_names[i].type;
879 break;
880 }
881 }
882 if (i == ARRAY_SIZE(proto_names)) {
883 IR_dprintk(1, "Unknown protocol: '%s'\n", tmp);
884 ret = -EINVAL;
885 goto out;
886 } 888 }
887 count++;
888 } 889 }
889 890
891 if (i == ARRAY_SIZE(proto_names)) {
892 IR_dprintk(1, "Unknown protocol: '%s'\n", tmp);
893 return -EINVAL;
894 }
895
896 count++;
897
890 if (enable) 898 if (enable)
891 type |= mask; 899 type |= mask;
892 else if (disable) 900 else if (disable)
@@ -902,7 +910,7 @@ static ssize_t store_protocols(struct device *device,
902 } 910 }
903 911
904 if (dev->change_protocol) { 912 if (dev->change_protocol) {
905 rc = dev->change_protocol(dev, type); 913 rc = dev->change_protocol(dev, &type);
906 if (rc < 0) { 914 if (rc < 0) {
907 IR_dprintk(1, "Error setting protocols to 0x%llx\n", 915 IR_dprintk(1, "Error setting protocols to 0x%llx\n",
908 (long long)type); 916 (long long)type);
@@ -1117,7 +1125,8 @@ int rc_register_device(struct rc_dev *dev)
1117 } 1125 }
1118 1126
1119 if (dev->change_protocol) { 1127 if (dev->change_protocol) {
1120 rc = dev->change_protocol(dev, rc_map->rc_type); 1128 u64 rc_type = (1 << rc_map->rc_type);
1129 rc = dev->change_protocol(dev, &rc_type);
1121 if (rc < 0) 1130 if (rc < 0)
1122 goto out_raw; 1131 goto out_raw;
1123 } 1132 }
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c
index 9f5a17bb5ef5..a8887aba9faf 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -1082,7 +1082,7 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3)
1082 rc->dev.parent = dev; 1082 rc->dev.parent = dev;
1083 rc->priv = rr3; 1083 rc->priv = rr3;
1084 rc->driver_type = RC_DRIVER_IR_RAW; 1084 rc->driver_type = RC_DRIVER_IR_RAW;
1085 rc->allowed_protos = RC_TYPE_ALL; 1085 rc->allowed_protos = RC_BIT_ALL;
1086 rc->timeout = US_TO_NS(2750); 1086 rc->timeout = US_TO_NS(2750);
1087 rc->tx_ir = redrat3_transmit_ir; 1087 rc->tx_ir = redrat3_transmit_ir;
1088 rc->s_tx_carrier = redrat3_set_tx_carrier; 1088 rc->s_tx_carrier = redrat3_set_tx_carrier;
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c
index d6f4bfe09391..c720f12f661e 100644
--- a/drivers/media/rc/streamzap.c
+++ b/drivers/media/rc/streamzap.c
@@ -322,7 +322,7 @@ static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz)
322 rdev->dev.parent = dev; 322 rdev->dev.parent = dev;
323 rdev->priv = sz; 323 rdev->priv = sz;
324 rdev->driver_type = RC_DRIVER_IR_RAW; 324 rdev->driver_type = RC_DRIVER_IR_RAW;
325 rdev->allowed_protos = RC_TYPE_ALL; 325 rdev->allowed_protos = RC_BIT_ALL;
326 rdev->driver_name = DRIVER_NAME; 326 rdev->driver_name = DRIVER_NAME;
327 rdev->map_name = RC_MAP_STREAMZAP; 327 rdev->map_name = RC_MAP_STREAMZAP;
328 328
diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c
index fef05235234a..f0921b5483eb 100644
--- a/drivers/media/rc/ttusbir.c
+++ b/drivers/media/rc/ttusbir.c
@@ -316,7 +316,7 @@ static int __devinit ttusbir_probe(struct usb_interface *intf,
316 usb_to_input_id(tt->udev, &rc->input_id); 316 usb_to_input_id(tt->udev, &rc->input_id);
317 rc->dev.parent = &intf->dev; 317 rc->dev.parent = &intf->dev;
318 rc->driver_type = RC_DRIVER_IR_RAW; 318 rc->driver_type = RC_DRIVER_IR_RAW;
319 rc->allowed_protos = RC_TYPE_ALL; 319 rc->allowed_protos = RC_BIT_ALL;
320 rc->priv = tt; 320 rc->priv = tt;
321 rc->driver_name = DRIVER_NAME; 321 rc->driver_name = DRIVER_NAME;
322 rc->map_name = RC_MAP_TT_1500; 322 rc->map_name = RC_MAP_TT_1500;
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 7c9b5f33113b..569d8863f439 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -1022,7 +1022,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
1022 data->dev->priv = data; 1022 data->dev->priv = data;
1023 data->dev->dev.parent = &device->dev; 1023 data->dev->dev.parent = &device->dev;
1024 data->dev->timeout = MS_TO_NS(100); 1024 data->dev->timeout = MS_TO_NS(100);
1025 data->dev->allowed_protos = RC_TYPE_ALL; 1025 data->dev->allowed_protos = RC_BIT_ALL;
1026 1026
1027 if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { 1027 if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
1028 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", 1028 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",