linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Danny Kaehn <kaehndan@gmail.com>
To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	jikos@kernel.org, benjamin.tissoires@redhat.com
Cc: bartosz.golaszewski@linaro.org,
	andriy.shevchenko@linux.intel.com, dmitry.torokhov@gmail.com,
	devicetree@vger.kernel.org, linux-input@vger.kernel.org,
	ethan.twardy@plexus.com
Subject: [PATCH v9 2/3] HID: usbhid: Share USB device firmware node with child HID device
Date: Sun, 19 Mar 2023 15:48:01 -0500	[thread overview]
Message-ID: <20230319204802.1364-3-kaehndan@gmail.com> (raw)
In-Reply-To: <20230319204802.1364-1-kaehndan@gmail.com>

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>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.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 257dd73e37bf..090260d99c84 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>
@@ -1374,6 +1375,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


  parent reply	other threads:[~2023-03-19 20:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 20:47 [PATCH v9 0/3] Firmware Support for USB-HID Devices and CP2112 Danny Kaehn
2023-03-19 20:48 ` [PATCH v9 1/3] dt-bindings: i2c: Add CP2112 HID USB to SMBus Bridge Danny Kaehn
2023-03-20  6:44   ` Krzysztof Kozlowski
2023-03-20 12:25     ` Daniel Kaehn
2023-03-19 20:48 ` Danny Kaehn [this message]
2023-03-19 20:48 ` [PATCH v9 3/3] HID: cp2112: Fwnode Support Danny Kaehn
2023-03-20 12:58   ` Andy Shevchenko
2023-03-20 13:00     ` Andy Shevchenko
2023-03-20 13:40       ` Daniel Kaehn
2023-03-20 14:05         ` Andy Shevchenko
2023-05-01 23:35           ` Daniel Kaehn
2023-07-03 10:57             ` Andy Shevchenko
2024-01-17 18:48               ` Danny Kaehn
2024-01-18  8:58                 ` Benjamin Tissoires

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230319204802.1364-3-kaehndan@gmail.com \
    --to=kaehndan@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=benjamin.tissoires@redhat.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ethan.twardy@plexus.com \
    --cc=jikos@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).