lkml.org 
[lkml]   [2022]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v2 1/7] usb: typec: mux: Allow muxes to specify mode-switch
On Thu, Jun 09, 2022 at 06:09:40PM +0000, Prashant Malani wrote:
> Loosen the typec_mux_match() requirements so that searches where an
> alt mode is not specified, but the target mux device lists the
> "mode-switch" property, return a success.
>
> This is helpful in Type C port drivers which would like to get a pointer
> to the mux switch associated with a Type C port, but don't want to
> specify a particular alt mode.
>
> Signed-off-by: Prashant Malani <pmalani@chromium.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>
> Changes since v1:
> - No changes.
>
> drivers/usb/typec/mux.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c
> index fd55c2c516a5..464330776cd6 100644
> --- a/drivers/usb/typec/mux.c
> +++ b/drivers/usb/typec/mux.c
> @@ -281,9 +281,13 @@ static void *typec_mux_match(struct fwnode_handle *fwnode, const char *id,
> if (match)
> goto find_mux;
>
> - /* Accessory Mode muxes */
> if (!desc) {
> - match = fwnode_property_present(fwnode, "accessory");
> + /*
> + * Accessory Mode muxes & muxes which explicitly specify
> + * the required identifier can avoid SVID matching.
> + */
> + match = fwnode_property_present(fwnode, "accessory") ||
> + fwnode_property_present(fwnode, id);
> if (match)
> goto find_mux;
> return NULL;
> --
> 2.36.1.476.g0c4daa206d-goog

--
heikki

\
 
 \ /
  Last update: 2022-06-14 09:43    [W:1.992 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site