mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
HID: introduce hid_is_using_ll_driver
Although HID itself is transport-agnostic, occasionally a driver may want to interact with the low-level transport that a device is connected through. To do this, we need to know what kind of bus is in use. The first guess may be to look at the 'bus' field of the 'struct hid_device', but this field may be emulated in some cases (e.g. uhid). More ideally, we can check which ll_driver a device is using. This function introduces a 'hid_is_using_ll_driver' function and makes the 'struct hid_ll_driver' of the four most common transports accessible through hid.h. Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com> Acked-By: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
committed by
Jiri Kosina
parent
bc35f73aa6
commit
fc2237a724
@@ -777,6 +777,17 @@ struct hid_ll_driver {
|
||||
int (*idle)(struct hid_device *hdev, int report, int idle, int reqtype);
|
||||
};
|
||||
|
||||
extern struct hid_ll_driver i2c_hid_ll_driver;
|
||||
extern struct hid_ll_driver hidp_hid_driver;
|
||||
extern struct hid_ll_driver uhid_hid_driver;
|
||||
extern struct hid_ll_driver usb_hid_driver;
|
||||
|
||||
static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
|
||||
struct hid_ll_driver *driver)
|
||||
{
|
||||
return hdev->ll_driver == driver;
|
||||
}
|
||||
|
||||
#define PM_HINT_FULLON 1<<5
|
||||
#define PM_HINT_NORMAL 1<<1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user