Devicetree
 help / color / mirror / Atom feed
From: Shawn Guo <shengchao.guo@oss.qualcomm.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] usb: typec: Add onsemi FUSB15201 driver
Date: Wed, 9 Sep 2026 09:38:43 +0800	[thread overview]
Message-ID: <aqC4oyV4WUdGynv-@QCOM-aGQu4IUr3Y> (raw)
In-Reply-To: <ap51p16bSY1Ru9C1@monoceros>

Hi Uwe,

On Mon, Sep 07, 2026 at 10:32:55AM +0200, Uwe Kleine-König wrote:
> Hello Shawn,
> 
> On Wed, Sep 02, 2026 at 12:59:38PM +0800, Shawn Guo wrote:
> > +#include <linux/i2c.h>
> > [...]
> > +#include <linux/mod_devicetable.h>
> 
> Please rely on <linux/i2c.h> to provide of_device_id and (see below)
> i2c_device_id. Alternatively include the needed files below
> include/linux/device-id/ to not introduce unneeded dependencies.

Ah, yes! I will drop this include.

> 
> > +static const struct of_device_id fusb15201_of_match[] = {
> > +	{ .compatible = "onnn,fusb15201" },
> > +	{ }
> > +};
> > +MODULE_DEVICE_TABLE(of, fusb15201_of_match);
> > +
> > +static struct i2c_driver fusb15201_driver = {
> > +	.driver = {
> > +		.name = "fusb15201",
> > +		.of_match_table = fusb15201_of_match,
> > +	},
> > +	.probe = fusb15201_probe,
> 
> Don't you need an i2c_device_id table, too?

I'm not sure. For the DT case the of_match_table handles both matching
and module autoloading, so nothing is missing there.

The i2c_device_id table would only matter for a client created without a
fwnode, e.g. from board code, and that is not a case the driver supports
or has been tested against. probe() walks the child fwnodes of the device
to find the connectors and fails with -ENODEV when there are none, and
each port needs its Type-C capabilities and a usb-role-switch reference
from firmware. So matching by name alone would only turn a "no driver"
case into a probe failure.  If a platform without DT ever needs this
driver, it has to describe the connectors first, and the i2c_device_id
table can come along with that.

Shawn

      reply	other threads:[~2026-09-09  1:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02  4:59 [PATCH 0/2] usb: typec: Add onsemi FUSB15201 support Shawn Guo
2026-09-02  4:59 ` [PATCH 1/2] dt-bindings: usb: Add onsemi FUSB15201 Type-C and PD controller Shawn Guo
2026-09-02  5:07   ` sashiko-bot
2026-09-08  9:02   ` Krzysztof Kozlowski
2026-09-02  4:59 ` [PATCH 2/2] usb: typec: Add onsemi FUSB15201 driver Shawn Guo
2026-09-02  5:12   ` sashiko-bot
2026-09-02 13:30   ` Bartosz Golaszewski
2026-09-07  8:32   ` Uwe Kleine-König
2026-09-09  1:38     ` Shawn Guo [this message]

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=aqC4oyV4WUdGynv-@QCOM-aGQu4IUr3Y \
    --to=shengchao.guo@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=krishna.kurapati@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=u.kleine-koenig@baylibre.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