From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Francesco Dolcini <francesco@dolcini.it>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Francesco Dolcini <francesco.dolcini@toradex.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Bjorn Andersson <andersson@kernel.org>
Subject: Re: [PATCH v2 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional
Date: Mon, 3 Jun 2024 13:38:03 +0300 [thread overview]
Message-ID: <Zl2dCytk06deuA7i@kuha.fi.intel.com> (raw)
In-Reply-To: <20240603083558.9629-3-francesco@dolcini.it>
On Mon, Jun 03, 2024 at 10:35:58AM +0200, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> The enable gpio is not required when the SBU mux is used only for
> orientation, make it optional.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> v2:
> - removed useless NULL check for optional enable gpio
> ---
> drivers/usb/typec/mux/gpio-sbu-mux.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/typec/mux/gpio-sbu-mux.c b/drivers/usb/typec/mux/gpio-sbu-mux.c
> index 374168482d36..8902102c05a8 100644
> --- a/drivers/usb/typec/mux/gpio-sbu-mux.c
> +++ b/drivers/usb/typec/mux/gpio-sbu-mux.c
> @@ -66,6 +66,9 @@ static int gpio_sbu_mux_set(struct typec_mux_dev *mux,
> {
> struct gpio_sbu_mux *sbu_mux = typec_mux_get_drvdata(mux);
>
> + if (!sbu_mux->enable_gpio)
> + return -EOPNOTSUPP;
> +
> mutex_lock(&sbu_mux->lock);
>
> switch (state->mode) {
> @@ -102,7 +105,8 @@ static int gpio_sbu_mux_probe(struct platform_device *pdev)
>
> mutex_init(&sbu_mux->lock);
>
> - sbu_mux->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
> + sbu_mux->enable_gpio = devm_gpiod_get_optional(dev, "enable",
> + GPIOD_OUT_LOW);
> if (IS_ERR(sbu_mux->enable_gpio))
> return dev_err_probe(dev, PTR_ERR(sbu_mux->enable_gpio),
> "unable to acquire enable gpio\n");
> --
> 2.39.2
--
heikki
prev parent reply other threads:[~2024-06-03 10:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 8:35 [PATCH v2 0/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
2024-06-03 8:35 ` [PATCH v2 1/2] dt-bindings: usb: gpio-sbu-mux: Make 'enable-gpios' optional Francesco Dolcini
2024-06-03 8:35 ` [PATCH v2 2/2] usb: typec: mux: gpio-sbu: Make enable gpio optional Francesco Dolcini
2024-06-03 10:10 ` Dmitry Baryshkov
2024-06-03 10:38 ` 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=Zl2dCytk06deuA7i@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=francesco.dolcini@toradex.com \
--cc=francesco@dolcini.it \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.