From 84dfbd7f2a58c8c79ba7947159fc5f2c521348f6 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 13 Jul 2016 18:05:55 +0200 Subject: HID: wacom: put the managed resources in a group We currently have a complex clean_inputs() function while this can be handled all by devres. Set a group that we can destroy in wireless_work(). Signed-off-by: Benjamin Tissoires Acked-by: Ping Cheng Signed-off-by: Jiri Kosina --- drivers/hid/wacom_wac.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/hid/wacom_wac.h') diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 53d16537fd2a..d5b973d0567c 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -234,9 +234,6 @@ struct wacom_wac { struct input_dev *pen_input; struct input_dev *touch_input; struct input_dev *pad_input; - bool pen_registered; - bool touch_registered; - bool pad_registered; int pid; int battery_capacity; int num_contacts_left; -- cgit v1.2.1 From e6f2813a6d3fd924a399f8b19bcd8b11487155bc Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 13 Jul 2016 18:06:01 +0200 Subject: HID: wacom: EKR: add a worker to add/remove resources on addition/removal wacom_remote_status_irq() sends information of addition/removal of EKR. We want to allocate one input node per remote, so better having this in a separate worker, not handled in the IRQ directly. Signed-off-by: Benjamin Tissoires Acked-by: Ping Cheng Signed-off-by: Jiri Kosina --- drivers/hid/wacom_wac.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/hid/wacom_wac.h') diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index d5b973d0567c..c2c65b8c71c1 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -218,6 +218,13 @@ struct hid_data { int num_received; }; +struct wacom_remote_data { + struct { + u32 serial; + bool connected; + } remote[WACOM_MAX_REMOTES]; +}; + struct wacom_wac { char pen_name[WACOM_NAME_MAX]; char touch_name[WACOM_NAME_MAX]; -- cgit v1.2.1 From 83e6b40e2de6f8416ce6c8c3ca6c4bc8acfa8b32 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 13 Jul 2016 18:06:02 +0200 Subject: HID: wacom: EKR: have the wacom resources dynamically allocated If we want to have one input device per remote, it's better to have our own struct wacom_remote which is dynamically allocated. Signed-off-by: Benjamin Tissoires Acked-by: Ping Cheng Signed-off-by: Jiri Kosina --- drivers/hid/wacom_wac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/hid/wacom_wac.h') diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index c2c65b8c71c1..6be6cae0d093 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -234,7 +234,7 @@ struct wacom_wac { unsigned char data[WACOM_PKGLEN_MAX]; int tool[2]; int id[2]; - __u32 serial[5]; + __u32 serial[2]; bool reporting_data; struct wacom_features features; struct wacom_shared *shared; -- cgit v1.2.1 From 59d69bc8215478af6b89d4ae9ab0baf6d91eb870 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 13 Jul 2016 18:06:08 +0200 Subject: HID: wacom: EKR: have one power_supply per remote Previously, all the remotes attached to the same receiver would share the same power_supply. That's not good as the remotes will constantly change the battery information according to their own state. To have something generic enough, we introduce struct wacom_battery which regroups all the information we need for a battery. Signed-off-by: Benjamin Tissoires Acked-by: Ping Cheng Signed-off-by: Jiri Kosina --- drivers/hid/wacom_wac.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'drivers/hid/wacom_wac.h') diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 6be6cae0d093..8a8974c901cb 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -229,8 +229,6 @@ struct wacom_wac { char pen_name[WACOM_NAME_MAX]; char touch_name[WACOM_NAME_MAX]; char pad_name[WACOM_NAME_MAX]; - char bat_name[WACOM_NAME_MAX]; - char ac_name[WACOM_NAME_MAX]; unsigned char data[WACOM_PKGLEN_MAX]; int tool[2]; int id[2]; @@ -242,11 +240,7 @@ struct wacom_wac { struct input_dev *touch_input; struct input_dev *pad_input; int pid; - int battery_capacity; int num_contacts_left; - int bat_charging; - int bat_connected; - int ps_connected; u8 bt_features; u8 bt_high_speed; int mode_report; -- cgit v1.2.1 From 9956953ec082e9353ee0828538ff37b149cc91c9 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Wed, 13 Jul 2016 18:06:17 +0200 Subject: HID: wacom: power_supply: provide the actual model_name Instead of displaying a generic "tablet", now g-c-c shows a pretty "Wacom Intuos Pro S (WL)". Signed-off-by: Benjamin Tissoires Acked-by: Ping Cheng Signed-off-by: Jiri Kosina --- drivers/hid/wacom_wac.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/hid/wacom_wac.h') diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 8a8974c901cb..745e2c91cb55 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -226,6 +226,7 @@ struct wacom_remote_data { }; struct wacom_wac { + char name[WACOM_NAME_MAX]; char pen_name[WACOM_NAME_MAX]; char touch_name[WACOM_NAME_MAX]; char pad_name[WACOM_NAME_MAX]; -- cgit v1.2.1 From e5bc8eb1b02244be4e97e9654d394275e615923a Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Mon, 8 Aug 2016 12:06:29 -0700 Subject: HID: wacom: Add WACOM_DEVICETYPE_DIRECT for Cintiqs and similar "Direct" input devices like Cintiqs and Tablet PCs set the INPUT_PROP_DIRECT property to notify userspace that the sensor and screen are overlaid. This information can also be useful elsewhere within the kernel driver, however, so we introduce a new WACOM_DEVICETYPE_DIRECT that signals this to other kernel code. Signed-off-by: Jason Gerecke Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- drivers/hid/wacom_wac.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/hid/wacom_wac.h') diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 745e2c91cb55..de5d1adafc6b 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -82,6 +82,7 @@ #define WACOM_DEVICETYPE_TOUCH 0x0002 #define WACOM_DEVICETYPE_PAD 0x0004 #define WACOM_DEVICETYPE_WL_MONITOR 0x0008 +#define WACOM_DEVICETYPE_DIRECT 0x0010 #define WACOM_VENDORDEFINED_PEN 0xff0d0001 #define WACOM_G9_PAGE 0xff090000 -- cgit v1.2.1