Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

David Härdeman and committed by
Mauro Carvalho Chehab
c5540fbb da6e162d

+86 -119
+1 -1
drivers/hid/hid-picolcd_cir.c
··· 114 114 115 115 rdev->priv = data; 116 116 rdev->driver_type = RC_DRIVER_IR_RAW; 117 - rc_set_allowed_protocols(rdev, RC_BIT_ALL); 117 + rdev->allowed_protocols = RC_BIT_ALL; 118 118 rdev->open = picolcd_cir_open; 119 119 rdev->close = picolcd_cir_close; 120 120 rdev->input_name = data->hdev->name;
+1 -1
drivers/media/common/siano/smsir.c
··· 88 88 89 89 dev->priv = coredev; 90 90 dev->driver_type = RC_DRIVER_IR_RAW; 91 - rc_set_allowed_protocols(dev, RC_BIT_ALL); 91 + dev->allowed_protocols = RC_BIT_ALL; 92 92 dev->map_name = sms_get_board(board_id)->rc_codes; 93 93 dev->driver_name = MODULE_NAME; 94 94
+2 -2
drivers/media/i2c/ir-kbd-i2c.c
··· 432 432 * Initialize the other fields of rc_dev 433 433 */ 434 434 rc->map_name = ir->ir_codes; 435 - rc_set_allowed_protocols(rc, rc_type); 436 - rc_set_enabled_protocols(rc, rc_type); 435 + rc->allowed_protocols = rc_type; 436 + rc->enabled_protocols = rc_type; 437 437 if (!rc->driver_name) 438 438 rc->driver_name = MODULE_NAME; 439 439
+1 -1
drivers/media/pci/cx23885/cx23885-input.c
··· 346 346 } 347 347 rc->dev.parent = &dev->pci->dev; 348 348 rc->driver_type = driver_type; 349 - rc_set_allowed_protocols(rc, allowed_protos); 349 + rc->allowed_protocols = allowed_protos; 350 350 rc->priv = kernel_ir; 351 351 rc->open = cx23885_input_ir_open; 352 352 rc->close = cx23885_input_ir_close;
+1 -1
drivers/media/pci/cx88/cx88-input.c
··· 485 485 dev->timeout = 10 * 1000 * 1000; /* 10 ms */ 486 486 } else { 487 487 dev->driver_type = RC_DRIVER_SCANCODE; 488 - rc_set_allowed_protocols(dev, rc_type); 488 + dev->allowed_protocols = rc_type; 489 489 } 490 490 491 491 ir->core = core;
+1 -1
drivers/media/rc/ati_remote.c
··· 784 784 785 785 rdev->priv = ati_remote; 786 786 rdev->driver_type = RC_DRIVER_SCANCODE; 787 - rc_set_allowed_protocols(rdev, RC_BIT_OTHER); 787 + rdev->allowed_protocols = RC_BIT_OTHER; 788 788 rdev->driver_name = "ati_remote"; 789 789 790 790 rdev->open = ati_remote_rc_open;
+1 -1
drivers/media/rc/ene_ir.c
··· 1059 1059 learning_mode_force = false; 1060 1060 1061 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 1063 rdev->priv = dev; 1064 1064 rdev->open = ene_open; 1065 1065 rdev->close = ene_close;
+1 -1
drivers/media/rc/fintek-cir.c
··· 541 541 /* Set up the rc device */ 542 542 rdev->priv = fintek; 543 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 545 rdev->open = fintek_open; 546 546 rdev->close = fintek_close; 547 547 rdev->input_name = FINTEK_DESCRIPTION;
+2 -2
drivers/media/rc/gpio-ir-recv.c
··· 145 145 rcdev->dev.parent = &pdev->dev; 146 146 rcdev->driver_name = GPIO_IR_DRIVER_NAME; 147 147 if (pdata->allowed_protos) 148 - rc_set_allowed_protocols(rcdev, pdata->allowed_protos); 148 + rcdev->allowed_protocols = pdata->allowed_protos; 149 149 else 150 - rc_set_allowed_protocols(rcdev, RC_BIT_ALL); 150 + rcdev->allowed_protocols = RC_BIT_ALL; 151 151 rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY; 152 152 153 153 gpio_dev->rcdev = rcdev;
+1 -1
drivers/media/rc/iguanair.c
··· 495 495 usb_to_input_id(ir->udev, &rc->input_id); 496 496 rc->dev.parent = &intf->dev; 497 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 499 rc->priv = ir; 500 500 rc->open = iguanair_open; 501 501 rc->close = iguanair_close;
+8 -8
drivers/media/rc/img-ir/img-ir-hw.c
··· 556 556 hw->mode = IMG_IR_M_NORMAL; 557 557 558 558 /* clear the wakeup scancode filter */ 559 - rdev->scancode_filters[RC_FILTER_WAKEUP].data = 0; 560 - rdev->scancode_filters[RC_FILTER_WAKEUP].mask = 0; 559 + rdev->scancode_wakeup_filter.data = 0; 560 + rdev->scancode_wakeup_filter.mask = 0; 561 561 562 562 /* clear raw filters */ 563 563 _img_ir_set_filter(priv, NULL); ··· 661 661 wakeup_protocols = *ir_type; 662 662 if (!hw->decoder || !hw->decoder->filter) 663 663 wakeup_protocols = 0; 664 - rc_set_allowed_wakeup_protocols(rdev, wakeup_protocols); 665 - rc_set_enabled_wakeup_protocols(rdev, wakeup_protocols); 664 + rdev->allowed_wakeup_protocols = wakeup_protocols; 665 + rdev->enabled_wakeup_protocols = wakeup_protocols; 666 666 return 0; 667 667 } 668 668 ··· 676 676 spin_unlock_irq(&rdev->rc_map.lock); 677 677 678 678 mutex_lock(&rdev->lock); 679 - rc_set_enabled_protocols(rdev, proto); 680 - rc_set_allowed_wakeup_protocols(rdev, proto); 681 - rc_set_enabled_wakeup_protocols(rdev, proto); 679 + rdev->enabled_protocols = proto; 680 + rdev->allowed_wakeup_protocols = proto; 681 + rdev->enabled_wakeup_protocols = proto; 682 682 mutex_unlock(&rdev->lock); 683 683 } 684 684 ··· 1003 1003 } 1004 1004 rdev->priv = priv; 1005 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 1007 rdev->input_name = "IMG Infrared Decoder"; 1008 1008 rdev->s_filter = img_ir_set_normal_filter; 1009 1009 rdev->s_wakeup_filter = img_ir_set_wakeup_filter;
+3 -4
drivers/media/rc/imon.c
··· 1017 1017 unsigned char ir_proto_packet[] = { 1018 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 1021 dev_warn(dev, "Looks like you're trying to use an IR protocol " 1022 1022 "this device does not support\n"); 1023 1023 ··· 1870 1870 1871 1871 rdev->priv = ictx; 1872 1872 rdev->driver_type = RC_DRIVER_SCANCODE; 1873 - /* iMON PAD or MCE */ 1874 - rc_set_allowed_protocols(rdev, RC_BIT_OTHER | RC_BIT_RC6_MCE); 1873 + rdev->allowed_protocols = RC_BIT_OTHER | RC_BIT_RC6_MCE; /* iMON PAD or MCE */ 1875 1874 rdev->change_protocol = imon_ir_change_protocol; 1876 1875 rdev->driver_name = MOD_NAME; 1877 1876 ··· 1883 1884 1884 1885 if (ictx->product == 0xffdc) { 1885 1886 imon_get_ffdc_type(ictx); 1886 - rc_set_allowed_protocols(rdev, ictx->rc_type); 1887 + rdev->allowed_protocols = ictx->rc_type; 1887 1888 } 1888 1889 1889 1890 imon_set_display_type(ictx);
+1 -1
drivers/media/rc/ir-jvc-decoder.c
··· 47 47 { 48 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 51 return 0; 52 52 53 53 if (!is_timing_event(ev)) {
+1 -1
drivers/media/rc/ir-lirc-codec.c
··· 35 35 struct lirc_codec *lirc = &dev->raw->lirc; 36 36 int sample; 37 37 38 - if (!rc_protocols_enabled(dev, RC_BIT_LIRC)) 38 + if (!(dev->enabled_protocols & RC_BIT_LIRC)) 39 39 return 0; 40 40 41 41 if (!dev->raw->lirc.drv || !dev->raw->lirc.drv->rbuf)
+1 -1
drivers/media/rc/ir-mce_kbd-decoder.c
··· 216 216 u32 scancode; 217 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 220 return 0; 221 221 222 222 if (!is_timing_event(ev)) {
+1 -1
drivers/media/rc/ir-nec-decoder.c
··· 52 52 u8 address, not_address, command, not_command; 53 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 56 return 0; 57 57 58 58 if (!is_timing_event(ev)) {
+1 -1
drivers/media/rc/ir-raw.c
··· 262 262 return -ENOMEM; 263 263 264 264 dev->raw->dev = dev; 265 - rc_set_enabled_protocols(dev, ~0); 265 + dev->enabled_protocols = ~0; 266 266 dev->change_protocol = change_protocol; 267 267 rc = kfifo_alloc(&dev->raw->kfifo, 268 268 sizeof(struct ir_raw_event) * MAX_IR_EVENT_SIZE,
+3 -3
drivers/media/rc/ir-rc5-decoder.c
··· 53 53 u32 scancode; 54 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 57 return 0; 58 58 59 59 if (!is_timing_event(ev)) { ··· 129 129 if (data->wanted_bits == RC5X_NBITS) { 130 130 /* RC5X */ 131 131 u8 xdata, command, system; 132 - if (!rc_protocols_enabled(dev, RC_BIT_RC5X)) { 132 + if (!(dev->enabled_protocols & RC_BIT_RC5X)) { 133 133 data->state = STATE_INACTIVE; 134 134 return 0; 135 135 } ··· 147 147 } else { 148 148 /* RC5 */ 149 149 u8 command, system; 150 - if (!rc_protocols_enabled(dev, RC_BIT_RC5)) { 150 + if (!(dev->enabled_protocols & RC_BIT_RC5)) { 151 151 data->state = STATE_INACTIVE; 152 152 return 0; 153 153 }
+1 -1
drivers/media/rc/ir-rc5-sz-decoder.c
··· 48 48 u8 toggle, command, system; 49 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 52 return 0; 53 53 54 54 if (!is_timing_event(ev)) {
+3 -3
drivers/media/rc/ir-rc6-decoder.c
··· 90 90 u8 toggle; 91 91 enum rc_type protocol; 92 92 93 - if (!rc_protocols_enabled(dev, RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | 94 - RC_BIT_RC6_6A_24 | RC_BIT_RC6_6A_32 | 95 - RC_BIT_RC6_MCE)) 93 + if (!(dev->enabled_protocols & 94 + (RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | 95 + RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE))) 96 96 return 0; 97 97 98 98 if (!is_timing_event(ev)) {
+1 -1
drivers/media/rc/ir-sanyo-decoder.c
··· 58 58 u32 scancode; 59 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 62 return 0; 63 63 64 64 if (!is_timing_event(ev)) {
+1 -1
drivers/media/rc/ir-sharp-decoder.c
··· 48 48 struct sharp_dec *data = &dev->raw->sharp; 49 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 52 return 0; 53 53 54 54 if (!is_timing_event(ev)) {
+5 -5
drivers/media/rc/ir-sony-decoder.c
··· 46 46 u32 scancode; 47 47 u8 device, subdevice, function; 48 48 49 - if (!rc_protocols_enabled(dev, RC_BIT_SONY12 | RC_BIT_SONY15 | 50 - RC_BIT_SONY20)) 49 + if (!(dev->enabled_protocols & 50 + (RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20))) 51 51 return 0; 52 52 53 53 if (!is_timing_event(ev)) { ··· 125 125 126 126 switch (data->count) { 127 127 case 12: 128 - if (!rc_protocols_enabled(dev, RC_BIT_SONY12)) { 128 + if (!(dev->enabled_protocols & RC_BIT_SONY12)) { 129 129 data->state = STATE_INACTIVE; 130 130 return 0; 131 131 } ··· 135 135 protocol = RC_TYPE_SONY12; 136 136 break; 137 137 case 15: 138 - if (!rc_protocols_enabled(dev, RC_BIT_SONY15)) { 138 + if (!(dev->enabled_protocols & RC_BIT_SONY15)) { 139 139 data->state = STATE_INACTIVE; 140 140 return 0; 141 141 } ··· 145 145 protocol = RC_TYPE_SONY15; 146 146 break; 147 147 case 20: 148 - if (!rc_protocols_enabled(dev, RC_BIT_SONY20)) { 148 + if (!(dev->enabled_protocols & RC_BIT_SONY20)) { 149 149 data->state = STATE_INACTIVE; 150 150 return 0; 151 151 }
+1 -1
drivers/media/rc/ite-cir.c
··· 1563 1563 /* set up ir-core props */ 1564 1564 rdev->priv = itdev; 1565 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 1567 rdev->open = ite_open; 1568 1568 rdev->close = ite_close; 1569 1569 rdev->s_idle = ite_s_idle;
+1 -1
drivers/media/rc/mceusb.c
··· 1219 1219 rc->dev.parent = dev; 1220 1220 rc->priv = ir; 1221 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 1223 rc->timeout = MS_TO_NS(100); 1224 1224 if (!ir->flags.no_tx) { 1225 1225 rc->s_tx_mask = mceusb_set_tx_mask;
+1 -1
drivers/media/rc/nuvoton-cir.c
··· 1044 1044 /* Set up the rc device */ 1045 1045 rdev->priv = nvt; 1046 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 1048 rdev->open = nvt_open; 1049 1049 rdev->close = nvt_close; 1050 1050 rdev->tx_ir = nvt_tx_ir;
+1 -1
drivers/media/rc/rc-loopback.c
··· 195 195 rc->map_name = RC_MAP_EMPTY; 196 196 rc->priv = &loopdev; 197 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 199 rc->timeout = 100 * 1000 * 1000; /* 100 ms */ 200 200 rc->min_timeout = 1; 201 201 rc->max_timeout = UINT_MAX;
+15 -15
drivers/media/rc/rc-main.c
··· 857 857 mutex_lock(&dev->lock); 858 858 859 859 if (fattr->type == RC_FILTER_NORMAL) { 860 - enabled = dev->enabled_protocols[RC_FILTER_NORMAL]; 860 + enabled = dev->enabled_protocols; 861 861 if (dev->raw) 862 862 allowed = ir_raw_get_allowed_protocols(); 863 863 else 864 - allowed = dev->allowed_protocols[RC_FILTER_NORMAL]; 864 + allowed = dev->allowed_protocols; 865 865 } else { 866 - enabled = dev->enabled_protocols[RC_FILTER_WAKEUP]; 867 - allowed = dev->allowed_protocols[RC_FILTER_WAKEUP]; 866 + enabled = dev->enabled_wakeup_protocols; 867 + allowed = dev->allowed_wakeup_protocols; 868 868 } 869 869 870 870 mutex_unlock(&dev->lock); ··· 989 989 990 990 if (fattr->type == RC_FILTER_NORMAL) { 991 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 993 change_protocol = dev->change_protocol; 994 - filter = &dev->scancode_filters[RC_FILTER_NORMAL]; 994 + filter = &dev->scancode_filter; 995 995 set_filter = dev->s_filter; 996 996 } else { 997 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 999 change_protocol = dev->change_wakeup_protocol; 1000 - filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; 1000 + filter = &dev->scancode_wakeup_filter; 1001 1001 set_filter = dev->s_wakeup_filter; 1002 1002 } 1003 1003 ··· 1085 1085 return -EINVAL; 1086 1086 1087 1087 if (fattr->type == RC_FILTER_NORMAL) 1088 - filter = &dev->scancode_filters[RC_FILTER_NORMAL]; 1088 + filter = &dev->scancode_filter; 1089 1089 else 1090 - filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; 1090 + filter = &dev->scancode_wakeup_filter; 1091 1091 1092 1092 mutex_lock(&dev->lock); 1093 1093 if (fattr->mask) ··· 1140 1140 1141 1141 if (fattr->type == RC_FILTER_NORMAL) { 1142 1142 set_filter = dev->s_filter; 1143 - enabled_protocols = &dev->enabled_protocols[RC_FILTER_NORMAL]; 1144 - filter = &dev->scancode_filters[RC_FILTER_NORMAL]; 1143 + enabled_protocols = &dev->enabled_protocols; 1144 + filter = &dev->scancode_filter; 1145 1145 } else { 1146 1146 set_filter = dev->s_wakeup_filter; 1147 - enabled_protocols = &dev->enabled_protocols[RC_FILTER_WAKEUP]; 1148 - filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; 1147 + enabled_protocols = &dev->enabled_wakeup_protocols; 1148 + filter = &dev->scancode_wakeup_filter; 1149 1149 } 1150 1150 1151 1151 if (!set_filter) ··· 1424 1424 rc = dev->change_protocol(dev, &rc_type); 1425 1425 if (rc < 0) 1426 1426 goto out_raw; 1427 - dev->enabled_protocols[RC_FILTER_NORMAL] = rc_type; 1427 + dev->enabled_protocols = rc_type; 1428 1428 } 1429 1429 1430 1430 mutex_unlock(&dev->lock);
+1 -1
drivers/media/rc/redrat3.c
··· 878 878 rc->dev.parent = dev; 879 879 rc->priv = rr3; 880 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 882 rc->timeout = US_TO_NS(2750); 883 883 rc->tx_ir = redrat3_transmit_ir; 884 884 rc->s_tx_carrier = redrat3_set_tx_carrier;
+1 -1
drivers/media/rc/st_rc.c
··· 287 287 st_rc_hardware_init(rc_dev); 288 288 289 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 291 /* rx sampling rate is 10Mhz */ 292 292 rdev->rx_resolution = 100; 293 293 rdev->timeout = US_TO_NS(MAX_SYMB_TIME);
+1 -1
drivers/media/rc/streamzap.c
··· 316 316 rdev->dev.parent = dev; 317 317 rdev->priv = sz; 318 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 320 rdev->driver_name = DRIVER_NAME; 321 321 rdev->map_name = RC_MAP_STREAMZAP; 322 322
+1 -1
drivers/media/rc/sunxi-cir.c
··· 210 210 ir->rc->map_name = ir->map_name ?: RC_MAP_EMPTY; 211 211 ir->rc->dev.parent = dev; 212 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 214 ir->rc->rx_resolution = SUNXI_IR_SAMPLE; 215 215 ir->rc->timeout = MS_TO_NS(SUNXI_IR_TIMEOUT); 216 216 ir->rc->driver_name = SUNXI_IR_DEV;
+1 -1
drivers/media/rc/ttusbir.c
··· 318 318 usb_to_input_id(tt->udev, &rc->input_id); 319 319 rc->dev.parent = &intf->dev; 320 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 322 rc->priv = tt; 323 323 rc->driver_name = DRIVER_NAME; 324 324 rc->map_name = RC_MAP_TT_1500;
+1 -1
drivers/media/rc/winbond-cir.c
··· 1082 1082 data->dev->dev.parent = &device->dev; 1083 1083 data->dev->timeout = MS_TO_NS(100); 1084 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 1087 err = rc_register_device(data->dev); 1088 1088 if (err)
+1 -1
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
··· 164 164 dev->driver_name = (char *) d->props->driver_name; 165 165 dev->map_name = d->rc.map_name; 166 166 dev->driver_type = d->rc.driver_type; 167 - rc_set_allowed_protocols(dev, d->rc.allowed_protos); 167 + dev->allowed_protocols = d->rc.allowed_protos; 168 168 dev->change_protocol = d->rc.change_protocol; 169 169 dev->priv = d; 170 170
+1 -1
drivers/media/usb/dvb-usb/dvb-usb-remote.c
··· 272 272 dev->driver_name = d->props.rc.core.module_name; 273 273 dev->map_name = d->props.rc.core.rc_codes; 274 274 dev->change_protocol = d->props.rc.core.change_protocol; 275 - rc_set_allowed_protocols(dev, d->props.rc.core.allowed_protos); 275 + dev->allowed_protocols = d->props.rc.core.allowed_protos; 276 276 dev->driver_type = d->props.rc.core.driver_type; 277 277 usb_to_input_id(d->udev, &dev->input_id); 278 278 dev->input_name = "IR-receiver inside an USB DVB receiver";
+4 -4
drivers/media/usb/em28xx/em28xx-input.c
··· 745 745 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2: 746 746 rc->map_name = RC_MAP_HAUPPAUGE; 747 747 ir->get_key_i2c = em28xx_get_key_em_haup; 748 - rc_set_allowed_protocols(rc, RC_BIT_RC5); 748 + rc->allowed_protocols = RC_BIT_RC5; 749 749 break; 750 750 case EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE: 751 751 rc->map_name = RC_MAP_WINFAST_USBII_DELUXE; ··· 761 761 switch (dev->chip_id) { 762 762 case CHIP_ID_EM2860: 763 763 case CHIP_ID_EM2883: 764 - rc_set_allowed_protocols(rc, RC_BIT_RC5 | RC_BIT_NEC); 764 + rc->allowed_protocols = RC_BIT_RC5 | RC_BIT_NEC; 765 765 ir->get_key = default_polling_getkey; 766 766 break; 767 767 case CHIP_ID_EM2884: ··· 769 769 case CHIP_ID_EM28174: 770 770 case CHIP_ID_EM28178: 771 771 ir->get_key = em2874_polling_getkey; 772 - rc_set_allowed_protocols(rc, RC_BIT_RC5 | RC_BIT_NEC | 773 - RC_BIT_RC6_0); 772 + rc->allowed_protocols = RC_BIT_RC5 | RC_BIT_NEC | 773 + RC_BIT_RC6_0; 774 774 break; 775 775 default: 776 776 err = -ENODEV;
+1 -1
drivers/media/usb/tm6000/tm6000-input.c
··· 441 441 ir->rc = rc; 442 442 443 443 /* input setup */ 444 - rc_set_allowed_protocols(rc, RC_BIT_RC5 | RC_BIT_NEC); 444 + rc->allowed_protocols = RC_BIT_RC5 | RC_BIT_NEC; 445 445 /* Neded, in order to support NEC remotes with 24 or 32 bits */ 446 446 rc->scanmask = 0xffff; 447 447 rc->priv = ir;
+12 -44
include/media/rc-core.h
··· 74 74 * @input_dev: the input child device used to communicate events to userspace 75 75 * @driver_type: specifies if protocol decoding is done in hardware or software 76 76 * @idle: used to keep track of RX state 77 - * @allowed_protocols: bitmask with the supported RC_BIT_* protocols for each 78 - * filter type 79 - * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols for each 80 - * filter type 77 + * @allowed_protocols: bitmask with the supported RC_BIT_* protocols 78 + * @enabled_protocols: bitmask with the enabled RC_BIT_* protocols 79 + * @allowed_wakeup_protocols: bitmask with the supported RC_BIT_* wakeup protocols 80 + * @enabled_wakeup_protocols: bitmask with the enabled RC_BIT_* wakeup protocols 81 + * @scancode_filter: scancode filter 82 + * @scancode_wakeup_filter: scancode wakeup filters 81 83 * @scanmask: some hardware decoders are not capable of providing the full 82 84 * scancode to the application. As this is a hardware limit, we can't do 83 85 * anything with it. Yet, as the same keycode table can be used with other ··· 99 97 * @max_timeout: maximum timeout supported by device 100 98 * @rx_resolution : resolution (in ns) of input sampler 101 99 * @tx_resolution: resolution (in ns) of output sampler 102 - * @scancode_filters: scancode filters (indexed by enum rc_filter_type) 103 100 * @change_protocol: allow changing the protocol used on hardware decoders 104 101 * @change_wakeup_protocol: allow changing the protocol used for wakeup 105 102 * filtering ··· 133 132 struct input_dev *input_dev; 134 133 enum rc_driver_type driver_type; 135 134 bool idle; 136 - u64 allowed_protocols[RC_FILTER_MAX]; 137 - u64 enabled_protocols[RC_FILTER_MAX]; 135 + u64 allowed_protocols; 136 + u64 enabled_protocols; 137 + u64 allowed_wakeup_protocols; 138 + u64 enabled_wakeup_protocols; 139 + struct rc_scancode_filter scancode_filter; 140 + struct rc_scancode_filter scancode_wakeup_filter; 138 141 u32 users; 139 142 u32 scanmask; 140 143 void *priv; ··· 155 150 u32 max_timeout; 156 151 u32 rx_resolution; 157 152 u32 tx_resolution; 158 - struct rc_scancode_filter scancode_filters[RC_FILTER_MAX]; 159 153 int (*change_protocol)(struct rc_dev *dev, u64 *rc_type); 160 154 int (*change_wakeup_protocol)(struct rc_dev *dev, u64 *rc_type); 161 155 int (*open)(struct rc_dev *dev); ··· 174 170 }; 175 171 176 172 #define to_rc_dev(d) container_of(d, struct rc_dev, dev) 177 - 178 - static inline bool rc_protocols_allowed(struct rc_dev *rdev, u64 protos) 179 - { 180 - return rdev->allowed_protocols[RC_FILTER_NORMAL] & protos; 181 - } 182 - 183 - /* should be called prior to registration or with mutex held */ 184 - static inline void rc_set_allowed_protocols(struct rc_dev *rdev, u64 protos) 185 - { 186 - rdev->allowed_protocols[RC_FILTER_NORMAL] = protos; 187 - } 188 - 189 - static inline bool rc_protocols_enabled(struct rc_dev *rdev, u64 protos) 190 - { 191 - return rdev->enabled_protocols[RC_FILTER_NORMAL] & protos; 192 - } 193 - 194 - /* should be called prior to registration or with mutex held */ 195 - static inline void rc_set_enabled_protocols(struct rc_dev *rdev, u64 protos) 196 - { 197 - rdev->enabled_protocols[RC_FILTER_NORMAL] = protos; 198 - } 199 - 200 - /* should be called prior to registration or with mutex held */ 201 - static inline void rc_set_allowed_wakeup_protocols(struct rc_dev *rdev, 202 - u64 protos) 203 - { 204 - rdev->allowed_protocols[RC_FILTER_WAKEUP] = protos; 205 - } 206 - 207 - /* should be called prior to registration or with mutex held */ 208 - static inline void rc_set_enabled_wakeup_protocols(struct rc_dev *rdev, 209 - u64 protos) 210 - { 211 - rdev->enabled_protocols[RC_FILTER_WAKEUP] = protos; 212 - } 213 173 214 174 /* 215 175 * From rc-main.c