[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZBCU5h/A2woJLtvT@ye-NUC7i7DNHE>
Date: Tue, 14 Mar 2023 23:38:14 +0800
From: "Ye, Xiang" <xiang.ye@...el.com>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
CC: Lee Jones <lee@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>,
"Matthias Kaehlcke" <mka@...omium.org>,
Wolfram Sang <wsa@...nel.org>,
Tyrone Ting <kfting@...oton.com>,
Mark Brown <broonie@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
<linux-usb@...r.kernel.org>, <linux-i2c@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-spi@...r.kernel.org>,
<linux-gpio@...r.kernel.org>, <srinivas.pandruvada@...el.com>,
<andriy.shevchenko@...ux.intel.com>,
<sakari.ailus@...ux.intel.com>, <zhifeng.wang@...el.com>,
<wentong.wu@...el.com>, <lixu.zhang@...el.com>
Subject: Re: [PATCH v5 1/5] usb: Add support for Intel LJCA device
Hi Heikki,
Thanks for the review.
On Tue, Mar 14, 2023 at 10:36:57AM +0200, Heikki Krogerus wrote:
> Hi Xiang,
>
> On Tue, Mar 14, 2023 at 04:03:26PM +0800, Ye, Xiang wrote:
> > > Please don't use the MFD API outside of drivers/mfd.
> > >
> > > If you wish to use the API, please do.
> > >
> > > Strip out (only) the MFD parts and move them into drivers/mfd.
> > I have no idea about how to split MFD parts out from this driver
> > currently. The MFD part just have mfd cells filling and the call
> > mfd_add_hotplug_devices to register mfd devices. How to module them
> > as an independent driver?
> > Would you give some hints or recommendations?
> >
> > And I am a little comfused about where this USB device driver should
> > be put to (drivers/mfd or drivers/usb).
> >
> > As far as I know, where a driver should be put is based on what
> > it provides. This driver just do some urb package transfer to provides
> > multi-functions, such as GPIO function, I2C function, SPI function.
> > so it should be under drivers/mfd folder. Please correct me, if
> > something is wrong. Thanks
>
> You don't really seem to get any benefit from MFD. Perhaps it would be
> more appropriate and clear if you just registered auxiliary devices in
> this driver. Check drivers/base/auxiliary.c.
Yes, it should be a work. I have a question.
MFD provides the ACPI binding for sub-devices through
struct mfd_cell_acpi_match. But I didn't see this in drivers/base/auxiliary.c.
If using auxiliary bus to implement the LJCA sub-devices, we need to do
the sub-devices acpi binding manually in ljca.c.
Something Like:
adr = LJCA_ACPI_MATCH_GPIO
adev = acpi_find_child_device(parent, adr, false);
ACPI_COMPANION_SET(&pdev->dev, adev ?: parent);
Is that acceptable?
--
Thanks
Ye Xiang
Powered by blists - more mailing lists