public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Prashant Malani <pmalani@chromium.org>,
	linux-acpi@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] usb: typec: port-mapper: Convert to the component framework
Date: Wed, 8 Dec 2021 13:23:41 +0200	[thread overview]
Message-ID: <YbCVvVMjf7Q9Y0og@kuha.fi.intel.com> (raw)
In-Reply-To: <Ya+BvnS8XqW9NpNc@smile.fi.intel.com>

On Tue, Dec 07, 2021 at 05:46:06PM +0200, Andy Shevchenko wrote:
> On Tue, Dec 07, 2021 at 05:37:56PM +0300, Heikki Krogerus wrote:
> > Instead of trying to keep track of the connections to the
> > USB Type-C connectors separately, letting the component
> > framework take care of that.
> > 
> > From now on every USB Type-C connector will register itself
> > as "aggregate" - component master - and anything that can be
> > connected to it can then simply register itself as a generic
> > component.
> > 
> > The matching of the components and the connector shall rely
> > on ACPI _PLD initially. Before registering itself as the
> > aggregate, the connector will check the list of other
> > devices that share the same ACPI _PLD with it, and add a
> > component match entry for each one of them. Because only
> > ACPI is supported for now, the driver shall only be build
> > when ACPI is supported.
> > 
> > This removes the need for the custom API that the driver
> > exposed. The components and the connector can therefore
> > exist completely independently of each other. The order in
> > which they are registered, as well as are they modules or
> > not, is now irrelevant.
> 
> ...
> 
> > +static int typec_port_compare(struct device *dev, void *fwnode)
> >  {
> 
> > +	return dev_fwnode(dev) == fwnode;
> >  }
> 
> NIH device_match_fwnode()
> 
> ...
> 
> > +	/* Component match for every device that shares the same _PLD. */
> > +	list_for_each_entry(adev, &location->devices, location_list) {
> 
> > +		if (adev == ACPI_COMPANION(&con->dev))
> 
> 	device_match_acpi_dev()

Ah, both look like great helpers. I'll this in v2. Thanks.

-- 
heikki

  reply	other threads:[~2021-12-08 11:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07 14:37 [PATCH 0/5] acpi: Store _PLD information and convert users Heikki Krogerus
2021-12-07 14:37 ` [PATCH 1/5] acpi: Store the Physical Location of Device (_PLD) information Heikki Krogerus
2021-12-07 14:37 ` [PATCH 2/5] usb: Use the cached ACPI _PLD entry Heikki Krogerus
2021-12-07 14:37 ` [PATCH 3/5] usb: Link the ports to the connectors they are attached to Heikki Krogerus
2021-12-07 14:37 ` [PATCH 4/5] usb: typec: port-mapper: Convert to the component framework Heikki Krogerus
2021-12-07 15:46   ` Andy Shevchenko
2021-12-08 11:23     ` Heikki Krogerus [this message]
2021-12-07 14:37 ` [PATCH 5/5] usb: Remove usb_for_each_port() Heikki Krogerus
2021-12-09  3:45 ` [PATCH 0/5] acpi: Store _PLD information and convert users Prashant Malani
2021-12-09 10:06   ` Heikki Krogerus
2021-12-09 19:45     ` Prashant Malani
2021-12-10  9:26       ` Heikki Krogerus

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=YbCVvVMjf7Q9Y0og@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pmalani@chromium.org \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.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