From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Laurentiu Mihalcea <laurentiumihalcea111@gmail.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>,
elena.popa@nxp.com, cosmin.stoica@nxp.com,
patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] ASoC: wm8962: implement GPIO .get callback
Date: Mon, 30 Nov 2026 11:18:38 +0000 [thread overview]
Message-ID: <aw1bjp6Dx90N8Zk7@opensource.cirrus.com> (raw)
In-Reply-To: <20261127170039.663-2-laurentiumihalcea111@gmail.com>
On Fri, Nov 27, 2026 at 07:00:37PM +0200, Laurentiu Mihalcea wrote:
> + /*
> + * only GPIO5/GPIO6 can be used as inputs! Note the difference between the GPIO
> + * index and the register offset.
> + */
> + if (offset != 4 && offset != 5) {
> + dev_err(component->dev, "Only GPIO5/GPIO6 can be used as inputs!\n");
> + return -EINVAL;
> + }
I feel like it would be better to add a direction_input callback
and fail there for the other GPIOs. Better to not allow setting
the GPIO to an input than to error out whilst reading it.
Otherwise, I think this looks ok to me.
Thanks,
Charles
next prev parent reply other threads:[~2026-11-30 11:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 17:00 [PATCH 0/3] ASoC: wm8962: make GPIO-based HP detection work Laurentiu Mihalcea
2026-11-27 17:00 ` [PATCH 1/3] ASoC: wm8962: implement GPIO .get callback Laurentiu Mihalcea
2026-11-30 11:18 ` Charles Keepax [this message]
2026-11-27 17:00 ` [PATCH 2/3] ASoC: wm8962: add GPIO interrupt controller support Laurentiu Mihalcea
2026-11-30 11:25 ` Charles Keepax
2026-11-27 17:00 ` [PATCH 3/3] ASoC: wm8962: fix interrupt mis-firing during runtime_resume() Laurentiu Mihalcea
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=aw1bjp6Dx90N8Zk7@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=cosmin.stoica@nxp.com \
--cc=elena.popa@nxp.com \
--cc=laurentiumihalcea111@gmail.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=sebastian.krzyszkowiak@puri.sm \
/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