From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Marek Vasut <marex@nabladev.com>,
linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH 2/2] usb: typec: mux: gpio-sbu: enable when only used for orientation
Date: Mon, 31 Aug 2026 12:07:57 +0200 [thread overview]
Message-ID: <apVSfbfIDbkx3eCT@black.igk.intel.com> (raw)
In-Reply-To: <20260825-usb-fusb340-v1-v1-2-2191179b0661@foss.st.com>
On Tue, Aug 25, 2026 at 02:54:24PM +0200, 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.
>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/mux/gpio-sbu-mux.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
> index 1834f1a2dd9d..4151d78e3b8d 100644
> --- a/drivers/usb/typec/mux/gpio-sbu-mux.c
> +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
> @@ -17,6 +17,7 @@ struct gpio_sbu_mux {
>
> struct typec_switch_dev *sw;
> struct typec_mux_dev *mux;
> + bool mode_switch;
>
> struct mutex lock; /* protect enabled and swapped */
> bool enabled;
> @@ -40,9 +41,13 @@ static int gpio_sbu_switch_set(struct typec_switch_dev *sw,
> enabled = false;
> break;
> case TYPEC_ORIENTATION_NORMAL:
> + if (!sbu_mux->mode_switch)
> + enabled = true;
> swapped = false;
> break;
> case TYPEC_ORIENTATION_REVERSE:
> + if (!sbu_mux->mode_switch)
> + enabled = true;
> swapped = true;
> break;
> }
> @@ -125,6 +130,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");
> +
> mux_desc.drvdata = sbu_mux;
> mux_desc.fwnode = dev_fwnode(dev);
> mux_desc.set = gpio_sbu_mux_set;
>
> --
> 2.43.0
--
heikki
prev parent reply other threads:[~2026-08-31 10:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 12:54 [PATCH 0/2] usb: gpio-sbu-mux: add FUSB340 and enable option for orientation Fabrice Gasnier
2026-08-25 12:54 ` [PATCH 1/2] dt-bindings: usb: gpio-sbu-mux: Add compatible for FUSB340 Fabrice Gasnier
2026-08-25 16:49 ` Conor Dooley
2026-08-25 12:54 ` [PATCH 2/2] usb: typec: mux: gpio-sbu: enable when only used for orientation Fabrice Gasnier
2026-08-25 13:09 ` sashiko-bot
2026-08-31 10:07 ` Heikki Krogerus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=apVSfbfIDbkx3eCT@black.igk.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fabrice.gasnier@foss.st.com \
--cc=gregkh@linuxfoundation.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux-usb@vger.kernel.org \
--cc=marex@nabladev.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox