aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2014-02-28 18:17:03 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 12:24:39 -0400
commit1a1934fab0c920f0d3bceeb60c9fe2dae8a56be9 (patch)
tree9ce4f9817f35063ac8a4543dc5e0908805dc4e93 /drivers/media/rc
parentb8c7d915087c97a21fa415fa0e860e59739da202 (diff)
[media] rc: abstract access to allowed/enabled protocols
The allowed and enabled protocol masks need to be expanded to be per filter type in order to support wakeup filter protocol selection. To ease that process abstract access to the rc_dev::allowed_protos and rc_dev::enabled_protocols members with inline functions. Signed-off-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: Antti Seppälä <a.seppala@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.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.c4
-rw-r--r--drivers/media/rc/iguanair.c2
-rw-r--r--drivers/media/rc/imon.c7
-rw-r--r--drivers/media/rc/ir-jvc-decoder.c2
-rw-r--r--drivers/media/rc/ir-lirc-codec.c2
-rw-r--r--drivers/media/rc/ir-mce_kbd-decoder.c2
-rw-r--r--drivers/media/rc/ir-nec-decoder.c2
-rw-r--r--drivers/media/rc/ir-raw.c2
-rw-r--r--drivers/media/rc/ir-rc5-decoder.c6
-rw-r--r--drivers/media/rc/ir-rc5-sz-decoder.c2
-rw-r--r--drivers/media/rc/ir-rc6-decoder.c6
-rw-r--r--drivers/media/rc/ir-sanyo-decoder.c2
-rw-r--r--drivers/media/rc/ir-sharp-decoder.c2
-rw-r--r--drivers/media/rc/ir-sony-decoder.c10
-rw-r--r--drivers/media/rc/ite-cir.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/redrat3.c2
-rw-r--r--drivers/media/rc/st_rc.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, 38 insertions, 37 deletions
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 4d6a63fe6c5e..2df7c5516013 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_BIT_OTHER; 787 rc_set_allowed_protocols(rdev, 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 c1444f84717d..fc9d23f2ed3f 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -1059,7 +1059,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
1059 learning_mode_force = false; 1059 learning_mode_force = false;
1060 1060
1061 rdev->driver_type = RC_DRIVER_IR_RAW; 1061 rdev->driver_type = RC_DRIVER_IR_RAW;
1062 rdev->allowed_protos = RC_BIT_ALL; 1062 rc_set_allowed_protocols(rdev, RC_BIT_ALL);
1063 rdev->priv = dev; 1063 rdev->priv = dev;
1064 rdev->open = ene_open; 1064 rdev->open = ene_open;
1065 rdev->close = ene_close; 1065 rdev->close = ene_close;
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c
index d6fa441655d2..46b66e59438f 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_BIT_ALL; 544 rc_set_allowed_protocols(rdev, 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 80c611c2e8c2..29b5f89813b4 100644
--- a/drivers/media/rc/gpio-ir-recv.c
+++ b/drivers/media/rc/gpio-ir-recv.c
@@ -145,9 +145,9 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
145 rcdev->dev.parent = &pdev->dev; 145 rcdev->dev.parent = &pdev->dev;
146 rcdev->driver_name = GPIO_IR_DRIVER_NAME; 146 rcdev->driver_name = GPIO_IR_DRIVER_NAME;
147 if (pdata->allowed_protos) 147 if (pdata->allowed_protos)
148 rcdev->allowed_protos = pdata->allowed_protos; 148 rc_set_allowed_protocols(rcdev, pdata->allowed_protos);
149 else 149 else
150 rcdev->allowed_protos = RC_BIT_ALL; 150 rc_set_allowed_protocols(rcdev, RC_BIT_ALL);
151 rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY; 151 rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY;
152 152
153 gpio_dev->rcdev = rcdev; 153 gpio_dev->rcdev = rcdev;
diff --git a/drivers/media/rc/iguanair.c b/drivers/media/rc/iguanair.c
index a83519a6a158..627ddfd61980 100644
--- a/drivers/media/rc/iguanair.c
+++ b/drivers/media/rc/iguanair.c
@@ -495,7 +495,7 @@ static int iguanair_probe(struct usb_interface *intf,
495 usb_to_input_id(ir->udev, &rc->input_id); 495 usb_to_input_id(ir->udev, &rc->input_id);
496 rc->dev.parent = &intf->dev; 496 rc->dev.parent = &intf->dev;
497 rc->driver_type = RC_DRIVER_IR_RAW; 497 rc->driver_type = RC_DRIVER_IR_RAW;
498 rc->allowed_protos = RC_BIT_ALL; 498 rc_set_allowed_protocols(rc, RC_BIT_ALL);
499 rc->priv = ir; 499 rc->priv = ir;
500 rc->open = iguanair_open; 500 rc->open = iguanair_open;
501 rc->close = iguanair_close; 501 rc->close = iguanair_close;
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index 822b9f47ca72..6f24e77b1488 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -1017,7 +1017,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 *rc_type)
1017 unsigned char ir_proto_packet[] = { 1017 unsigned char ir_proto_packet[] = {
1018 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; 1018 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 };
1019 1019
1020 if (*rc_type && !(*rc_type & rc->allowed_protos)) 1020 if (*rc_type && !rc_protocols_allowed(rc, *rc_type))
1021 dev_warn(dev, "Looks like you're trying to use an IR protocol " 1021 dev_warn(dev, "Looks like you're trying to use an IR protocol "
1022 "this device does not support\n"); 1022 "this device does not support\n");
1023 1023
@@ -1867,7 +1867,8 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
1867 1867
1868 rdev->priv = ictx; 1868 rdev->priv = ictx;
1869 rdev->driver_type = RC_DRIVER_SCANCODE; 1869 rdev->driver_type = RC_DRIVER_SCANCODE;
1870 rdev->allowed_protos = RC_BIT_OTHER | RC_BIT_RC6_MCE; /* iMON PAD or MCE */ 1870 /* iMON PAD or MCE */
1871 rc_set_allowed_protocols(rdev, RC_BIT_OTHER | RC_BIT_RC6_MCE);
1871 rdev->change_protocol = imon_ir_change_protocol; 1872 rdev->change_protocol = imon_ir_change_protocol;
1872 rdev->driver_name = MOD_NAME; 1873 rdev->driver_name = MOD_NAME;
1873 1874
@@ -1880,7 +1881,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx)
1880 1881
1881 if (ictx->product == 0xffdc) { 1882 if (ictx->product == 0xffdc) {
1882 imon_get_ffdc_type(ictx); 1883 imon_get_ffdc_type(ictx);
1883 rdev->allowed_protos = ictx->rc_type; 1884 rc_set_allowed_protocols(rdev, ictx->rc_type);
1884 } 1885 }
1885 1886
1886 imon_set_display_type(ictx); 1887 imon_set_display_type(ictx);
diff --git a/drivers/media/rc/ir-jvc-decoder.c b/drivers/media/rc/ir-jvc-decoder.c
index 3948138ca870..4ea62a1dcfda 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->enabled_protocols & RC_BIT_JVC)) 50 if (!rc_protocols_enabled(dev, RC_BIT_JVC))
51 return 0; 51 return 0;
52 52
53 if (!is_timing_event(ev)) { 53 if (!is_timing_event(ev)) {
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index ed2c8a1ed8ca..d731da6c414d 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->enabled_protocols & RC_BIT_LIRC)) 38 if (!rc_protocols_enabled(dev, 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)
diff --git a/drivers/media/rc/ir-mce_kbd-decoder.c b/drivers/media/rc/ir-mce_kbd-decoder.c
index 9f3c9b59f30c..0c55f794c8cf 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->enabled_protocols & RC_BIT_MCE_KBD)) 219 if (!rc_protocols_enabled(dev, RC_BIT_MCE_KBD))
220 return 0; 220 return 0;
221 221
222 if (!is_timing_event(ev)) { 222 if (!is_timing_event(ev)) {
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c
index e687a4247052..9de1791d2494 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->enabled_protocols & RC_BIT_NEC)) 55 if (!rc_protocols_enabled(dev, RC_BIT_NEC))
56 return 0; 56 return 0;
57 57
58 if (!is_timing_event(ev)) { 58 if (!is_timing_event(ev)) {
diff --git a/drivers/media/rc/ir-raw.c b/drivers/media/rc/ir-raw.c
index f0656fa1a01a..763c9d131d0f 100644
--- a/drivers/media/rc/ir-raw.c
+++ b/drivers/media/rc/ir-raw.c
@@ -256,7 +256,7 @@ int ir_raw_event_register(struct rc_dev *dev)
256 return -ENOMEM; 256 return -ENOMEM;
257 257
258 dev->raw->dev = dev; 258 dev->raw->dev = dev;
259 dev->enabled_protocols = ~0; 259 rc_set_enabled_protocols(dev, ~0);
260 rc = kfifo_alloc(&dev->raw->kfifo, 260 rc = kfifo_alloc(&dev->raw->kfifo,
261 sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE, 261 sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE,
262 GFP_KERNEL); 262 GFP_KERNEL);
diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c
index 1085e173270a..4295d9b250c8 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -52,7 +52,7 @@ 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->enabled_protocols & (RC_BIT_RC5 | RC_BIT_RC5X))) 55 if (!rc_protocols_enabled(dev, 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)) {
@@ -128,7 +128,7 @@ 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->enabled_protocols & RC_BIT_RC5X)) { 131 if (!rc_protocols_enabled(dev, RC_BIT_RC5X)) {
132 data->state = STATE_INACTIVE; 132 data->state = STATE_INACTIVE;
133 return 0; 133 return 0;
134 } 134 }
@@ -145,7 +145,7 @@ again:
145 } else { 145 } else {
146 /* RC5 */ 146 /* RC5 */
147 u8 command, system; 147 u8 command, system;
148 if (!(dev->enabled_protocols & RC_BIT_RC5)) { 148 if (!rc_protocols_enabled(dev, RC_BIT_RC5)) {
149 data->state = STATE_INACTIVE; 149 data->state = STATE_INACTIVE;
150 return 0; 150 return 0;
151 } 151 }
diff --git a/drivers/media/rc/ir-rc5-sz-decoder.c b/drivers/media/rc/ir-rc5-sz-decoder.c
index 984e5b9f5bc3..dc18b7434db8 100644
--- a/drivers/media/rc/ir-rc5-sz-decoder.c
+++ b/drivers/media/rc/ir-rc5-sz-decoder.c
@@ -48,7 +48,7 @@ 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->enabled_protocols & RC_BIT_RC5_SZ)) 51 if (!rc_protocols_enabled(dev, RC_BIT_RC5_SZ))
52 return 0; 52 return 0;
53 53
54 if (!is_timing_event(ev)) { 54 if (!is_timing_event(ev)) {
diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c
index 7cba7d33a3fa..cfbd64e3999c 100644
--- a/drivers/media/rc/ir-rc6-decoder.c
+++ b/drivers/media/rc/ir-rc6-decoder.c
@@ -89,9 +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->enabled_protocols & 92 if (!rc_protocols_enabled(dev, RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 |
93 (RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | 93 RC_BIT_RC6_6A_24 | RC_BIT_RC6_6A_32 |
94 RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE))) 94 RC_BIT_RC6_MCE))
95 return 0; 95 return 0;
96 96
97 if (!is_timing_event(ev)) { 97 if (!is_timing_event(ev)) {
diff --git a/drivers/media/rc/ir-sanyo-decoder.c b/drivers/media/rc/ir-sanyo-decoder.c
index e1351ed61629..eb715f04dc27 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->enabled_protocols & RC_BIT_SANYO)) 61 if (!rc_protocols_enabled(dev, RC_BIT_SANYO))
62 return 0; 62 return 0;
63 63
64 if (!is_timing_event(ev)) { 64 if (!is_timing_event(ev)) {
diff --git a/drivers/media/rc/ir-sharp-decoder.c b/drivers/media/rc/ir-sharp-decoder.c
index 4895bc752f97..66d20394ceaa 100644
--- a/drivers/media/rc/ir-sharp-decoder.c
+++ b/drivers/media/rc/ir-sharp-decoder.c
@@ -48,7 +48,7 @@ static int ir_sharp_decode(struct rc_dev *dev, struct ir_raw_event ev)
48 struct sharp_dec *data = &dev->raw->sharp; 48 struct sharp_dec *data = &dev->raw->sharp;
49 u32 msg, echo, address, command, scancode; 49 u32 msg, echo, address, command, scancode;
50 50
51 if (!(dev->enabled_protocols & RC_BIT_SHARP)) 51 if (!rc_protocols_enabled(dev, RC_BIT_SHARP))
52 return 0; 52 return 0;
53 53
54 if (!is_timing_event(ev)) { 54 if (!is_timing_event(ev)) {
diff --git a/drivers/media/rc/ir-sony-decoder.c b/drivers/media/rc/ir-sony-decoder.c
index 29ab9c2db060..599c19a73360 100644
--- a/drivers/media/rc/ir-sony-decoder.c
+++ b/drivers/media/rc/ir-sony-decoder.c
@@ -45,8 +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->enabled_protocols & 48 if (!rc_protocols_enabled(dev, RC_BIT_SONY12 | RC_BIT_SONY15 |
49 (RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20))) 49 RC_BIT_SONY20))
50 return 0; 50 return 0;
51 51
52 if (!is_timing_event(ev)) { 52 if (!is_timing_event(ev)) {
@@ -124,7 +124,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
124 124
125 switch (data->count) { 125 switch (data->count) {
126 case 12: 126 case 12:
127 if (!(dev->enabled_protocols & RC_BIT_SONY12)) { 127 if (!rc_protocols_enabled(dev, RC_BIT_SONY12)) {
128 data->state = STATE_INACTIVE; 128 data->state = STATE_INACTIVE;
129 return 0; 129 return 0;
130 } 130 }
@@ -133,7 +133,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
133 function = bitrev8((data->bits >> 4) & 0xFE); 133 function = bitrev8((data->bits >> 4) & 0xFE);
134 break; 134 break;
135 case 15: 135 case 15:
136 if (!(dev->enabled_protocols & RC_BIT_SONY15)) { 136 if (!rc_protocols_enabled(dev, RC_BIT_SONY15)) {
137 data->state = STATE_INACTIVE; 137 data->state = STATE_INACTIVE;
138 return 0; 138 return 0;
139 } 139 }
@@ -142,7 +142,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev)
142 function = bitrev8((data->bits >> 7) & 0xFE); 142 function = bitrev8((data->bits >> 7) & 0xFE);
143 break; 143 break;
144 case 20: 144 case 20:
145 if (!(dev->enabled_protocols & RC_BIT_SONY20)) { 145 if (!rc_protocols_enabled(dev, RC_BIT_SONY20)) {
146 data->state = STATE_INACTIVE; 146 data->state = STATE_INACTIVE;
147 return 0; 147 return 0;
148 } 148 }
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 63b42252166a..ab24cc6d3655 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_BIT_ALL; 1566 rc_set_allowed_protocols(rdev, 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/mceusb.c b/drivers/media/rc/mceusb.c
index c01b4c1f64ca..5d8f3d40d820 100644
--- a/drivers/media/rc/mceusb.c
+++ b/drivers/media/rc/mceusb.c
@@ -1211,7 +1211,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir)
1211 rc->dev.parent = dev; 1211 rc->dev.parent = dev;
1212 rc->priv = ir; 1212 rc->priv = ir;
1213 rc->driver_type = RC_DRIVER_IR_RAW; 1213 rc->driver_type = RC_DRIVER_IR_RAW;
1214 rc->allowed_protos = RC_BIT_ALL; 1214 rc_set_allowed_protocols(rc, RC_BIT_ALL);
1215 rc->timeout = MS_TO_NS(100); 1215 rc->timeout = MS_TO_NS(100);
1216 if (!ir->flags.no_tx) { 1216 if (!ir->flags.no_tx) {
1217 rc->s_tx_mask = mceusb_set_tx_mask; 1217 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 b81325d7948f..d244e1a83f43 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -1044,7 +1044,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
1044 /* Set up the rc device */ 1044 /* Set up the rc device */
1045 rdev->priv = nvt; 1045 rdev->priv = nvt;
1046 rdev->driver_type = RC_DRIVER_IR_RAW; 1046 rdev->driver_type = RC_DRIVER_IR_RAW;
1047 rdev->allowed_protos = RC_BIT_ALL; 1047 rc_set_allowed_protocols(rdev, RC_BIT_ALL);
1048 rdev->open = nvt_open; 1048 rdev->open = nvt_open;
1049 rdev->close = nvt_close; 1049 rdev->close = nvt_close;
1050 rdev->tx_ir = nvt_tx_ir; 1050 rdev->tx_ir = nvt_tx_ir;
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index 53d02827a472..0a88e0cf964f 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_BIT_ALL; 198 rc_set_allowed_protocols(rc, 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/redrat3.c b/drivers/media/rc/redrat3.c
index a5d4f883d053..47cd373e2295 100644
--- a/drivers/media/rc/redrat3.c
+++ b/drivers/media/rc/redrat3.c
@@ -922,7 +922,7 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3)
922 rc->dev.parent = dev; 922 rc->dev.parent = dev;
923 rc->priv = rr3; 923 rc->priv = rr3;
924 rc->driver_type = RC_DRIVER_IR_RAW; 924 rc->driver_type = RC_DRIVER_IR_RAW;
925 rc->allowed_protos = RC_BIT_ALL; 925 rc_set_allowed_protocols(rc, RC_BIT_ALL);
926 rc->timeout = US_TO_NS(2750); 926 rc->timeout = US_TO_NS(2750);
927 rc->tx_ir = redrat3_transmit_ir; 927 rc->tx_ir = redrat3_transmit_ir;
928 rc->s_tx_carrier = redrat3_set_tx_carrier; 928 rc->s_tx_carrier = redrat3_set_tx_carrier;
diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index 8f0cddb9e8f2..22e4c1f28ab4 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -287,7 +287,7 @@ static int st_rc_probe(struct platform_device *pdev)
287 st_rc_hardware_init(rc_dev); 287 st_rc_hardware_init(rc_dev);
288 288
289 rdev->driver_type = RC_DRIVER_IR_RAW; 289 rdev->driver_type = RC_DRIVER_IR_RAW;
290 rdev->allowed_protos = RC_BIT_ALL; 290 rc_set_allowed_protocols(rdev, RC_BIT_ALL);
291 /* rx sampling rate is 10Mhz */ 291 /* rx sampling rate is 10Mhz */
292 rdev->rx_resolution = 100; 292 rdev->rx_resolution = 100;
293 rdev->timeout = US_TO_NS(MAX_SYMB_TIME); 293 rdev->timeout = US_TO_NS(MAX_SYMB_TIME);
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c
index d7b11e6a9982..f4e0bc3d382c 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_BIT_ALL; 325 rc_set_allowed_protocols(rdev, 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 d8de2056a4f6..c5be38e2a2fe 100644
--- a/drivers/media/rc/ttusbir.c
+++ b/drivers/media/rc/ttusbir.c
@@ -318,7 +318,7 @@ static int ttusbir_probe(struct usb_interface *intf,
318 usb_to_input_id(tt->udev, &rc->input_id); 318 usb_to_input_id(tt->udev, &rc->input_id);
319 rc->dev.parent = &intf->dev; 319 rc->dev.parent = &intf->dev;
320 rc->driver_type = RC_DRIVER_IR_RAW; 320 rc->driver_type = RC_DRIVER_IR_RAW;
321 rc->allowed_protos = RC_BIT_ALL; 321 rc_set_allowed_protocols(rc, RC_BIT_ALL);
322 rc->priv = tt; 322 rc->priv = tt;
323 rc->driver_name = DRIVER_NAME; 323 rc->driver_name = DRIVER_NAME;
324 rc->map_name = RC_MAP_TT_1500; 324 rc->map_name = RC_MAP_TT_1500;
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 904baf4eec28..a8b981f5ce2e 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -1082,7 +1082,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
1082 data->dev->dev.parent = &device->dev; 1082 data->dev->dev.parent = &device->dev;
1083 data->dev->timeout = MS_TO_NS(100); 1083 data->dev->timeout = MS_TO_NS(100);
1084 data->dev->rx_resolution = US_TO_NS(2); 1084 data->dev->rx_resolution = US_TO_NS(2);
1085 data->dev->allowed_protos = RC_BIT_ALL; 1085 rc_set_allowed_protocols(data->dev, RC_BIT_ALL);
1086 1086
1087 err = rc_register_device(data->dev); 1087 err = rc_register_device(data->dev);
1088 if (err) 1088 if (err)