hid-zydacron.c (d834a9dcecae834cd6b2bc5e50e1907738d9cf6a) | hid-zydacron.c (4291ee305e9bb0699504a66f0e2b7aefcf0512a5) |
---|---|
1/* 2* HID driver for zydacron remote control 3* 4* Copyright (c) 2010 Don Prince <dhprince.devel@yahoo.co.uk> 5*/ 6 7/* 8* This program is free software; you can redistribute it and/or modify it --- 20 unchanged lines hidden (view full) --- 29*/ 30static __u8 *zc_report_fixup(struct hid_device *hdev, __u8 *rdesc, 31 unsigned int *rsize) 32{ 33 if (*rsize >= 253 && 34 rdesc[0x96] == 0xbc && rdesc[0x97] == 0xff && 35 rdesc[0xca] == 0xbc && rdesc[0xcb] == 0xff && 36 rdesc[0xe1] == 0xbc && rdesc[0xe2] == 0xff) { | 1/* 2* HID driver for zydacron remote control 3* 4* Copyright (c) 2010 Don Prince <dhprince.devel@yahoo.co.uk> 5*/ 6 7/* 8* This program is free software; you can redistribute it and/or modify it --- 20 unchanged lines hidden (view full) --- 29*/ 30static __u8 *zc_report_fixup(struct hid_device *hdev, __u8 *rdesc, 31 unsigned int *rsize) 32{ 33 if (*rsize >= 253 && 34 rdesc[0x96] == 0xbc && rdesc[0x97] == 0xff && 35 rdesc[0xca] == 0xbc && rdesc[0xcb] == 0xff && 36 rdesc[0xe1] == 0xbc && rdesc[0xe2] == 0xff) { |
37 dev_info(&hdev->dev, 38 "fixing up zydacron remote control report " 39 "descriptor\n"); | 37 hid_info(hdev, 38 "fixing up zydacron remote control report descriptor\n"); |
40 rdesc[0x96] = rdesc[0xca] = rdesc[0xe1] = 0x0c; 41 rdesc[0x97] = rdesc[0xcb] = rdesc[0xe2] = 0x00; 42 } 43 return rdesc; 44} 45 46#define zc_map_key_clear(c) \ 47 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c)) --- 119 unchanged lines hidden (view full) --- 167 168static int zc_probe(struct hid_device *hdev, const struct hid_device_id *id) 169{ 170 int ret; 171 struct zc_device *zc; 172 173 zc = kzalloc(sizeof(*zc), GFP_KERNEL); 174 if (zc == NULL) { | 39 rdesc[0x96] = rdesc[0xca] = rdesc[0xe1] = 0x0c; 40 rdesc[0x97] = rdesc[0xcb] = rdesc[0xe2] = 0x00; 41 } 42 return rdesc; 43} 44 45#define zc_map_key_clear(c) \ 46 hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c)) --- 119 unchanged lines hidden (view full) --- 166 167static int zc_probe(struct hid_device *hdev, const struct hid_device_id *id) 168{ 169 int ret; 170 struct zc_device *zc; 171 172 zc = kzalloc(sizeof(*zc), GFP_KERNEL); 173 if (zc == NULL) { |
175 dev_err(&hdev->dev, "zydacron: can't alloc descriptor\n"); | 174 hid_err(hdev, "can't alloc descriptor\n"); |
176 return -ENOMEM; 177 } 178 179 hid_set_drvdata(hdev, zc); 180 181 ret = hid_parse(hdev); 182 if (ret) { | 175 return -ENOMEM; 176 } 177 178 hid_set_drvdata(hdev, zc); 179 180 ret = hid_parse(hdev); 181 if (ret) { |
183 dev_err(&hdev->dev, "zydacron: parse failed\n"); | 182 hid_err(hdev, "parse failed\n"); |
184 goto err_free; 185 } 186 187 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); 188 if (ret) { | 183 goto err_free; 184 } 185 186 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); 187 if (ret) { |
189 dev_err(&hdev->dev, "zydacron: hw start failed\n"); | 188 hid_err(hdev, "hw start failed\n"); |
190 goto err_free; 191 } 192 193 return 0; 194err_free: 195 kfree(zc); 196 197 return ret; --- 41 unchanged lines hidden --- | 189 goto err_free; 190 } 191 192 return 0; 193err_free: 194 kfree(zc); 195 196 return ret; --- 41 unchanged lines hidden --- |