Commit bdb829e1 authored by David Herrmann's avatar David Herrmann Committed by Jiri Kosina

HID: uhid: use generic hidinput_input_event()

HID core provides the same functionality and can convert the input event
to a raw output report. We can thus drop UHID_OUTPUT_EV and rely on the
mandatory UHID_OUTPUT.

User-space wasn't able to do anything with UHID_OUTPUT_EV, anyway. They
don't have access to the report fields.
Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
Acked-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent ac126f46
...@@ -149,11 +149,13 @@ needs. Only UHID_OUTPUT and UHID_OUTPUT_EV have payloads. ...@@ -149,11 +149,13 @@ needs. Only UHID_OUTPUT and UHID_OUTPUT_EV have payloads.
is of type "struct uhid_data_req". is of type "struct uhid_data_req".
This may be received even though you haven't received UHID_OPEN, yet. This may be received even though you haven't received UHID_OPEN, yet.
UHID_OUTPUT_EV: UHID_OUTPUT_EV (obsolete):
Same as UHID_OUTPUT but this contains a "struct input_event" as payload. This Same as UHID_OUTPUT but this contains a "struct input_event" as payload. This
is called for force-feedback, LED or similar events which are received through is called for force-feedback, LED or similar events which are received through
an input device by the HID subsystem. You should convert this into raw reports an input device by the HID subsystem. You should convert this into raw reports
and send them to your device similar to events of type UHID_OUTPUT. and send them to your device similar to events of type UHID_OUTPUT.
This is no longer sent by newer kernels. Instead, HID core converts it into a
raw output report and sends it via UHID_OUTPUT.
UHID_FEATURE: UHID_FEATURE:
This event is sent if the kernel driver wants to perform a feature request as This event is sent if the kernel driver wants to perform a feature request as
......
...@@ -116,30 +116,6 @@ static void uhid_hid_close(struct hid_device *hid) ...@@ -116,30 +116,6 @@ static void uhid_hid_close(struct hid_device *hid)
uhid_queue_event(uhid, UHID_CLOSE); uhid_queue_event(uhid, UHID_CLOSE);
} }
static int uhid_hid_input(struct input_dev *input, unsigned int type,
unsigned int code, int value)
{
struct hid_device *hid = input_get_drvdata(input);
struct uhid_device *uhid = hid->driver_data;
unsigned long flags;
struct uhid_event *ev;
ev = kzalloc(sizeof(*ev), GFP_ATOMIC);
if (!ev)
return -ENOMEM;
ev->type = UHID_OUTPUT_EV;
ev->u.output_ev.type = type;
ev->u.output_ev.code = code;
ev->u.output_ev.value = value;
spin_lock_irqsave(&uhid->qlock, flags);
uhid_queue(uhid, ev);
spin_unlock_irqrestore(&uhid->qlock, flags);
return 0;
}
static int uhid_hid_parse(struct hid_device *hid) static int uhid_hid_parse(struct hid_device *hid)
{ {
struct uhid_device *uhid = hid->driver_data; struct uhid_device *uhid = hid->driver_data;
...@@ -273,7 +249,6 @@ static struct hid_ll_driver uhid_hid_driver = { ...@@ -273,7 +249,6 @@ static struct hid_ll_driver uhid_hid_driver = {
.stop = uhid_hid_stop, .stop = uhid_hid_stop,
.open = uhid_hid_open, .open = uhid_hid_open,
.close = uhid_hid_close, .close = uhid_hid_close,
.hidinput_input_event = uhid_hid_input,
.parse = uhid_hid_parse, .parse = uhid_hid_parse,
}; };
......
...@@ -30,7 +30,7 @@ enum uhid_event_type { ...@@ -30,7 +30,7 @@ enum uhid_event_type {
UHID_OPEN, UHID_OPEN,
UHID_CLOSE, UHID_CLOSE,
UHID_OUTPUT, UHID_OUTPUT,
UHID_OUTPUT_EV, UHID_OUTPUT_EV, /* obsolete! */
UHID_INPUT, UHID_INPUT,
UHID_FEATURE, UHID_FEATURE,
UHID_FEATURE_ANSWER, UHID_FEATURE_ANSWER,
...@@ -69,6 +69,8 @@ struct uhid_output_req { ...@@ -69,6 +69,8 @@ struct uhid_output_req {
__u8 rtype; __u8 rtype;
} __attribute__((__packed__)); } __attribute__((__packed__));
/* Obsolete! Newer kernels will no longer send these events but instead convert
* it into raw output reports via UHID_OUTPUT. */
struct uhid_output_ev_req { struct uhid_output_ev_req {
__u16 type; __u16 type;
__u16 code; __u16 code;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment