aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2016-07-03 11:33:04 -0400
committerJiri Kosina <jkosina@suse.cz>2016-07-07 05:17:11 -0400
commit34d9810b316b6de11a801a30339c070d1798a7b0 (patch)
treefdfc5247378c3d301a09c4feb9a77e98d4ac0ca7
parent38b09c030b91c368a839b4783abab51a9745a633 (diff)
HID: hid-led: remove report id from struct hidled_config
Delcom uses the report id to submit command information. To be able to use the hidled framework also for Delcom devices we have to remove the report id from struct hidled_config. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-led.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/hid/hid-led.c b/drivers/hid/hid-led.c
index e11b6455429b..fce2a03cb647 100644
--- a/drivers/hid/hid-led.c
+++ b/drivers/hid/hid-led.c
@@ -54,7 +54,6 @@ struct hidled_config {
54 int num_leds; 54 int num_leds;
55 size_t report_size; 55 size_t report_size;
56 enum hidled_report_type report_type; 56 enum hidled_report_type report_type;
57 u8 report_id;
58 int (*init)(struct hidled_device *ldev); 57 int (*init)(struct hidled_device *ldev);
59 int (*write)(struct led_classdev *cdev, enum led_brightness br); 58 int (*write)(struct led_classdev *cdev, enum led_brightness br);
60}; 59};
@@ -93,8 +92,6 @@ static int hidled_send(struct hidled_device *ldev, __u8 *buf)
93{ 92{
94 int ret; 93 int ret;
95 94
96 buf[0] = ldev->config->report_id;
97
98 mutex_lock(&ldev->lock); 95 mutex_lock(&ldev->lock);
99 96
100 if (ldev->config->report_type == RAW_REQUEST) 97 if (ldev->config->report_type == RAW_REQUEST)
@@ -124,8 +121,6 @@ static int hidled_recv(struct hidled_device *ldev, __u8 *buf)
124 if (ldev->config->report_type != RAW_REQUEST) 121 if (ldev->config->report_type != RAW_REQUEST)
125 return -EINVAL; 122 return -EINVAL;
126 123
127 buf[0] = ldev->config->report_id;
128
129 mutex_lock(&ldev->lock); 124 mutex_lock(&ldev->lock);
130 125
131 ret = hid_hw_raw_request(ldev->hdev, buf[0], buf, 126 ret = hid_hw_raw_request(ldev->hdev, buf[0], buf,
@@ -203,7 +198,7 @@ static int _thingm_write(struct led_classdev *cdev, enum led_brightness br,
203 u8 offset) 198 u8 offset)
204{ 199{
205 struct hidled_led *led = to_hidled_led(cdev); 200 struct hidled_led *led = to_hidled_led(cdev);
206 __u8 buf[MAX_REPORT_SIZE] = { [1] = 'c' }; 201 __u8 buf[MAX_REPORT_SIZE] = { 1, 'c' };
207 202
208 buf[2] = led->rgb->red.cdev.brightness; 203 buf[2] = led->rgb->red.cdev.brightness;
209 buf[3] = led->rgb->green.cdev.brightness; 204 buf[3] = led->rgb->green.cdev.brightness;
@@ -230,13 +225,12 @@ static const struct hidled_config hidled_config_thingm_v1 = {
230 .num_leds = 1, 225 .num_leds = 1,
231 .report_size = 9, 226 .report_size = 9,
232 .report_type = RAW_REQUEST, 227 .report_type = RAW_REQUEST,
233 .report_id = 1,
234 .write = thingm_write_v1, 228 .write = thingm_write_v1,
235}; 229};
236 230
237static int thingm_init(struct hidled_device *ldev) 231static int thingm_init(struct hidled_device *ldev)
238{ 232{
239 __u8 buf[MAX_REPORT_SIZE] = { [1] = 'v' }; 233 __u8 buf[MAX_REPORT_SIZE] = { 1, 'v' };
240 int ret; 234 int ret;
241 235
242 ret = hidled_recv(ldev, buf); 236 ret = hidled_recv(ldev, buf);
@@ -259,7 +253,6 @@ static const struct hidled_config hidled_configs[] = {
259 .num_leds = 1, 253 .num_leds = 1,
260 .report_size = 6, 254 .report_size = 6,
261 .report_type = OUTPUT_REPORT, 255 .report_type = OUTPUT_REPORT,
262 .report_id = 0,
263 .write = riso_kagaku_write, 256 .write = riso_kagaku_write,
264 }, 257 },
265 { 258 {
@@ -270,7 +263,6 @@ static const struct hidled_config hidled_configs[] = {
270 .num_leds = 1, 263 .num_leds = 1,
271 .report_size = 9, 264 .report_size = 9,
272 .report_type = RAW_REQUEST, 265 .report_type = RAW_REQUEST,
273 .report_id = 0,
274 .init = dream_cheeky_init, 266 .init = dream_cheeky_init,
275 .write = dream_cheeky_write, 267 .write = dream_cheeky_write,
276 }, 268 },
@@ -282,7 +274,6 @@ static const struct hidled_config hidled_configs[] = {
282 .num_leds = 2, 274 .num_leds = 2,
283 .report_size = 9, 275 .report_size = 9,
284 .report_type = RAW_REQUEST, 276 .report_type = RAW_REQUEST,
285 .report_id = 1,
286 .init = thingm_init, 277 .init = thingm_init,
287 .write = thingm_write, 278 .write = thingm_write,
288 }, 279 },