Re: [PATCH v2 2/2] usb: typec: mux: gpio-sbu: enable when only used for orientation
From: Fabrice Gasnier
Date: Wed Aug 26 2026 - 06:23:21 EST
On 8/26/26 11:53, Fabrice Gasnier wrote:
> When used as orientation-switch only (no mode-switch, e.g. no altmode),
> the optional enable gpio remains disabled.
> Enable it from the switch_set() routine, in this case, when the
> orientation is set and the enable-gpios property has been provided.
> Move enable GPIO configuration after the swapped configuration has
> been done, to avoid possible glitches in case both signals are changed.
>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@xxxxxxxxxxx>
> ---
> Changes in v2
> - fix issues reported by Sashiko: probe mode-switch property before
> registering Type-C switch, to avoid possible race. Configure enable
> GPIO after swapp GPIO has been configured, in case both transition.
> ---
> drivers/usb/typec/mux/gpio-sbu-mux.c | 14 +++++++++++---
> 1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
[...]
>
> @@ -125,6 +131,8 @@ static int gpio_sbu_mux_probe(struct platform_device *pdev)
> return dev_err_probe(dev, PTR_ERR(sbu_mux->sw),
> "failed to register typec switch\n");
>
> + sbu_mux->mode_switch = device_property_read_bool(dev, "mode-switch");
> +
I've missed to update that, I'll send a V3.
Sorry for the noise,
BR,
Fabrice
> mux_desc.drvdata = sbu_mux;
> mux_desc.fwnode = dev_fwnode(dev);
> mux_desc.set = gpio_sbu_mux_set;
>