[PATCH v3 10/17] device property: Add remote endpoint to devcon matcher

Andy Shevchenko andriy.shevchenko at linux.intel.com
Tue Aug 20 10:20:44 UTC 2024


On Mon, Aug 19, 2024 at 03:38:24PM -0700, Stephen Boyd wrote:
> When a single DT node has a graph connected to more than one
> usb-c-connector node we can't differentiate which typec switch
> registered for the device is associated with the USB connector because
> the devcon matcher code assumes a 1:1 relationship between remote node
> and typec switch. Furthermore, we don't have a #typec-switch-cells
> property so there can only be one node per typec switch.
> 
> Support multiple USB typec switches exposed by one node by passing the
> remote endpoint node in addition to the remote node to the devcon
> matcher function (devcon_match_fn_t). With this change, typec switch
> drivers can register switches with the device node pointer for a graph
> endpoint so that they can support more than one typec switch if
> necessary. Either way, a DT property like 'mode-switch' is always in the
> graph's parent node and not in the endpoint node.

> Cc: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> Cc: Daniel Scally <djrscally at gmail.com>
> Cc: Heikki Krogerus <heikki.krogerus at linux.intel.com>
> Cc: Sakari Ailus <sakari.ailus at linux.intel.com>
> Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> Cc: Vinod Koul <vkoul at kernel.org>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki at intel.com>
> Cc: Mika Westerberg <mika.westerberg at linux.intel.com>
> Cc: Alexandre Belloni <alexandre.belloni at bootlin.com>
> Cc: Ivan Orlov <ivan.orlov0322 at gmail.com>
> Cc: Rob Herring <robh+dt at kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt at linaro.org>
> Cc: Conor Dooley <conor+dt at kernel.org>
> Cc: <devicetree at vger.kernel.org>
> Cc: <linux-usb at vger.kernel.org>
> Cc: <linux-acpi at vger.kernel.org>
> Cc: Pin-yen Lin <treapking at chromium.org>

Move these after --- line below.

...

>  drivers/base/property.c     | 7 +++++--

The changes here are fine to me.

...

>  include/linux/property.h    | 5 +++--

> -typedef void *(*devcon_match_fn_t)(const struct fwnode_handle *fwnode, const char *id,
> -				   void *data);
> +typedef void *(*devcon_match_fn_t)(const struct fwnode_handle *fwnode,
> +				   const struct fwnode_handle *endpoint,
> +				   const char *id, void *data);

Seems there is no explanation of the parameters here, can we add a kernel-doc
to this typedef (may be a separate patch)?

-- 
With Best Regards,
Andy Shevchenko




More information about the dri-devel mailing list