From: Hans de Goede <hdegoede@redhat.com>
To: "Shevchenko, Andriy" <andriy.shevchenko@intel.com>
Cc: "Wu, Wentong" <wentong.wu@intel.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"oneukum@suse.com" <oneukum@suse.com>,
"wsa@kernel.org" <wsa@kernel.org>,
"andi.shyti@linux.intel.com" <andi.shyti@linux.intel.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"bartosz.golaszewski@linaro.org" <bartosz.golaszewski@linaro.org>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
"Wang, Zhifeng" <zhifeng.wang@intel.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v20 1/4] usb: Add support for Intel LJCA device
Date: Sat, 14 Oct 2023 12:58:06 +0200 [thread overview]
Message-ID: <9a080d06-586d-686f-997e-674cb8d16099@redhat.com> (raw)
In-Reply-To: <ZSmjEKfYzFuAHXW+@smile.fi.intel.com>
Hi Andy,
On 10/13/23 22:05, Shevchenko, Andriy wrote:
> On Thu, Oct 12, 2023 at 01:14:23PM +0200, Hans de Goede wrote:
<snip>
>> Ah ok, I see. So the code:
>>
>> 1. First tries to find the matching child acpi_device for the auxdev by ADR
>>
>> 2. If 1. fails then falls back to HID + UID matching
>>
>> And there are DSDTs which use either:
>>
>> 1. Only use _ADR to identify which child device is which, like the example
>> DSDT snippet from the commit msg.
>>
>> 2. Only use _HID + _UID like the 2 example DSDT snippets from me email
>>
>> But there never is a case where both _ADR and _HID are used at
>> the same time (which would be an ACPI spec violation as Andy said).
>>
>> So AFAICT there is no issue here since _ADR and _HID are never
>> user at the same time and the commit message correctly describes
>> scenario 1. from above, so the commit message is fine too.
>>
>> So I believe that we can continue with this patch series in
>> its current v20 form, which has already been staged for
>> going into -next by Greg.
>>
>> Andy can you confirm that moving ahead with the current
>> version is ok ?
>
> Yes as we have a few weeks to fix corner cases.
>
> What I'm worrying is that opening door for _ADR that seems never used is kinda
> an overkill here (resolving non-existing problem).
I assume that there actually some DSDTs using the _ADR approach
and that this support is not there just for fun.
Wentong, can you confirm that the _ADR using codepaths are
actually used on some hardware / with some DSDTs out there ?
> Looking at the design of the
> driver I'm not sure why ACPI HIDs are collected somewhere else than in the
> respective drivers. And looking at the ID lists themselves I am not sure why
> the firmware of the respective hardware platforms are not using _CID.
This is a USB device which has 4 functions:
1. GPIO controller
2. I2C controller 1
3. I2C controller 2
4. SPI controller
The driver for the main USB interface uses
the new auxbus to create 4 child devices. The _ADR
or if that fails _HID + _UID matching is done to
find the correct acpi_device child of the acpi_device
which is the ACPI-companion of the main USB device.
After looking up the correct acpi_device child
this is then set as the fwnode / ACPI-companion
of the auxbus device created for that function.
Having the correct fwnode is important because other
parts of the DSDT reference this fwnode to specify
GPIO / I2C / SPI resources and if the fwnode of
the aux-device is not set correctly then the resources
for other devices referencing it (typically a camera
sensor) can not be found.
As for why the driver for the auxbus devices / children
do not use HID matching, AFAIK the auxbus has no support
for using ACPI (or DT) matching for aux-devices and these
drivers need to be auxiliary_driver's and bind to the
auxbus device and not to a platform_device instantiated for
the acpi_device since they need the auxbus device to access
the USB device.
Regards,
Hans
next prev parent reply other threads:[~2023-10-14 10:59 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 6:33 [PATCH v20 0/4] Add Intel LJCA device driver Wentong Wu
2023-10-09 6:33 ` [PATCH v20 1/4] usb: Add support for Intel LJCA device Wentong Wu
2023-10-09 10:22 ` Oliver Neukum
2023-10-11 10:21 ` Andy Shevchenko
2023-10-11 10:37 ` Hans de Goede
2023-10-11 10:43 ` Andy Shevchenko
2023-10-11 12:50 ` Wu, Wentong
2023-10-12 11:14 ` Hans de Goede
2023-10-13 20:05 ` Shevchenko, Andriy
2023-10-14 10:58 ` Hans de Goede [this message]
2023-10-16 5:52 ` Wu, Wentong
2023-10-16 7:35 ` Hans de Goede
2023-10-16 7:38 ` Shevchenko, Andriy
2023-10-16 15:05 ` Wu, Wentong
2023-10-16 15:19 ` gregkh
2023-10-16 15:44 ` Wu, Wentong
2023-10-16 16:05 ` Shevchenko, Andriy
2023-10-16 17:20 ` Hans de Goede
2023-10-17 0:46 ` Wu, Wentong
2023-10-09 6:33 ` [PATCH v20 2/4] i2c: Add support for Intel LJCA USB I2C driver Wentong Wu
2023-10-10 19:25 ` Wolfram Sang
2023-10-09 6:33 ` [PATCH v20 3/4] spi: Add support for Intel LJCA USB SPI driver Wentong Wu
2023-10-09 12:50 ` Mark Brown
2023-10-09 6:33 ` [PATCH v20 4/4] gpio: update Intel LJCA USB GPIO driver Wentong Wu
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=9a080d06-586d-686f-997e-674cb8d16099@redhat.com \
--to=hdegoede@redhat.com \
--cc=andi.shyti@linux.intel.com \
--cc=andriy.shevchenko@intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=sakari.ailus@linux.intel.com \
--cc=wentong.wu@intel.com \
--cc=wsa@kernel.org \
--cc=zhifeng.wang@intel.com \
/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).