diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-07 08:52:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-07 08:52:04 -0700 |
commit | b4dd05dee0dbd16afdbba83b698a7110c687be2d (patch) | |
tree | 8f39c491301f4f62eacc2294a4e0825c9bf16548 /include | |
parent | 80104bb06b17497b570b11a187131dca7d445b40 (diff) | |
parent | 63b6f0b827d6b40e53bac5abc8150fa117d27bec (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID updates from Jiri Kosina:
- support for U2F Zero device, from Andrej Shadura
- logitech-dj has historically been treating devices behind
non-unifying receivers as generic devices, using the HID emulation in
the receiver. That had several shortcomings (special keys handling,
battery level monitoring, etc). The driver has been reworked to
enumarate (and directly communicate with) the devices behind the
receiver, to avoid the (too) generic HID implementation in the
receiver itself. All the work done by Benjamin Tissoires and Hans de
Goede.
- restructuring of intel-ish driver in order to allow for multiple
clients of the ISH implementation, from Srinivas Pandruvada
- several other smaller fixes and assorted device ID additions
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (68 commits)
HID: logitech-dj: fix spelling in printk
HID: input: fix assignment of .value
HID: input: make sure the wheel high resolution multiplier is set
HID: logitech-dj: add usbhid dependency in Kconfig
HID: logitech-hidpp: add support for HID++ 1.0 consumer keys reports
HID: logitech-hidpp: add support for HID++ 1.0 extra mouse buttons reports
HID: logitech-hidpp: add support for HID++ 1.0 wheel reports
HID: logitech-hidpp: make hidpp10_set_register_bit a bit more generic
HID: logitech-hidpp: add input_device ptr to struct hidpp_device
HID: logitech-hidpp: do not hardcode very long report length
HID: logitech-hidpp: handle devices attached to 27MHz wireless receivers
HID: logitech-hidpp: use RAP instead of FAP to get the protocol version
HID: logitech-hidpp: remove unused origin_is_hid_core function parameter
HID: logitech-hidpp: remove double assignment from __hidpp_send_report
HID: logitech-hidpp: do not make failure to get the name fatal
HID: logitech-hidpp: ignore very-short or empty names
HID: logitech-hidpp: make .probe usbhid capable
HID: logitech-hidpp: allow non HID++ devices to be handled by this module
HID: logitech-dj: add support for Logitech Bluetooth Mini-Receiver
HID: logitech-dj: make appending of the HID++ descriptors conditional
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hid.h | 4 | ||||
-rw-r--r-- | include/linux/intel-ish-client-if.h | 112 |
2 files changed, 115 insertions, 1 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index f9707d1dcb58..ae9da674b749 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -382,6 +382,7 @@ struct hid_item { #define HID_GROUP_WACOM 0x0101 #define HID_GROUP_LOGITECH_DJ_DEVICE 0x0102 #define HID_GROUP_STEAM 0x0103 +#define HID_GROUP_LOGITECH_27MHZ_DEVICE 0x0104 /* * HID protocol status @@ -417,6 +418,7 @@ struct hid_global { struct hid_local { unsigned usage[HID_MAX_USAGES]; /* usage array */ + u8 usage_size[HID_MAX_USAGES]; /* usage size array */ unsigned collection_index[HID_MAX_USAGES]; /* collection index array */ unsigned usage_index; unsigned usage_minimum; @@ -893,7 +895,7 @@ struct hid_field *hidinput_get_led_field(struct hid_device *hid); unsigned int hidinput_count_leds(struct hid_device *hid); __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code); void hid_output_report(struct hid_report *report, __u8 *data); -void __hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype); +int __hid_request(struct hid_device *hid, struct hid_report *rep, int reqtype); u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags); struct hid_device *hid_allocate_device(void); struct hid_report *hid_register_report(struct hid_device *device, diff --git a/include/linux/intel-ish-client-if.h b/include/linux/intel-ish-client-if.h new file mode 100644 index 000000000000..16255c2ca2f4 --- /dev/null +++ b/include/linux/intel-ish-client-if.h @@ -0,0 +1,112 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Intel ISH client Interface definitions + * + * Copyright (c) 2019, Intel Corporation. + */ + +#ifndef _INTEL_ISH_CLIENT_IF_H_ +#define _INTEL_ISH_CLIENT_IF_H_ + +struct ishtp_cl_device; +struct ishtp_device; +struct ishtp_cl; +struct ishtp_fw_client; + +/* Client state */ +enum cl_state { + ISHTP_CL_INITIALIZING = 0, + ISHTP_CL_CONNECTING, + ISHTP_CL_CONNECTED, + ISHTP_CL_DISCONNECTING, + ISHTP_CL_DISCONNECTED +}; + +/** + * struct ishtp_cl_device - ISHTP device handle + * @driver: driver instance on a bus + * @name: Name of the device for probe + * @probe: driver callback for device probe + * @remove: driver callback on device removal + * + * Client drivers defines to get probed/removed for ISHTP client device. + */ +struct ishtp_cl_driver { + struct device_driver driver; + const char *name; + const guid_t *guid; + int (*probe)(struct ishtp_cl_device *dev); + int (*remove)(struct ishtp_cl_device *dev); + int (*reset)(struct ishtp_cl_device *dev); + const struct dev_pm_ops *pm; +}; + +/** + * struct ishtp_msg_data - ISHTP message data struct + * @size: Size of data in the *data + * @data: Pointer to data + */ +struct ishtp_msg_data { + uint32_t size; + unsigned char *data; +}; + +/* + * struct ishtp_cl_rb - request block structure + * @list: Link to list members + * @cl: ISHTP client instance + * @buffer: message header + * @buf_idx: Index into buffer + * @read_time: unused at this time + */ +struct ishtp_cl_rb { + struct list_head list; + struct ishtp_cl *cl; + struct ishtp_msg_data buffer; + unsigned long buf_idx; + unsigned long read_time; +}; + +int ishtp_cl_driver_register(struct ishtp_cl_driver *driver, + struct module *owner); +void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver); +int ishtp_register_event_cb(struct ishtp_cl_device *device, + void (*read_cb)(struct ishtp_cl_device *)); + +/* Get the device * from ishtp device instance */ +struct device *ishtp_device(struct ishtp_cl_device *cl_device); +/* Trace interface for clients */ +void *ishtp_trace_callback(struct ishtp_cl_device *cl_device); +/* Get device pointer of PCI device for DMA acces */ +struct device *ishtp_get_pci_device(struct ishtp_cl_device *cl_device); + +struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device); +void ishtp_cl_free(struct ishtp_cl *cl); +int ishtp_cl_link(struct ishtp_cl *cl); +void ishtp_cl_unlink(struct ishtp_cl *cl); +int ishtp_cl_disconnect(struct ishtp_cl *cl); +int ishtp_cl_connect(struct ishtp_cl *cl); +int ishtp_cl_send(struct ishtp_cl *cl, uint8_t *buf, size_t length); +int ishtp_cl_flush_queues(struct ishtp_cl *cl); +int ishtp_cl_io_rb_recycle(struct ishtp_cl_rb *rb); +bool ishtp_cl_tx_empty(struct ishtp_cl *cl); +struct ishtp_cl_rb *ishtp_cl_rx_get_rb(struct ishtp_cl *cl); +void *ishtp_get_client_data(struct ishtp_cl *cl); +void ishtp_set_client_data(struct ishtp_cl *cl, void *data); +struct ishtp_device *ishtp_get_ishtp_device(struct ishtp_cl *cl); +void ishtp_set_tx_ring_size(struct ishtp_cl *cl, int size); +void ishtp_set_rx_ring_size(struct ishtp_cl *cl, int size); +void ishtp_set_connection_state(struct ishtp_cl *cl, int state); +void ishtp_cl_set_fw_client_id(struct ishtp_cl *cl, int fw_client_id); + +void ishtp_put_device(struct ishtp_cl_device *cl_dev); +void ishtp_get_device(struct ishtp_cl_device *cl_dev); +void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data); +void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device); +int ishtp_register_event_cb(struct ishtp_cl_device *device, + void (*read_cb)(struct ishtp_cl_device *)); +struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev, + const guid_t *uuid); +int ishtp_get_fw_client_id(struct ishtp_fw_client *fw_client); +int ish_hw_reset(struct ishtp_device *dev); +#endif /* _INTEL_ISH_CLIENT_IF_H_ */ |