Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69452f1e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "HID: add hid_is_usb() function to make it simpler for USB detection"

parents 17ee78dd 91423794
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -622,7 +622,7 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
	if (drvdata->quirks & QUIRK_IS_MULTITOUCH)
		drvdata->tp = &asus_i2c_tp;

	if (drvdata->quirks & QUIRK_T100_KEYBOARD) {
	if ((drvdata->quirks & QUIRK_T100_KEYBOARD) && hid_is_usb(hdev)) {
		struct usb_interface *intf = to_usb_interface(hdev->dev.parent);

		if (intf->altsetting->desc.bInterfaceNumber == T100_TPAD_INTF) {
+1 −1
Original line number Diff line number Diff line
@@ -2156,7 +2156,7 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix)
	if ((features->type == HID_GENERIC) && !strcmp("Wacom HID", features->name)) {
		char *product_name = wacom->hdev->name;

		if (hid_is_using_ll_driver(wacom->hdev, &usb_hid_driver)) {
		if (hid_is_usb(wacom->hdev)) {
			struct usb_interface *intf = to_usb_interface(wacom->hdev->dev.parent);
			struct usb_device *dev = interface_to_usbdev(intf);
			product_name = dev->product;
+5 −0
Original line number Diff line number Diff line
@@ -832,6 +832,11 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
	return hdev->ll_driver == driver;
}

static inline bool hid_is_usb(struct hid_device *hdev)
{
	return hid_is_using_ll_driver(hdev, &usb_hid_driver);
}

#define	PM_HINT_FULLON	1<<5
#define PM_HINT_NORMAL	1<<1