summaryrefslogtreecommitdiff
path: root/drivers/hid/wacom.h
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2016-07-13 19:06:01 +0300
committerJiri Kosina <jkosina@suse.cz>2016-08-05 14:39:16 +0300
commite6f2813a6d3fd924a399f8b19bcd8b11487155bc (patch)
tree38e49d6df64ecdfc907a2d2baf605788f51cdbd7 /drivers/hid/wacom.h
parenta50aac7193f18a5a997588556f1212b0d1ba029b (diff)
downloadlinux-e6f2813a6d3fd924a399f8b19bcd8b11487155bc.tar.xz
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 <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.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hid/wacom.h b/drivers/hid/wacom.h
index 8ac1eb8a4382..1797e4b3662a 100644
--- a/drivers/hid/wacom.h
+++ b/drivers/hid/wacom.h
@@ -90,6 +90,7 @@
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/hid.h>
+#include <linux/kfifo.h>
#include <linux/usb/input.h>
#include <linux/power_supply.h>
#include <asm/unaligned.h>
@@ -108,6 +109,7 @@
enum wacom_worker {
WACOM_WORKER_WIRELESS,
WACOM_WORKER_BATTERY,
+ WACOM_WORKER_REMOTE,
};
struct wacom_group_leds {
@@ -122,6 +124,9 @@ struct wacom {
struct mutex lock;
struct work_struct wireless_work;
struct work_struct battery_work;
+ struct work_struct remote_work;
+ spinlock_t remote_lock;
+ struct kfifo remote_fifo;
struct wacom_leds {
struct wacom_group_leds *groups;
u8 llv; /* status led brightness no button (1..127) */
@@ -149,6 +154,9 @@ static inline void wacom_schedule_work(struct wacom_wac *wacom_wac,
case WACOM_WORKER_BATTERY:
schedule_work(&wacom->battery_work);
break;
+ case WACOM_WORKER_REMOTE:
+ schedule_work(&wacom->remote_work);
+ break;
}
}
@@ -168,7 +176,4 @@ int wacom_wac_event(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value);
void wacom_wac_report(struct hid_device *hdev, struct hid_report *report);
void wacom_battery_work(struct work_struct *work);
-int wacom_remote_create_attr_group(struct wacom *wacom, __u32 serial,
- int index);
-void wacom_remote_destroy_attr_group(struct wacom *wacom, __u32 serial);
#endif