Message ID | 20230217184904.1290-3-kaehndan@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Jiri Kosina |
Headers | show |
Series | Firmware Support for USB-HID Devices and CP2112 | expand |
On Fri, Feb 17, 2023 at 12:49:03PM -0600, Danny Kaehn wrote: > USB HID core now shares its fwnode with its child HID device. > Since there can only be one HID device on a USB interface, it is redundant > to specify a hid node under the USB device. This allows usb HID device > drivers to be described in firmware and make use of device properties. FWIW, Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Signed-off-by: Danny Kaehn <kaehndan@gmail.com> > --- > drivers/hid/usbhid/hid-core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c > index be4c731aaa65..a0859c49d9f4 100644 > --- a/drivers/hid/usbhid/hid-core.c > +++ b/drivers/hid/usbhid/hid-core.c > @@ -19,6 +19,7 @@ > #include <linux/list.h> > #include <linux/mm.h> > #include <linux/mutex.h> > +#include <linux/property.h> > #include <linux/spinlock.h> > #include <asm/unaligned.h> > #include <asm/byteorder.h> > @@ -1369,6 +1370,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * > hid->hiddev_report_event = hiddev_report_event; > #endif > hid->dev.parent = &intf->dev; > + device_set_node(&hid->dev, dev_fwnode(&intf->dev)); > hid->bus = BUS_USB; > hid->vendor = le16_to_cpu(dev->descriptor.idVendor); > hid->product = le16_to_cpu(dev->descriptor.idProduct); > -- > 2.25.1 >
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index be4c731aaa65..a0859c49d9f4 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -19,6 +19,7 @@ #include <linux/list.h> #include <linux/mm.h> #include <linux/mutex.h> +#include <linux/property.h> #include <linux/spinlock.h> #include <asm/unaligned.h> #include <asm/byteorder.h> @@ -1369,6 +1370,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * hid->hiddev_report_event = hiddev_report_event; #endif hid->dev.parent = &intf->dev; + device_set_node(&hid->dev, dev_fwnode(&intf->dev)); hid->bus = BUS_USB; hid->vendor = le16_to_cpu(dev->descriptor.idVendor); hid->product = le16_to_cpu(dev->descriptor.idProduct);
USB HID core now shares its fwnode with its child HID device. Since there can only be one HID device on a USB interface, it is redundant to specify a hid node under the USB device. This allows usb HID device drivers to be described in firmware and make use of device properties. Signed-off-by: Danny Kaehn <kaehndan@gmail.com> --- drivers/hid/usbhid/hid-core.c | 2 ++ 1 file changed, 2 insertions(+)