On Sat, Aug 31, 2024 at 09:06:49PM -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.shevche...@linux.intel.com> > Cc: Daniel Scally <djrsca...@gmail.com> > Cc: Heikki Krogerus <heikki.kroge...@linux.intel.com> > Cc: Sakari Ailus <sakari.ai...@linux.intel.com> > Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> > Cc: Vinod Koul <vk...@kernel.org> > Cc: "Rafael J. Wysocki" <rafael.j.wyso...@intel.com> > Cc: Mika Westerberg <mika.westerb...@linux.intel.com> > Cc: Alexandre Belloni <alexandre.bell...@bootlin.com> > Cc: Ivan Orlov <ivan.orlov0...@gmail.com> > Cc: Rob Herring <robh...@kernel.org> > Cc: Krzysztof Kozlowski <krzysztof.kozlowski...@linaro.org> > Cc: Conor Dooley <conor...@kernel.org> > Cc: <devicet...@vger.kernel.org> > Cc: <linux-...@vger.kernel.org> > Cc: <linux-a...@vger.kernel.org> > Cc: Pin-yen Lin <treapk...@chromium.org> Is it possible to move these Cc:s after --- line below? > Signed-off-by: Stephen Boyd <swb...@chromium.org> ... > /** > * devcon_match_fn_t - device connection match function > * @fwnode: Remote connection's device node > + * @endpoint: Remote connection's endpoint node > * @con_id: Identifier for the connection > * @data: Match function caller specific data > * > * Implement a callback with this function signature to search a fwnode's > * connections for a match with a function like > device_connection_find_match(). > * This function will be called possibly multiple times, once for each > - * connection. The match function should inspect the @fwnode to look for a > - * match. The @con_id and @data provided are the same as the @con_id and > @data > - * arguments passed to the functions that take a devcon_match_fn_t argument. > + * connection. The match function should inspect the connection's @fwnode > + * and/or @endpoint to look for a match. The @con_id and @data provided are > the > + * same as the @con_id and @data arguments passed to the functions that take > a > + * devcon_match_fn_t argument. So, struct fwnode_handle is a single-linked list. Can we utilise that instead of adding a new parameter? I.o.w. do those objects (@fwnode and @endpoint) have anything in common and can be chained? > * Note: This function can be called multiple times. What does this mean? Is it idempotent? Or what is the effect of being called multiple times? > * > * Return: Pointer to match or NULL if no match found. > */ -- With Best Regards, Andy Shevchenko