Thread (49 messages) 49 messages, 6 authors, 2024-08-27

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

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2024-08-20 10:20:56
Also in: chrome-platform, dri-devel, linux-acpi, linux-patches, linux-usb, lkml

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@linux.intel.com>
Cc: Daniel Scally <djrscally@gmail.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: "Rafael J. Wysocki" <redacted>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ivan Orlov <ivan.orlov0322@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <redacted>
Cc: Conor Dooley <conor+dt@kernel.org>
Cc: <redacted>
Cc: <redacted>
Cc: <redacted>
Cc: Pin-yen Lin <redacted>
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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help