Guest User

Untitled

a guest
Oct 19th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.48 KB | None | 0 0
  1. diff -Naur linux-4.4-orig/drivers/hid/hid-core.c linux-4.4/drivers/hid/hid-core.c
  2. --- linux-4.4-orig/drivers/hid/hid-core.c   2016-01-11 00:01:32.000000000 +0100
  3. +++ linux-4.4/drivers/hid/hid-core.c    2017-10-17 16:35:17.723489780 +0200
  4. @@ -1963,6 +1963,9 @@
  5.     { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
  6.     { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },
  7.     { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
  8. +        { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_1) },
  9. +        { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_2) },
  10. +        { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS, USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_3) },   
  11.     { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
  12.     { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
  13.  #if IS_ENABLED(CONFIG_HID_ROCCAT)
  14. diff -Naur linux-4.4-orig/drivers/hid/hid-ids.h linux-4.4/drivers/hid/hid-ids.h
  15. --- linux-4.4-orig/drivers/hid/hid-ids.h    2016-01-11 00:01:32.000000000 +0100
  16. +++ linux-4.4/drivers/hid/hid-ids.h 2017-10-17 16:28:54.601589981 +0200
  17. @@ -774,6 +774,9 @@
  18.  
  19.  #define USB_VENDOR_ID_PHILIPS      0x0471
  20.  #define USB_DEVICE_ID_PHILIPS_IEEE802154_DONGLE 0x0617
  21. +#define USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_1    0x206c
  22. +#define USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_2    0x20cc
  23. +#define USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_3    0x0613
  24.  
  25.  #define USB_VENDOR_ID_PI_ENGINEERING   0x05f3
  26.  #define USB_DEVICE_ID_PI_ENGINEERING_VEC_USB_FOOTPEDAL 0xff
  27. diff -Naur linux-4.4-orig/drivers/hid/hid-spinelplus.c linux-4.4/drivers/hid/hid-spinelplus.c
  28. --- linux-4.4-orig/drivers/hid/hid-spinelplus.c 1970-01-01 01:00:00.000000000 +0100
  29. +++ linux-4.4/drivers/hid/hid-spinelplus.c  2017-10-17 16:28:54.601589981 +0200
  30. @@ -0,0 +1,104 @@
  31. +/*
  32. + *  HID driver for "PHILIPS MCE USB IR Receiver- Spinel plus" remotes
  33. + *
  34. + *  Copyright (c) 2010 Panagiotis Skintzos
  35. + *
  36. + *  Renamed to Spinel, cleanup and modified to also support
  37. + *  Spinel Plus 0471:20CC by Stephan Raue 2012.
  38. + */
  39. +
  40. +/*
  41. + * This program is free software; you can redistribute it and/or modify it
  42. + * under the terms of the GNU General Public License as published by the Free
  43. + * Software Foundation; either version 2 of the License, or (at your option)
  44. + * any later version.
  45. + */
  46. +
  47. +#include <linux/device.h>
  48. +#include <linux/input.h>
  49. +#include <linux/hid.h>
  50. +#include <linux/module.h>
  51. +
  52. +#include "hid-ids.h"
  53. +
  54. +#define spinelplus_map_key(c)    set_bit(EV_REP, hi->input->evbit); \
  55. +                        hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c))
  56. +
  57. +static int spinelplus_input_mapping(struct hid_device *hdev,
  58. +        struct hid_input *hi, struct hid_field *field, struct hid_usage *usage,
  59. +        unsigned long **bit, int *max)
  60. +{
  61. +    switch (usage->hid) {
  62. +    case 0xffbc000d:    spinelplus_map_key(KEY_MEDIA);        break;
  63. +    case 0xffbc0024:    spinelplus_map_key(KEY_MEDIA);        break;
  64. +    case 0xffbc0027:    spinelplus_map_key(KEY_ZOOM);        break;
  65. +    case 0xffbc0033:    spinelplus_map_key(KEY_HOME);        break;
  66. +    case 0xffbc0035:    spinelplus_map_key(KEY_CAMERA);        break;
  67. +    case 0xffbc0036:    spinelplus_map_key(KEY_EPG);        break;
  68. +    case 0xffbc0037:    spinelplus_map_key(KEY_DVD);        break;
  69. +    case 0xffbc0038:    spinelplus_map_key(KEY_HOME);        break;
  70. +    case 0xffbc0039:    spinelplus_map_key(KEY_MP3);        break;
  71. +    case 0xffbc003a:    spinelplus_map_key(KEY_VIDEO);        break;
  72. +    case 0xffbc005a:    spinelplus_map_key(KEY_TEXT);        break;
  73. +    case 0xffbc005b:    spinelplus_map_key(KEY_RED);        break;
  74. +    case 0xffbc005c:    spinelplus_map_key(KEY_GREEN);        break;
  75. +    case 0xffbc005d:    spinelplus_map_key(KEY_YELLOW);        break;
  76. +    case 0xffbc005e:    spinelplus_map_key(KEY_BLUE);        break;
  77. +    default:
  78. +        return 0;
  79. +    }
  80. +    return 1;
  81. +}
  82. +
  83. +static int spinelplus_probe(struct hid_device *hdev,
  84. +        const struct hid_device_id *id)
  85. +{
  86. +    int ret;
  87. +    /* Connect only to hid input (not hiddev & hidraw)*/
  88. +    unsigned int cmask = HID_CONNECT_HIDINPUT;
  89. +
  90. +    ret = hid_parse(hdev);
  91. +    if (ret) {
  92. +        dev_err(&hdev->dev, "parse failed\n");
  93. +        goto err_free;
  94. +    }
  95. +
  96. +    ret = hid_hw_start(hdev, cmask);
  97. +    if (ret) {
  98. +        dev_err(&hdev->dev, "hw start failed\n");
  99. +        goto err_free;
  100. +    }
  101. +
  102. +    return 0;
  103. +err_free:
  104. +    return ret;
  105. +}
  106. +
  107. +static const struct hid_device_id spinelplus_devices[] = {
  108. +    { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS,USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_1) },
  109. +    { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS,USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_2) },
  110. +    { HID_USB_DEVICE(USB_VENDOR_ID_PHILIPS,USB_DEVICE_ID_PHILIPS_SPINEL_PLUS_3) },
  111. +    { }
  112. +};
  113. +MODULE_DEVICE_TABLE(hid, spinelplus_devices);
  114. +
  115. +static struct hid_driver spinelplus_driver = {
  116. +    .name =         "SpinelPlus",
  117. +    .id_table =         spinelplus_devices,
  118. +    .input_mapping =     spinelplus_input_mapping,
  119. +    .probe =         spinelplus_probe,
  120. +};
  121. +
  122. +static int __init spinelplus_init(void)
  123. +{
  124. +    return hid_register_driver(&spinelplus_driver);
  125. +}
  126. +
  127. +static void __exit spinelplus_exit(void)
  128. +{
  129. +    hid_unregister_driver(&spinelplus_driver);
  130. +}
  131. +
  132. +module_init(spinelplus_init);
  133. +module_exit(spinelplus_exit);
  134. +MODULE_LICENSE("GPL");
  135. diff -Naur linux-4.4-orig/drivers/hid/Kconfig linux-4.4/drivers/hid/Kconfig
  136. --- linux-4.4-orig/drivers/hid/Kconfig  2016-01-11 00:01:32.000000000 +0100
  137. +++ linux-4.4/drivers/hid/Kconfig   2017-10-17 16:28:54.601589981 +0200
  138. @@ -732,6 +732,12 @@
  139.     ---help---
  140.     Support for Steelseries SRW-S1 steering wheel
  141.  
  142. +config HID_SPINELPLUS
  143. +    tristate "Spinel Plus remote control"
  144. +    depends on USB_HID
  145. +    ---help---
  146. +      Say Y here if you have a Spinel Plus (0471:206c/20cc/0613) remote
  147. +
  148.  config HID_SUNPLUS
  149.     tristate "Sunplus wireless desktop"
  150.     depends on HID
  151. diff -Naur linux-4.4-orig/drivers/hid/Makefile linux-4.4/drivers/hid/Makefile
  152. --- linux-4.4-orig/drivers/hid/Makefile 2016-01-11 00:01:32.000000000 +0100
  153. +++ linux-4.4/drivers/hid/Makefile  2017-10-17 16:40:04.936913994 +0200
  154. @@ -85,6 +85,7 @@
  155.  obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o
  156.  obj-$(CONFIG_HID_SONY)     += hid-sony.o
  157.  obj-$(CONFIG_HID_SPEEDLINK)    += hid-speedlink.o
  158. +obj-$(CONFIG_HID_SPINELPLUS)    += hid-spinelplus.o
  159.  obj-$(CONFIG_HID_STEELSERIES)  += hid-steelseries.o
  160.  obj-$(CONFIG_HID_SUNPLUS)  += hid-sunplus.o
  161.  obj-$(CONFIG_HID_GREENASIA)    += hid-gaff.o
Advertisement
Add Comment
Please, Sign In to add comment