aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-samsung.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-samsung.c')
-rw-r--r--drivers/hid/hid-samsung.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c
index 5b222eed0692..510dd1340597 100644
--- a/drivers/hid/hid-samsung.c
+++ b/drivers/hid/hid-samsung.c
@@ -39,7 +39,17 @@
39 * 39 *
40 * 3. 135 byte report descriptor 40 * 3. 135 byte report descriptor
41 * Report #4 has an array field with logical range 0..17 instead of 1..14. 41 * Report #4 has an array field with logical range 0..17 instead of 1..14.
42 *
43 * 4. 171 byte report descriptor
44 * Report #3 has an array field with logical range 0..1 instead of 1..3.
42 */ 45 */
46static inline void samsung_dev_trace(struct hid_device *hdev,
47 unsigned int rsize)
48{
49 dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report "
50 "descriptor\n", rsize);
51}
52
43static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, 53static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
44 unsigned int rsize) 54 unsigned int rsize)
45{ 55{
@@ -47,8 +57,7 @@ static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
47 rdesc[177] == 0x75 && rdesc[178] == 0x30 && 57 rdesc[177] == 0x75 && rdesc[178] == 0x30 &&
48 rdesc[179] == 0x95 && rdesc[180] == 0x01 && 58 rdesc[179] == 0x95 && rdesc[180] == 0x01 &&
49 rdesc[182] == 0x40) { 59 rdesc[182] == 0x40) {
50 dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " 60 samsung_dev_trace(hdev, 184);
51 "descriptor\n", 184);
52 rdesc[176] = 0xff; 61 rdesc[176] = 0xff;
53 rdesc[178] = 0x08; 62 rdesc[178] = 0x08;
54 rdesc[180] = 0x06; 63 rdesc[180] = 0x06;
@@ -56,17 +65,21 @@ static void samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
56 } else 65 } else
57 if (rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 && 66 if (rsize == 203 && rdesc[192] == 0x15 && rdesc[193] == 0x0 &&
58 rdesc[194] == 0x25 && rdesc[195] == 0x12) { 67 rdesc[194] == 0x25 && rdesc[195] == 0x12) {
59 dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " 68 samsung_dev_trace(hdev, 203);
60 "descriptor\n", 203);
61 rdesc[193] = 0x1; 69 rdesc[193] = 0x1;
62 rdesc[195] = 0xf; 70 rdesc[195] = 0xf;
63 } else 71 } else
64 if (rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 && 72 if (rsize == 135 && rdesc[124] == 0x15 && rdesc[125] == 0x0 &&
65 rdesc[126] == 0x25 && rdesc[127] == 0x11) { 73 rdesc[126] == 0x25 && rdesc[127] == 0x11) {
66 dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " 74 samsung_dev_trace(hdev, 135);
67 "descriptor\n", 135);
68 rdesc[125] = 0x1; 75 rdesc[125] = 0x1;
69 rdesc[127] = 0xe; 76 rdesc[127] = 0xe;
77 } else
78 if (rsize == 171 && rdesc[160] == 0x15 && rdesc[161] == 0x0 &&
79 rdesc[162] == 0x25 && rdesc[163] == 0x01) {
80 samsung_dev_trace(hdev, 171);
81 rdesc[161] = 0x1;
82 rdesc[163] = 0x3;
70 } 83 }
71} 84}
72 85