diff options
author | David Härdeman <david@hardeman.nu> | 2014-04-03 19:32:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-25 18:10:43 -0400 |
commit | c5540fbb9de39ceec108a889133664a887c2f55a (patch) | |
tree | 92d1523fa4ab99fc27d14dcd3ee00627eeb8a346 /drivers/media/rc | |
parent | da6e162d6a4607362f8478c715c797d84d449f8b (diff) |
[media] rc-core: remove protocol arrays
The basic API of rc-core used to be:
dev = rc_allocate_device();
dev->x = a;
dev->y = b;
dev->z = c;
rc_register_device();
which is a pretty common pattern in the kernel, after the introduction of
protocol arrays the API looks something like:
dev = rc_allocate_device();
dev->x = a;
rc_set_allowed_protocols(dev, RC_BIT_X);
dev->z = c;
rc_register_device();
There's no real need for the protocols to be an array, so change it
back to be consistent (and in preparation for the following patches).
[m.chehab@samsung.com: added missing changes at some files]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/rc')
29 files changed, 61 insertions, 62 deletions
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 8730b32a067c..2e1335306eb3 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 | rc_set_allowed_protocols(rdev, RC_BIT_OTHER); | 787 | rdev->allowed_protocols = 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 fc9d23f2ed3f..d16d9b496b92 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 | rc_set_allowed_protocols(rdev, RC_BIT_ALL); | 1062 | rdev->allowed_protocols = 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 46b66e59438f..f000faf7340b 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 | rc_set_allowed_protocols(rdev, RC_BIT_ALL); | 544 | rdev->allowed_protocols = 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 29b5f89813b4..59853085bc88 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 | rc_set_allowed_protocols(rcdev, pdata->allowed_protos); | 148 | rcdev->allowed_protocols = pdata->allowed_protos; |
149 | else | 149 | else |
150 | rc_set_allowed_protocols(rcdev, RC_BIT_ALL); | 150 | rcdev->allowed_protocols = 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 627ddfd61980..ee60e17fba05 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_set_allowed_protocols(rc, RC_BIT_ALL); | 498 | rc->allowed_protocols = 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/img-ir/img-ir-hw.c b/drivers/media/rc/img-ir/img-ir-hw.c index b0ec55f52228..bfb282a714e8 100644 --- a/drivers/media/rc/img-ir/img-ir-hw.c +++ b/drivers/media/rc/img-ir/img-ir-hw.c | |||
@@ -556,8 +556,8 @@ static void img_ir_set_decoder(struct img_ir_priv *priv, | |||
556 | hw->mode = IMG_IR_M_NORMAL; | 556 | hw->mode = IMG_IR_M_NORMAL; |
557 | 557 | ||
558 | /* clear the wakeup scancode filter */ | 558 | /* clear the wakeup scancode filter */ |
559 | rdev->scancode_filters[RC_FILTER_WAKEUP].data = 0; | 559 | rdev->scancode_wakeup_filter.data = 0; |
560 | rdev->scancode_filters[RC_FILTER_WAKEUP].mask = 0; | 560 | rdev->scancode_wakeup_filter.mask = 0; |
561 | 561 | ||
562 | /* clear raw filters */ | 562 | /* clear raw filters */ |
563 | _img_ir_set_filter(priv, NULL); | 563 | _img_ir_set_filter(priv, NULL); |
@@ -661,8 +661,8 @@ success: | |||
661 | wakeup_protocols = *ir_type; | 661 | wakeup_protocols = *ir_type; |
662 | if (!hw->decoder || !hw->decoder->filter) | 662 | if (!hw->decoder || !hw->decoder->filter) |
663 | wakeup_protocols = 0; | 663 | wakeup_protocols = 0; |
664 | rc_set_allowed_wakeup_protocols(rdev, wakeup_protocols); | 664 | rdev->allowed_wakeup_protocols = wakeup_protocols; |
665 | rc_set_enabled_wakeup_protocols(rdev, wakeup_protocols); | 665 | rdev->enabled_wakeup_protocols = wakeup_protocols; |
666 | return 0; | 666 | return 0; |
667 | } | 667 | } |
668 | 668 | ||
@@ -676,9 +676,9 @@ static void img_ir_set_protocol(struct img_ir_priv *priv, u64 proto) | |||
676 | spin_unlock_irq(&rdev->rc_map.lock); | 676 | spin_unlock_irq(&rdev->rc_map.lock); |
677 | 677 | ||
678 | mutex_lock(&rdev->lock); | 678 | mutex_lock(&rdev->lock); |
679 | rc_set_enabled_protocols(rdev, proto); | 679 | rdev->enabled_protocols = proto; |
680 | rc_set_allowed_wakeup_protocols(rdev, proto); | 680 | rdev->allowed_wakeup_protocols = proto; |
681 | rc_set_enabled_wakeup_protocols(rdev, proto); | 681 | rdev->enabled_wakeup_protocols = proto; |
682 | mutex_unlock(&rdev->lock); | 682 | mutex_unlock(&rdev->lock); |
683 | } | 683 | } |
684 | 684 | ||
@@ -1003,7 +1003,7 @@ int img_ir_probe_hw(struct img_ir_priv *priv) | |||
1003 | } | 1003 | } |
1004 | rdev->priv = priv; | 1004 | rdev->priv = priv; |
1005 | rdev->map_name = RC_MAP_EMPTY; | 1005 | rdev->map_name = RC_MAP_EMPTY; |
1006 | rc_set_allowed_protocols(rdev, img_ir_allowed_protos(priv)); | 1006 | rdev->allowed_protocols = img_ir_allowed_protos(priv); |
1007 | rdev->input_name = "IMG Infrared Decoder"; | 1007 | rdev->input_name = "IMG Infrared Decoder"; |
1008 | rdev->s_filter = img_ir_set_normal_filter; | 1008 | rdev->s_filter = img_ir_set_normal_filter; |
1009 | rdev->s_wakeup_filter = img_ir_set_wakeup_filter; | 1009 | rdev->s_wakeup_filter = img_ir_set_wakeup_filter; |
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index eb37f2622364..ac05c364f663 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_protocols_allowed(rc, *rc_type)) | 1020 | if (*rc_type && !(*rc_type & rc->allowed_protocols)) |
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 | ||
@@ -1870,8 +1870,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) | |||
1870 | 1870 | ||
1871 | rdev->priv = ictx; | 1871 | rdev->priv = ictx; |
1872 | rdev->driver_type = RC_DRIVER_SCANCODE; | 1872 | rdev->driver_type = RC_DRIVER_SCANCODE; |
1873 | /* iMON PAD or MCE */ | 1873 | rdev->allowed_protocols = RC_BIT_OTHER | RC_BIT_RC6_MCE; /* iMON PAD or MCE */ |
1874 | rc_set_allowed_protocols(rdev, RC_BIT_OTHER | RC_BIT_RC6_MCE); | ||
1875 | rdev->change_protocol = imon_ir_change_protocol; | 1874 | rdev->change_protocol = imon_ir_change_protocol; |
1876 | rdev->driver_name = MOD_NAME; | 1875 | rdev->driver_name = MOD_NAME; |
1877 | 1876 | ||
@@ -1884,7 +1883,7 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) | |||
1884 | 1883 | ||
1885 | if (ictx->product == 0xffdc) { | 1884 | if (ictx->product == 0xffdc) { |
1886 | imon_get_ffdc_type(ictx); | 1885 | imon_get_ffdc_type(ictx); |
1887 | rc_set_allowed_protocols(rdev, ictx->rc_type); | 1886 | rdev->allowed_protocols = ictx->rc_type; |
1888 | } | 1887 | } |
1889 | 1888 | ||
1890 | imon_set_display_type(ictx); | 1889 | imon_set_display_type(ictx); |
diff --git a/drivers/media/rc/ir-jvc-decoder.c b/drivers/media/rc/ir-jvc-decoder.c index 7b79eca83449..30bcf188d377 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 (!rc_protocols_enabled(dev, RC_BIT_JVC)) | 50 | if (!(dev->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)) { |
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c index d731da6c414d..ed2c8a1ed8ca 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 (!rc_protocols_enabled(dev, RC_BIT_LIRC)) | 38 | if (!(dev->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) |
diff --git a/drivers/media/rc/ir-mce_kbd-decoder.c b/drivers/media/rc/ir-mce_kbd-decoder.c index 0c55f794c8cf..9f3c9b59f30c 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 (!rc_protocols_enabled(dev, RC_BIT_MCE_KBD)) | 219 | if (!(dev->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)) { |
diff --git a/drivers/media/rc/ir-nec-decoder.c b/drivers/media/rc/ir-nec-decoder.c index c4333d5c0046..7b81fec0820f 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 (!rc_protocols_enabled(dev, RC_BIT_NEC)) | 55 | if (!(dev->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)) { |
diff --git a/drivers/media/rc/ir-raw.c b/drivers/media/rc/ir-raw.c index c08718e17671..c72f57cebfd2 100644 --- a/drivers/media/rc/ir-raw.c +++ b/drivers/media/rc/ir-raw.c | |||
@@ -262,7 +262,7 @@ int ir_raw_event_register(struct rc_dev *dev) | |||
262 | return -ENOMEM; | 262 | return -ENOMEM; |
263 | 263 | ||
264 | dev->raw->dev = dev; | 264 | dev->raw->dev = dev; |
265 | rc_set_enabled_protocols(dev, ~0); | 265 | dev->enabled_protocols = ~0; |
266 | dev->change_protocol = change_protocol; | 266 | dev->change_protocol = change_protocol; |
267 | rc = kfifo_alloc(&dev->raw->kfifo, | 267 | rc = kfifo_alloc(&dev->raw->kfifo, |
268 | sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE, | 268 | sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE, |
diff --git a/drivers/media/rc/ir-rc5-decoder.c b/drivers/media/rc/ir-rc5-decoder.c index 3d38cbce5667..04ce42fa9eec 100644 --- a/drivers/media/rc/ir-rc5-decoder.c +++ b/drivers/media/rc/ir-rc5-decoder.c | |||
@@ -53,7 +53,7 @@ static int ir_rc5_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
53 | u32 scancode; | 53 | u32 scancode; |
54 | enum rc_type protocol; | 54 | enum rc_type protocol; |
55 | 55 | ||
56 | if (!rc_protocols_enabled(dev, RC_BIT_RC5 | RC_BIT_RC5X)) | 56 | if (!(dev->enabled_protocols & (RC_BIT_RC5 | RC_BIT_RC5X))) |
57 | return 0; | 57 | return 0; |
58 | 58 | ||
59 | if (!is_timing_event(ev)) { | 59 | if (!is_timing_event(ev)) { |
@@ -129,7 +129,7 @@ again: | |||
129 | if (data->wanted_bits == RC5X_NBITS) { | 129 | if (data->wanted_bits == RC5X_NBITS) { |
130 | /* RC5X */ | 130 | /* RC5X */ |
131 | u8 xdata, command, system; | 131 | u8 xdata, command, system; |
132 | if (!rc_protocols_enabled(dev, RC_BIT_RC5X)) { | 132 | if (!(dev->enabled_protocols & RC_BIT_RC5X)) { |
133 | data->state = STATE_INACTIVE; | 133 | data->state = STATE_INACTIVE; |
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
@@ -147,7 +147,7 @@ again: | |||
147 | } else { | 147 | } else { |
148 | /* RC5 */ | 148 | /* RC5 */ |
149 | u8 command, system; | 149 | u8 command, system; |
150 | if (!rc_protocols_enabled(dev, RC_BIT_RC5)) { | 150 | if (!(dev->enabled_protocols & RC_BIT_RC5)) { |
151 | data->state = STATE_INACTIVE; | 151 | data->state = STATE_INACTIVE; |
152 | return 0; | 152 | return 0; |
153 | } | 153 | } |
diff --git a/drivers/media/rc/ir-rc5-sz-decoder.c b/drivers/media/rc/ir-rc5-sz-decoder.c index 85c771112cf5..771e9fcbd770 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 (!rc_protocols_enabled(dev, RC_BIT_RC5_SZ)) | 51 | if (!(dev->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)) { |
diff --git a/drivers/media/rc/ir-rc6-decoder.c b/drivers/media/rc/ir-rc6-decoder.c index 1dc97a7b92a5..f1f098e22f7e 100644 --- a/drivers/media/rc/ir-rc6-decoder.c +++ b/drivers/media/rc/ir-rc6-decoder.c | |||
@@ -90,9 +90,9 @@ static int ir_rc6_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
90 | u8 toggle; | 90 | u8 toggle; |
91 | enum rc_type protocol; | 91 | enum rc_type protocol; |
92 | 92 | ||
93 | if (!rc_protocols_enabled(dev, RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | | 93 | if (!(dev->enabled_protocols & |
94 | RC_BIT_RC6_6A_24 | RC_BIT_RC6_6A_32 | | 94 | (RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | |
95 | RC_BIT_RC6_MCE)) | 95 | RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE))) |
96 | return 0; | 96 | return 0; |
97 | 97 | ||
98 | if (!is_timing_event(ev)) { | 98 | if (!is_timing_event(ev)) { |
diff --git a/drivers/media/rc/ir-sanyo-decoder.c b/drivers/media/rc/ir-sanyo-decoder.c index 5f7702261d23..ad1dc6ae21fc 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 (!rc_protocols_enabled(dev, RC_BIT_SANYO)) | 61 | if (!(dev->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)) { |
diff --git a/drivers/media/rc/ir-sharp-decoder.c b/drivers/media/rc/ir-sharp-decoder.c index c8f251939143..b7acdbae8159 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 (!rc_protocols_enabled(dev, RC_BIT_SHARP)) | 51 | if (!(dev->enabled_protocols & 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 f485f9fe1e90..d12dc3da5931 100644 --- a/drivers/media/rc/ir-sony-decoder.c +++ b/drivers/media/rc/ir-sony-decoder.c | |||
@@ -46,8 +46,8 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
46 | u32 scancode; | 46 | u32 scancode; |
47 | u8 device, subdevice, function; | 47 | u8 device, subdevice, function; |
48 | 48 | ||
49 | if (!rc_protocols_enabled(dev, RC_BIT_SONY12 | RC_BIT_SONY15 | | 49 | if (!(dev->enabled_protocols & |
50 | RC_BIT_SONY20)) | 50 | (RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20))) |
51 | return 0; | 51 | return 0; |
52 | 52 | ||
53 | if (!is_timing_event(ev)) { | 53 | if (!is_timing_event(ev)) { |
@@ -125,7 +125,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
125 | 125 | ||
126 | switch (data->count) { | 126 | switch (data->count) { |
127 | case 12: | 127 | case 12: |
128 | if (!rc_protocols_enabled(dev, RC_BIT_SONY12)) { | 128 | if (!(dev->enabled_protocols & RC_BIT_SONY12)) { |
129 | data->state = STATE_INACTIVE; | 129 | data->state = STATE_INACTIVE; |
130 | return 0; | 130 | return 0; |
131 | } | 131 | } |
@@ -135,7 +135,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
135 | protocol = RC_TYPE_SONY12; | 135 | protocol = RC_TYPE_SONY12; |
136 | break; | 136 | break; |
137 | case 15: | 137 | case 15: |
138 | if (!rc_protocols_enabled(dev, RC_BIT_SONY15)) { | 138 | if (!(dev->enabled_protocols & RC_BIT_SONY15)) { |
139 | data->state = STATE_INACTIVE; | 139 | data->state = STATE_INACTIVE; |
140 | return 0; | 140 | return 0; |
141 | } | 141 | } |
@@ -145,7 +145,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
145 | protocol = RC_TYPE_SONY15; | 145 | protocol = RC_TYPE_SONY15; |
146 | break; | 146 | break; |
147 | case 20: | 147 | case 20: |
148 | if (!rc_protocols_enabled(dev, RC_BIT_SONY20)) { | 148 | if (!(dev->enabled_protocols & RC_BIT_SONY20)) { |
149 | data->state = STATE_INACTIVE; | 149 | data->state = STATE_INACTIVE; |
150 | return 0; | 150 | return 0; |
151 | } | 151 | } |
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index ab24cc6d3655..32fd5f4614c8 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 | rc_set_allowed_protocols(rdev, RC_BIT_ALL); | 1566 | rdev->allowed_protocols = 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 d5c1df3c9db1..b1be81fc6bd7 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c | |||
@@ -1219,7 +1219,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir) | |||
1219 | rc->dev.parent = dev; | 1219 | rc->dev.parent = dev; |
1220 | rc->priv = ir; | 1220 | rc->priv = ir; |
1221 | rc->driver_type = RC_DRIVER_IR_RAW; | 1221 | rc->driver_type = RC_DRIVER_IR_RAW; |
1222 | rc_set_allowed_protocols(rc, RC_BIT_ALL); | 1222 | rc->allowed_protocols = RC_BIT_ALL; |
1223 | rc->timeout = MS_TO_NS(100); | 1223 | rc->timeout = MS_TO_NS(100); |
1224 | if (!ir->flags.no_tx) { | 1224 | if (!ir->flags.no_tx) { |
1225 | rc->s_tx_mask = mceusb_set_tx_mask; | 1225 | 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 d244e1a83f43..8c6008f81332 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 | rc_set_allowed_protocols(rdev, RC_BIT_ALL); | 1047 | rdev->allowed_protocols = 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 0a88e0cf964f..63dace8198b0 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_set_allowed_protocols(rc, RC_BIT_ALL); | 198 | rc->allowed_protocols = 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 d5bfe6442459..c3fb8f8f192b 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
@@ -857,14 +857,14 @@ static ssize_t show_protocols(struct device *device, | |||
857 | mutex_lock(&dev->lock); | 857 | mutex_lock(&dev->lock); |
858 | 858 | ||
859 | if (fattr->type == RC_FILTER_NORMAL) { | 859 | if (fattr->type == RC_FILTER_NORMAL) { |
860 | enabled = dev->enabled_protocols[RC_FILTER_NORMAL]; | 860 | enabled = dev->enabled_protocols; |
861 | if (dev->raw) | 861 | if (dev->raw) |
862 | allowed = ir_raw_get_allowed_protocols(); | 862 | allowed = ir_raw_get_allowed_protocols(); |
863 | else | 863 | else |
864 | allowed = dev->allowed_protocols[RC_FILTER_NORMAL]; | 864 | allowed = dev->allowed_protocols; |
865 | } else { | 865 | } else { |
866 | enabled = dev->enabled_protocols[RC_FILTER_WAKEUP]; | 866 | enabled = dev->enabled_wakeup_protocols; |
867 | allowed = dev->allowed_protocols[RC_FILTER_WAKEUP]; | 867 | allowed = dev->allowed_wakeup_protocols; |
868 | } | 868 | } |
869 | 869 | ||
870 | mutex_unlock(&dev->lock); | 870 | mutex_unlock(&dev->lock); |
@@ -989,15 +989,15 @@ static ssize_t store_protocols(struct device *device, | |||
989 | 989 | ||
990 | if (fattr->type == RC_FILTER_NORMAL) { | 990 | if (fattr->type == RC_FILTER_NORMAL) { |
991 | IR_dprintk(1, "Normal protocol change requested\n"); | 991 | IR_dprintk(1, "Normal protocol change requested\n"); |
992 | current_protocols = &dev->enabled_protocols[RC_FILTER_NORMAL]; | 992 | current_protocols = &dev->enabled_protocols; |
993 | change_protocol = dev->change_protocol; | 993 | change_protocol = dev->change_protocol; |
994 | filter = &dev->scancode_filters[RC_FILTER_NORMAL]; | 994 | filter = &dev->scancode_filter; |
995 | set_filter = dev->s_filter; | 995 | set_filter = dev->s_filter; |
996 | } else { | 996 | } else { |
997 | IR_dprintk(1, "Wakeup protocol change requested\n"); | 997 | IR_dprintk(1, "Wakeup protocol change requested\n"); |
998 | current_protocols = &dev->enabled_protocols[RC_FILTER_WAKEUP]; | 998 | current_protocols = &dev->enabled_wakeup_protocols; |
999 | change_protocol = dev->change_wakeup_protocol; | 999 | change_protocol = dev->change_wakeup_protocol; |
1000 | filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; | 1000 | filter = &dev->scancode_wakeup_filter; |
1001 | set_filter = dev->s_wakeup_filter; | 1001 | set_filter = dev->s_wakeup_filter; |
1002 | } | 1002 | } |
1003 | 1003 | ||
@@ -1085,9 +1085,9 @@ static ssize_t show_filter(struct device *device, | |||
1085 | return -EINVAL; | 1085 | return -EINVAL; |
1086 | 1086 | ||
1087 | if (fattr->type == RC_FILTER_NORMAL) | 1087 | if (fattr->type == RC_FILTER_NORMAL) |
1088 | filter = &dev->scancode_filters[RC_FILTER_NORMAL]; | 1088 | filter = &dev->scancode_filter; |
1089 | else | 1089 | else |
1090 | filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; | 1090 | filter = &dev->scancode_wakeup_filter; |
1091 | 1091 | ||
1092 | mutex_lock(&dev->lock); | 1092 | mutex_lock(&dev->lock); |
1093 | if (fattr->mask) | 1093 | if (fattr->mask) |
@@ -1140,12 +1140,12 @@ static ssize_t store_filter(struct device *device, | |||
1140 | 1140 | ||
1141 | if (fattr->type == RC_FILTER_NORMAL) { | 1141 | if (fattr->type == RC_FILTER_NORMAL) { |
1142 | set_filter = dev->s_filter; | 1142 | set_filter = dev->s_filter; |
1143 | enabled_protocols = &dev->enabled_protocols[RC_FILTER_NORMAL]; | 1143 | enabled_protocols = &dev->enabled_protocols; |
1144 | filter = &dev->scancode_filters[RC_FILTER_NORMAL]; | 1144 | filter = &dev->scancode_filter; |
1145 | } else { | 1145 | } else { |
1146 | set_filter = dev->s_wakeup_filter; | 1146 | set_filter = dev->s_wakeup_filter; |
1147 | enabled_protocols = &dev->enabled_protocols[RC_FILTER_WAKEUP]; | 1147 | enabled_protocols = &dev->enabled_wakeup_protocols; |
1148 | filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; | 1148 | filter = &dev->scancode_wakeup_filter; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | if (!set_filter) | 1151 | if (!set_filter) |
@@ -1424,7 +1424,7 @@ int rc_register_device(struct rc_dev *dev) | |||
1424 | rc = dev->change_protocol(dev, &rc_type); | 1424 | rc = dev->change_protocol(dev, &rc_type); |
1425 | if (rc < 0) | 1425 | if (rc < 0) |
1426 | goto out_raw; | 1426 | goto out_raw; |
1427 | dev->enabled_protocols[RC_FILTER_NORMAL] = rc_type; | 1427 | dev->enabled_protocols = rc_type; |
1428 | } | 1428 | } |
1429 | 1429 | ||
1430 | mutex_unlock(&dev->lock); | 1430 | mutex_unlock(&dev->lock); |
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 79abbc8d9600..795b394a5d84 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c | |||
@@ -878,7 +878,7 @@ static struct rc_dev *redrat3_init_rc_dev(struct redrat3_dev *rr3) | |||
878 | rc->dev.parent = dev; | 878 | rc->dev.parent = dev; |
879 | rc->priv = rr3; | 879 | rc->priv = rr3; |
880 | rc->driver_type = RC_DRIVER_IR_RAW; | 880 | rc->driver_type = RC_DRIVER_IR_RAW; |
881 | rc_set_allowed_protocols(rc, RC_BIT_ALL); | 881 | rc->allowed_protocols = RC_BIT_ALL; |
882 | rc->timeout = US_TO_NS(2750); | 882 | rc->timeout = US_TO_NS(2750); |
883 | rc->tx_ir = redrat3_transmit_ir; | 883 | rc->tx_ir = redrat3_transmit_ir; |
884 | rc->s_tx_carrier = redrat3_set_tx_carrier; | 884 | 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 22e4c1f28ab4..5c151351afa4 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 | rc_set_allowed_protocols(rdev, RC_BIT_ALL); | 290 | rdev->allowed_protocols = 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 bd5e4ff9e0ba..828bbb886882 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c | |||
@@ -316,7 +316,7 @@ static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz) | |||
316 | rdev->dev.parent = dev; | 316 | rdev->dev.parent = dev; |
317 | rdev->priv = sz; | 317 | rdev->priv = sz; |
318 | rdev->driver_type = RC_DRIVER_IR_RAW; | 318 | rdev->driver_type = RC_DRIVER_IR_RAW; |
319 | rc_set_allowed_protocols(rdev, RC_BIT_ALL); | 319 | rdev->allowed_protocols = RC_BIT_ALL; |
320 | rdev->driver_name = DRIVER_NAME; | 320 | rdev->driver_name = DRIVER_NAME; |
321 | rdev->map_name = RC_MAP_STREAMZAP; | 321 | rdev->map_name = RC_MAP_STREAMZAP; |
322 | 322 | ||
diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c index 13dcd800eb41..bcee8e1a4e9e 100644 --- a/drivers/media/rc/sunxi-cir.c +++ b/drivers/media/rc/sunxi-cir.c | |||
@@ -210,7 +210,7 @@ static int sunxi_ir_probe(struct platform_device *pdev) | |||
210 | ir->rc->map_name = ir->map_name ?: RC_MAP_EMPTY; | 210 | ir->rc->map_name = ir->map_name ?: RC_MAP_EMPTY; |
211 | ir->rc->dev.parent = dev; | 211 | ir->rc->dev.parent = dev; |
212 | ir->rc->driver_type = RC_DRIVER_IR_RAW; | 212 | ir->rc->driver_type = RC_DRIVER_IR_RAW; |
213 | rc_set_allowed_protocols(ir->rc, RC_BIT_ALL); | 213 | ir->rc->allowed_protocols = RC_BIT_ALL; |
214 | ir->rc->rx_resolution = SUNXI_IR_SAMPLE; | 214 | ir->rc->rx_resolution = SUNXI_IR_SAMPLE; |
215 | ir->rc->timeout = MS_TO_NS(SUNXI_IR_TIMEOUT); | 215 | ir->rc->timeout = MS_TO_NS(SUNXI_IR_TIMEOUT); |
216 | ir->rc->driver_name = SUNXI_IR_DEV; | 216 | ir->rc->driver_name = SUNXI_IR_DEV; |
diff --git a/drivers/media/rc/ttusbir.c b/drivers/media/rc/ttusbir.c index c5be38e2a2fe..bc214e2b3a36 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_set_allowed_protocols(rc, RC_BIT_ALL); | 321 | rc->allowed_protocols = 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 a8b981f5ce2e..d839f73f6a05 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 | rc_set_allowed_protocols(data->dev, RC_BIT_ALL); | 1085 | data->dev->allowed_protocols = 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) |