summaryrefslogtreecommitdiff
path: root/drivers/hid/wacom.h
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2016-07-13 18:06:00 +0200
committerJiri Kosina <jkosina@suse.cz>2016-08-05 13:39:15 +0200
commita50aac7193f18a5a997588556f1212b0d1ba029b (patch)
tree1132bcbeec19d5d9b19aa5baf80346c2c179d100 /drivers/hid/wacom.h
parent1c817c83e8ccea5f710d3c0d38edcfd362654ba2 (diff)
HID: wacom: leds: dynamically allocate LED groups
We need to add an action to ensure wacom->led.groups is null when wacom_led_control() gets called after the resources has been freed. This also prevents to send a LED command when there is no support from the device. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/wacom.h')
-rw-r--r--drivers/hid/wacom.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/hid/wacom.h b/drivers/hid/wacom.h
index bcfeb517221e..8ac1eb8a4382 100644
--- a/drivers/hid/wacom.h
+++ b/drivers/hid/wacom.h
@@ -110,6 +110,10 @@ enum wacom_worker {
WACOM_WORKER_BATTERY,
};
+struct wacom_group_leds {
+ u8 select; /* status led selector (0..3) */
+};
+
struct wacom {
struct usb_device *usbdev;
struct usb_interface *intf;
@@ -118,8 +122,8 @@ struct wacom {
struct mutex lock;
struct work_struct wireless_work;
struct work_struct battery_work;
- struct wacom_led {
- u8 select[5]; /* status led selector (0..3) */
+ struct wacom_leds {
+ struct wacom_group_leds *groups;
u8 llv; /* status led brightness no button (1..127) */
u8 hlv; /* status led brightness button pressed (1..127) */
u8 img_lum; /* OLED matrix display brightness */