| .. | .. |
|---|
| 70 | 70 | [RC_PROTO_CEC] = { .name = "cec", .repeat_period = 0 }, |
|---|
| 71 | 71 | [RC_PROTO_IMON] = { .name = "imon", |
|---|
| 72 | 72 | .scancode_bits = 0x7fffffff, .repeat_period = 114 }, |
|---|
| 73 | + [RC_PROTO_RCMM12] = { .name = "rc-mm-12", |
|---|
| 74 | + .scancode_bits = 0x00000fff, .repeat_period = 114 }, |
|---|
| 75 | + [RC_PROTO_RCMM24] = { .name = "rc-mm-24", |
|---|
| 76 | + .scancode_bits = 0x00ffffff, .repeat_period = 114 }, |
|---|
| 77 | + [RC_PROTO_RCMM32] = { .name = "rc-mm-32", |
|---|
| 78 | + .scancode_bits = 0xffffffff, .repeat_period = 114 }, |
|---|
| 79 | + [RC_PROTO_XBOX_DVD] = { .name = "xbox-dvd", .repeat_period = 64 }, |
|---|
| 73 | 80 | }; |
|---|
| 74 | 81 | |
|---|
| 75 | 82 | /* Used to keep track of known keymaps */ |
|---|
| .. | .. |
|---|
| 155 | 162 | .name = RC_MAP_EMPTY, |
|---|
| 156 | 163 | } |
|---|
| 157 | 164 | }; |
|---|
| 165 | + |
|---|
| 166 | +/** |
|---|
| 167 | + * scancode_to_u64() - converts scancode in &struct input_keymap_entry |
|---|
| 168 | + * @ke: keymap entry containing scancode to be converted. |
|---|
| 169 | + * @scancode: pointer to the location where converted scancode should |
|---|
| 170 | + * be stored. |
|---|
| 171 | + * |
|---|
| 172 | + * This function is a version of input_scancode_to_scalar specialized for |
|---|
| 173 | + * rc-core. |
|---|
| 174 | + */ |
|---|
| 175 | +static int scancode_to_u64(const struct input_keymap_entry *ke, u64 *scancode) |
|---|
| 176 | +{ |
|---|
| 177 | + switch (ke->len) { |
|---|
| 178 | + case 1: |
|---|
| 179 | + *scancode = *((u8 *)ke->scancode); |
|---|
| 180 | + break; |
|---|
| 181 | + |
|---|
| 182 | + case 2: |
|---|
| 183 | + *scancode = *((u16 *)ke->scancode); |
|---|
| 184 | + break; |
|---|
| 185 | + |
|---|
| 186 | + case 4: |
|---|
| 187 | + *scancode = *((u32 *)ke->scancode); |
|---|
| 188 | + break; |
|---|
| 189 | + |
|---|
| 190 | + case 8: |
|---|
| 191 | + *scancode = *((u64 *)ke->scancode); |
|---|
| 192 | + break; |
|---|
| 193 | + |
|---|
| 194 | + default: |
|---|
| 195 | + return -EINVAL; |
|---|
| 196 | + } |
|---|
| 197 | + |
|---|
| 198 | + return 0; |
|---|
| 199 | +} |
|---|
| 158 | 200 | |
|---|
| 159 | 201 | /** |
|---|
| 160 | 202 | * ir_create_table() - initializes a scancode table |
|---|
| .. | .. |
|---|
| 278 | 320 | |
|---|
| 279 | 321 | /* Did the user wish to remove the mapping? */ |
|---|
| 280 | 322 | if (new_keycode == KEY_RESERVED || new_keycode == KEY_UNKNOWN) { |
|---|
| 281 | | - dev_dbg(&dev->dev, "#%d: Deleting scan 0x%04x\n", |
|---|
| 323 | + dev_dbg(&dev->dev, "#%d: Deleting scan 0x%04llx\n", |
|---|
| 282 | 324 | index, rc_map->scan[index].scancode); |
|---|
| 283 | 325 | rc_map->len--; |
|---|
| 284 | 326 | memmove(&rc_map->scan[index], &rc_map->scan[index+ 1], |
|---|
| 285 | 327 | (rc_map->len - index) * sizeof(struct rc_map_table)); |
|---|
| 286 | 328 | } else { |
|---|
| 287 | | - dev_dbg(&dev->dev, "#%d: %s scan 0x%04x with key 0x%04x\n", |
|---|
| 329 | + dev_dbg(&dev->dev, "#%d: %s scan 0x%04llx with key 0x%04x\n", |
|---|
| 288 | 330 | index, |
|---|
| 289 | 331 | old_keycode == KEY_RESERVED ? "New" : "Replacing", |
|---|
| 290 | 332 | rc_map->scan[index].scancode, new_keycode); |
|---|
| .. | .. |
|---|
| 327 | 369 | */ |
|---|
| 328 | 370 | static unsigned int ir_establish_scancode(struct rc_dev *dev, |
|---|
| 329 | 371 | struct rc_map *rc_map, |
|---|
| 330 | | - unsigned int scancode, |
|---|
| 331 | | - bool resize) |
|---|
| 372 | + u64 scancode, bool resize) |
|---|
| 332 | 373 | { |
|---|
| 333 | 374 | unsigned int i; |
|---|
| 334 | 375 | |
|---|
| .. | .. |
|---|
| 387 | 428 | struct rc_dev *rdev = input_get_drvdata(idev); |
|---|
| 388 | 429 | struct rc_map *rc_map = &rdev->rc_map; |
|---|
| 389 | 430 | unsigned int index; |
|---|
| 390 | | - unsigned int scancode; |
|---|
| 431 | + u64 scancode; |
|---|
| 391 | 432 | int retval = 0; |
|---|
| 392 | 433 | unsigned long flags; |
|---|
| 393 | 434 | |
|---|
| .. | .. |
|---|
| 400 | 441 | goto out; |
|---|
| 401 | 442 | } |
|---|
| 402 | 443 | } else { |
|---|
| 403 | | - retval = input_scancode_to_scalar(ke, &scancode); |
|---|
| 444 | + retval = scancode_to_u64(ke, &scancode); |
|---|
| 404 | 445 | if (retval) |
|---|
| 405 | 446 | goto out; |
|---|
| 406 | 447 | |
|---|
| .. | .. |
|---|
| 427 | 468 | * |
|---|
| 428 | 469 | * return: -ENOMEM if all keycodes could not be inserted, otherwise zero. |
|---|
| 429 | 470 | */ |
|---|
| 430 | | -static int ir_setkeytable(struct rc_dev *dev, |
|---|
| 431 | | - const struct rc_map *from) |
|---|
| 471 | +static int ir_setkeytable(struct rc_dev *dev, const struct rc_map *from) |
|---|
| 432 | 472 | { |
|---|
| 433 | 473 | struct rc_map *rc_map = &dev->rc_map; |
|---|
| 434 | 474 | unsigned int i, index; |
|---|
| .. | .. |
|---|
| 459 | 499 | |
|---|
| 460 | 500 | static int rc_map_cmp(const void *key, const void *elt) |
|---|
| 461 | 501 | { |
|---|
| 462 | | - const unsigned int *scancode = key; |
|---|
| 502 | + const u64 *scancode = key; |
|---|
| 463 | 503 | const struct rc_map_table *e = elt; |
|---|
| 464 | 504 | |
|---|
| 465 | 505 | if (*scancode < e->scancode) |
|---|
| .. | .. |
|---|
| 480 | 520 | * return: index in the table, -1U if not found |
|---|
| 481 | 521 | */ |
|---|
| 482 | 522 | static unsigned int ir_lookup_by_scancode(const struct rc_map *rc_map, |
|---|
| 483 | | - unsigned int scancode) |
|---|
| 523 | + u64 scancode) |
|---|
| 484 | 524 | { |
|---|
| 485 | 525 | struct rc_map_table *res; |
|---|
| 486 | 526 | |
|---|
| .. | .. |
|---|
| 509 | 549 | struct rc_map_table *entry; |
|---|
| 510 | 550 | unsigned long flags; |
|---|
| 511 | 551 | unsigned int index; |
|---|
| 512 | | - unsigned int scancode; |
|---|
| 552 | + u64 scancode; |
|---|
| 513 | 553 | int retval; |
|---|
| 514 | 554 | |
|---|
| 515 | 555 | spin_lock_irqsave(&rc_map->lock, flags); |
|---|
| .. | .. |
|---|
| 517 | 557 | if (ke->flags & INPUT_KEYMAP_BY_INDEX) { |
|---|
| 518 | 558 | index = ke->index; |
|---|
| 519 | 559 | } else { |
|---|
| 520 | | - retval = input_scancode_to_scalar(ke, &scancode); |
|---|
| 560 | + retval = scancode_to_u64(ke, &scancode); |
|---|
| 521 | 561 | if (retval) |
|---|
| 522 | 562 | goto out; |
|---|
| 523 | 563 | |
|---|
| .. | .. |
|---|
| 531 | 571 | ke->keycode = entry->keycode; |
|---|
| 532 | 572 | ke->len = sizeof(entry->scancode); |
|---|
| 533 | 573 | memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); |
|---|
| 534 | | - |
|---|
| 535 | 574 | } else if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) { |
|---|
| 536 | 575 | /* |
|---|
| 537 | 576 | * We do not really know the valid range of scancodes |
|---|
| .. | .. |
|---|
| 563 | 602 | * |
|---|
| 564 | 603 | * return: the corresponding keycode, or KEY_RESERVED |
|---|
| 565 | 604 | */ |
|---|
| 566 | | -u32 rc_g_keycode_from_table(struct rc_dev *dev, u32 scancode) |
|---|
| 605 | +u32 rc_g_keycode_from_table(struct rc_dev *dev, u64 scancode) |
|---|
| 567 | 606 | { |
|---|
| 568 | 607 | struct rc_map *rc_map = &dev->rc_map; |
|---|
| 569 | 608 | unsigned int keycode; |
|---|
| .. | .. |
|---|
| 579 | 618 | spin_unlock_irqrestore(&rc_map->lock, flags); |
|---|
| 580 | 619 | |
|---|
| 581 | 620 | if (keycode != KEY_RESERVED) |
|---|
| 582 | | - dev_dbg(&dev->dev, "%s: scancode 0x%04x keycode 0x%02x\n", |
|---|
| 621 | + dev_dbg(&dev->dev, "%s: scancode 0x%04llx keycode 0x%02x\n", |
|---|
| 583 | 622 | dev->device_name, scancode, keycode); |
|---|
| 584 | 623 | |
|---|
| 585 | 624 | return keycode; |
|---|
| .. | .. |
|---|
| 698 | 737 | void rc_repeat(struct rc_dev *dev) |
|---|
| 699 | 738 | { |
|---|
| 700 | 739 | unsigned long flags; |
|---|
| 701 | | - unsigned int timeout = nsecs_to_jiffies(dev->timeout) + |
|---|
| 740 | + unsigned int timeout = usecs_to_jiffies(dev->timeout) + |
|---|
| 702 | 741 | msecs_to_jiffies(repeat_period(dev->last_protocol)); |
|---|
| 703 | 742 | struct lirc_scancode sc = { |
|---|
| 704 | 743 | .scancode = dev->last_scancode, .rc_proto = dev->last_protocol, |
|---|
| .. | .. |
|---|
| 708 | 747 | }; |
|---|
| 709 | 748 | |
|---|
| 710 | 749 | if (dev->allowed_protocols != RC_PROTO_BIT_CEC) |
|---|
| 711 | | - ir_lirc_scancode_event(dev, &sc); |
|---|
| 750 | + lirc_scancode_event(dev, &sc); |
|---|
| 712 | 751 | |
|---|
| 713 | 752 | spin_lock_irqsave(&dev->keylock, flags); |
|---|
| 714 | 753 | |
|---|
| 715 | | - input_event(dev->input_dev, EV_MSC, MSC_SCAN, dev->last_scancode); |
|---|
| 716 | | - input_sync(dev->input_dev); |
|---|
| 754 | + if (dev->last_scancode <= U32_MAX) { |
|---|
| 755 | + input_event(dev->input_dev, EV_MSC, MSC_SCAN, |
|---|
| 756 | + dev->last_scancode); |
|---|
| 757 | + input_sync(dev->input_dev); |
|---|
| 758 | + } |
|---|
| 717 | 759 | |
|---|
| 718 | 760 | if (dev->keypressed) { |
|---|
| 719 | 761 | dev->keyup_jiffies = jiffies + timeout; |
|---|
| .. | .. |
|---|
| 736 | 778 | * called with keylock held. |
|---|
| 737 | 779 | */ |
|---|
| 738 | 780 | static void ir_do_keydown(struct rc_dev *dev, enum rc_proto protocol, |
|---|
| 739 | | - u32 scancode, u32 keycode, u8 toggle) |
|---|
| 781 | + u64 scancode, u32 keycode, u8 toggle) |
|---|
| 740 | 782 | { |
|---|
| 741 | 783 | bool new_event = (!dev->keypressed || |
|---|
| 742 | 784 | dev->last_protocol != protocol || |
|---|
| .. | .. |
|---|
| 749 | 791 | }; |
|---|
| 750 | 792 | |
|---|
| 751 | 793 | if (dev->allowed_protocols != RC_PROTO_BIT_CEC) |
|---|
| 752 | | - ir_lirc_scancode_event(dev, &sc); |
|---|
| 794 | + lirc_scancode_event(dev, &sc); |
|---|
| 753 | 795 | |
|---|
| 754 | 796 | if (new_event && dev->keypressed) |
|---|
| 755 | 797 | ir_do_keyup(dev, false); |
|---|
| 756 | 798 | |
|---|
| 757 | | - input_event(dev->input_dev, EV_MSC, MSC_SCAN, scancode); |
|---|
| 799 | + if (scancode <= U32_MAX) |
|---|
| 800 | + input_event(dev->input_dev, EV_MSC, MSC_SCAN, scancode); |
|---|
| 758 | 801 | |
|---|
| 759 | 802 | dev->last_protocol = protocol; |
|---|
| 760 | 803 | dev->last_scancode = scancode; |
|---|
| .. | .. |
|---|
| 765 | 808 | /* Register a keypress */ |
|---|
| 766 | 809 | dev->keypressed = true; |
|---|
| 767 | 810 | |
|---|
| 768 | | - dev_dbg(&dev->dev, "%s: key down event, key 0x%04x, protocol 0x%04x, scancode 0x%08x\n", |
|---|
| 811 | + dev_dbg(&dev->dev, "%s: key down event, key 0x%04x, protocol 0x%04x, scancode 0x%08llx\n", |
|---|
| 769 | 812 | dev->device_name, keycode, protocol, scancode); |
|---|
| 770 | 813 | input_report_key(dev->input_dev, keycode, 1); |
|---|
| 771 | 814 | |
|---|
| .. | .. |
|---|
| 802 | 845 | * This routine is used to signal that a key has been pressed on the |
|---|
| 803 | 846 | * remote control. |
|---|
| 804 | 847 | */ |
|---|
| 805 | | -void rc_keydown(struct rc_dev *dev, enum rc_proto protocol, u32 scancode, |
|---|
| 848 | +void rc_keydown(struct rc_dev *dev, enum rc_proto protocol, u64 scancode, |
|---|
| 806 | 849 | u8 toggle) |
|---|
| 807 | 850 | { |
|---|
| 808 | 851 | unsigned long flags; |
|---|
| .. | .. |
|---|
| 812 | 855 | ir_do_keydown(dev, protocol, scancode, keycode, toggle); |
|---|
| 813 | 856 | |
|---|
| 814 | 857 | if (dev->keypressed) { |
|---|
| 815 | | - dev->keyup_jiffies = jiffies + nsecs_to_jiffies(dev->timeout) + |
|---|
| 858 | + dev->keyup_jiffies = jiffies + usecs_to_jiffies(dev->timeout) + |
|---|
| 816 | 859 | msecs_to_jiffies(repeat_period(protocol)); |
|---|
| 817 | 860 | mod_timer(&dev->timer_keyup, dev->keyup_jiffies); |
|---|
| 818 | 861 | } |
|---|
| .. | .. |
|---|
| 833 | 876 | * remote control. The driver must manually call rc_keyup() at a later stage. |
|---|
| 834 | 877 | */ |
|---|
| 835 | 878 | void rc_keydown_notimeout(struct rc_dev *dev, enum rc_proto protocol, |
|---|
| 836 | | - u32 scancode, u8 toggle) |
|---|
| 879 | + u64 scancode, u8 toggle) |
|---|
| 837 | 880 | { |
|---|
| 838 | 881 | unsigned long flags; |
|---|
| 839 | 882 | u32 keycode = rc_g_keycode_from_table(dev, scancode); |
|---|
| .. | .. |
|---|
| 1018 | 1061 | { RC_PROTO_BIT_XMP, "xmp", "ir-xmp-decoder" }, |
|---|
| 1019 | 1062 | { RC_PROTO_BIT_CEC, "cec", NULL }, |
|---|
| 1020 | 1063 | { RC_PROTO_BIT_IMON, "imon", "ir-imon-decoder" }, |
|---|
| 1064 | + { RC_PROTO_BIT_RCMM12 | |
|---|
| 1065 | + RC_PROTO_BIT_RCMM24 | |
|---|
| 1066 | + RC_PROTO_BIT_RCMM32, "rc-mm", "ir-rcmm-decoder" }, |
|---|
| 1067 | + { RC_PROTO_BIT_XBOX_DVD, "xbox-dvd", NULL }, |
|---|
| 1021 | 1068 | }; |
|---|
| 1022 | 1069 | |
|---|
| 1023 | 1070 | /** |
|---|
| .. | .. |
|---|
| 1047 | 1094 | * @buf: a pointer to the output buffer |
|---|
| 1048 | 1095 | * |
|---|
| 1049 | 1096 | * This routine is a callback routine for input read the IR protocol type(s). |
|---|
| 1050 | | - * it is trigged by reading /sys/class/rc/rc?/protocols. |
|---|
| 1097 | + * it is triggered by reading /sys/class/rc/rc?/protocols. |
|---|
| 1051 | 1098 | * It returns the protocol names of supported protocols. |
|---|
| 1052 | 1099 | * Enabled protocols are printed in brackets. |
|---|
| 1053 | 1100 | * |
|---|
| .. | .. |
|---|
| 1218 | 1265 | * @len: length of the input buffer |
|---|
| 1219 | 1266 | * |
|---|
| 1220 | 1267 | * This routine is for changing the IR protocol type. |
|---|
| 1221 | | - * It is trigged by writing to /sys/class/rc/rc?/[wakeup_]protocols. |
|---|
| 1268 | + * It is triggered by writing to /sys/class/rc/rc?/[wakeup_]protocols. |
|---|
| 1222 | 1269 | * See parse_protocol_change() for the valid commands. |
|---|
| 1223 | 1270 | * Returns @len on success or a negative error code. |
|---|
| 1224 | 1271 | * |
|---|
| .. | .. |
|---|
| 1306 | 1353 | * @buf: a pointer to the output buffer |
|---|
| 1307 | 1354 | * |
|---|
| 1308 | 1355 | * This routine is a callback routine to read a scancode filter value or mask. |
|---|
| 1309 | | - * It is trigged by reading /sys/class/rc/rc?/[wakeup_]filter[_mask]. |
|---|
| 1356 | + * It is triggered by reading /sys/class/rc/rc?/[wakeup_]filter[_mask]. |
|---|
| 1310 | 1357 | * It prints the current scancode filter value or mask of the appropriate filter |
|---|
| 1311 | 1358 | * type in hexadecimal into @buf and returns the size of the buffer. |
|---|
| 1312 | 1359 | * |
|---|
| .. | .. |
|---|
| 1349 | 1396 | * @len: length of the input buffer |
|---|
| 1350 | 1397 | * |
|---|
| 1351 | 1398 | * This routine is for changing a scancode filter value or mask. |
|---|
| 1352 | | - * It is trigged by writing to /sys/class/rc/rc?/[wakeup_]filter[_mask]. |
|---|
| 1399 | + * It is triggered by writing to /sys/class/rc/rc?/[wakeup_]filter[_mask]. |
|---|
| 1353 | 1400 | * Returns -EINVAL if an invalid filter value for the current protocol was |
|---|
| 1354 | 1401 | * specified or if scancode filtering is not supported by the driver, otherwise |
|---|
| 1355 | 1402 | * returns @len. |
|---|
| .. | .. |
|---|
| 1437 | 1484 | * @buf: a pointer to the output buffer |
|---|
| 1438 | 1485 | * |
|---|
| 1439 | 1486 | * This routine is a callback routine for input read the IR protocol type(s). |
|---|
| 1440 | | - * it is trigged by reading /sys/class/rc/rc?/wakeup_protocols. |
|---|
| 1487 | + * it is triggered by reading /sys/class/rc/rc?/wakeup_protocols. |
|---|
| 1441 | 1488 | * It returns the protocol names of supported protocols. |
|---|
| 1442 | 1489 | * The enabled protocols are printed in brackets. |
|---|
| 1443 | 1490 | * |
|---|
| .. | .. |
|---|
| 1488 | 1535 | * @len: length of the input buffer |
|---|
| 1489 | 1536 | * |
|---|
| 1490 | 1537 | * This routine is for changing the IR protocol type. |
|---|
| 1491 | | - * It is trigged by writing to /sys/class/rc/rc?/wakeup_protocols. |
|---|
| 1538 | + * It is triggered by writing to /sys/class/rc/rc?/wakeup_protocols. |
|---|
| 1492 | 1539 | * Returns @len on success or a negative error code. |
|---|
| 1493 | 1540 | * |
|---|
| 1494 | 1541 | * dev->lock is taken to guard against races between |
|---|
| .. | .. |
|---|
| 1499 | 1546 | const char *buf, size_t len) |
|---|
| 1500 | 1547 | { |
|---|
| 1501 | 1548 | struct rc_dev *dev = to_rc_dev(device); |
|---|
| 1502 | | - enum rc_proto protocol; |
|---|
| 1549 | + enum rc_proto protocol = RC_PROTO_UNKNOWN; |
|---|
| 1503 | 1550 | ssize_t rc; |
|---|
| 1504 | 1551 | u64 allowed; |
|---|
| 1505 | 1552 | int i; |
|---|
| .. | .. |
|---|
| 1512 | 1559 | |
|---|
| 1513 | 1560 | allowed = dev->allowed_wakeup_protocols; |
|---|
| 1514 | 1561 | |
|---|
| 1515 | | - if (sysfs_streq(buf, "none")) { |
|---|
| 1516 | | - protocol = RC_PROTO_UNKNOWN; |
|---|
| 1517 | | - } else { |
|---|
| 1562 | + if (!sysfs_streq(buf, "none")) { |
|---|
| 1518 | 1563 | for (i = 0; i < ARRAY_SIZE(protocols); i++) { |
|---|
| 1519 | 1564 | if ((allowed & (1ULL << i)) && |
|---|
| 1520 | 1565 | sysfs_streq(buf, protocols[i].name)) { |
|---|
| .. | .. |
|---|
| 1769 | 1814 | dev->enabled_protocols = rc_proto; |
|---|
| 1770 | 1815 | } |
|---|
| 1771 | 1816 | |
|---|
| 1817 | + /* Keyboard events */ |
|---|
| 1772 | 1818 | set_bit(EV_KEY, dev->input_dev->evbit); |
|---|
| 1773 | 1819 | set_bit(EV_REP, dev->input_dev->evbit); |
|---|
| 1774 | 1820 | set_bit(EV_MSC, dev->input_dev->evbit); |
|---|
| 1775 | 1821 | set_bit(MSC_SCAN, dev->input_dev->mscbit); |
|---|
| 1822 | + |
|---|
| 1823 | + /* Pointer/mouse events */ |
|---|
| 1824 | + set_bit(INPUT_PROP_POINTING_STICK, dev->input_dev->propbit); |
|---|
| 1825 | + set_bit(EV_REL, dev->input_dev->evbit); |
|---|
| 1826 | + set_bit(REL_X, dev->input_dev->relbit); |
|---|
| 1827 | + set_bit(REL_Y, dev->input_dev->relbit); |
|---|
| 1828 | + |
|---|
| 1776 | 1829 | if (dev->open) |
|---|
| 1777 | 1830 | dev->input_dev->open = ir_open; |
|---|
| 1778 | 1831 | if (dev->close) |
|---|
| .. | .. |
|---|
| 1893 | 1946 | * keycodes with rc_keydown, so lirc must be registered first. |
|---|
| 1894 | 1947 | */ |
|---|
| 1895 | 1948 | if (dev->allowed_protocols != RC_PROTO_BIT_CEC) { |
|---|
| 1896 | | - rc = ir_lirc_register(dev); |
|---|
| 1949 | + rc = lirc_register(dev); |
|---|
| 1897 | 1950 | if (rc < 0) |
|---|
| 1898 | 1951 | goto out_dev; |
|---|
| 1899 | 1952 | } |
|---|
| .. | .. |
|---|
| 1919 | 1972 | rc_free_rx_device(dev); |
|---|
| 1920 | 1973 | out_lirc: |
|---|
| 1921 | 1974 | if (dev->allowed_protocols != RC_PROTO_BIT_CEC) |
|---|
| 1922 | | - ir_lirc_unregister(dev); |
|---|
| 1975 | + lirc_unregister(dev); |
|---|
| 1923 | 1976 | out_dev: |
|---|
| 1924 | 1977 | device_del(&dev->dev); |
|---|
| 1925 | 1978 | out_rx_free: |
|---|
| .. | .. |
|---|
| 1983 | 2036 | * that userspace polling will get notified. |
|---|
| 1984 | 2037 | */ |
|---|
| 1985 | 2038 | if (dev->allowed_protocols != RC_PROTO_BIT_CEC) |
|---|
| 1986 | | - ir_lirc_unregister(dev); |
|---|
| 2039 | + lirc_unregister(dev); |
|---|
| 1987 | 2040 | |
|---|
| 1988 | 2041 | device_del(&dev->dev); |
|---|
| 1989 | 2042 | |
|---|
| .. | .. |
|---|
| 2011 | 2064 | if (rc) { |
|---|
| 2012 | 2065 | pr_err("rc_core: unable to init lirc\n"); |
|---|
| 2013 | 2066 | class_unregister(&rc_class); |
|---|
| 2014 | | - return 0; |
|---|
| 2067 | + return rc; |
|---|
| 2015 | 2068 | } |
|---|
| 2016 | 2069 | |
|---|
| 2017 | 2070 | led_trigger_register_simple("rc-feedback", &led_feedback); |
|---|
| 2018 | 2071 | rc_map_register(&empty_map); |
|---|
| 2072 | +#ifdef CONFIG_MEDIA_CEC_RC |
|---|
| 2073 | + rc_map_register(&cec_map); |
|---|
| 2074 | +#endif |
|---|
| 2019 | 2075 | |
|---|
| 2020 | 2076 | return 0; |
|---|
| 2021 | 2077 | } |
|---|
| .. | .. |
|---|
| 2025 | 2081 | lirc_dev_exit(); |
|---|
| 2026 | 2082 | class_unregister(&rc_class); |
|---|
| 2027 | 2083 | led_trigger_unregister_simple(led_feedback); |
|---|
| 2084 | +#ifdef CONFIG_MEDIA_CEC_RC |
|---|
| 2085 | + rc_map_unregister(&cec_map); |
|---|
| 2086 | +#endif |
|---|
| 2028 | 2087 | rc_map_unregister(&empty_map); |
|---|
| 2029 | 2088 | } |
|---|
| 2030 | 2089 | |
|---|