From: Francesco Dolcini <francesco@dolcini.it>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Saravana Kannan <saravanak@google.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
patches@opensource.cirrus.com
Cc: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>,
linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Francesco Dolcini <francesco.dolcini@toradex.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>
Subject: [PATCH v3 2/5] ASoC: wm8904: Don't touch GPIO configs set to 0xFFFF
Date: Fri, 7 Mar 2025 14:52:41 +0100 [thread overview]
Message-ID: <20250307135244.100443-3-francesco@dolcini.it> (raw)
In-Reply-To: <20250307135244.100443-1-francesco@dolcini.it>
From: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
When updating the GPIO registers, do nothing for all fields of gpio_cfg
that are "0xFFFF".
This "do nothing" flag used to be 0 to easily check whether the gpio_cfg
field was actually set inside pdata or left empty (default).
However, 0 is a valid configuration for these registers, while 0xFFFF is
not.
With this change, users can explicitly set them to 0.
Not setting gpio_cfg in the platform data will now lead to setting all
GPIO registers to 0 instead of leaving them unset.
No one is using this platform data with this codec.
The change gets the driver ready to properly set gpio_cfg from the DT.
Datasheet: https://statics.cirrus.com/pubs/proDatasheet/WM8904_Rev4.1.pdf
Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
v3: no changes
v2: no changes
v1: https://lore.kernel.org/lkml/20250206163152.423199-3-francesco@dolcini.it/
---
sound/soc/codecs/wm8904.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index aef82532f8cf..2082ff12d336 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -2270,7 +2270,8 @@ static int wm8904_i2c_probe(struct i2c_client *i2c)
/* Apply configuration from the platform data. */
if (wm8904->pdata) {
for (i = 0; i < WM8904_GPIO_REGS; i++) {
- if (!wm8904->pdata->gpio_cfg[i])
+ /* 0xFFFF in this config means "don't touch" */
+ if (wm8904->pdata->gpio_cfg[i] == 0xffff)
continue;
regmap_update_bits(wm8904->regmap,
--
2.39.5
next prev parent reply other threads:[~2025-03-07 13:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 13:52 [PATCH v3 0/5] ASoC: wm8904: Add DMIC and DRC support Francesco Dolcini
2025-03-07 13:52 ` [PATCH v3 1/5] of: Add of_property_read_u16_index Francesco Dolcini
2025-03-07 13:52 ` Francesco Dolcini [this message]
2025-03-07 13:52 ` [PATCH v3 3/5] ASoC: dt-bindings: wm8904: Add DMIC, GPIO, MIC and EQ support Francesco Dolcini
2025-03-11 8:42 ` Krzysztof Kozlowski
2025-03-11 13:46 ` Mark Brown
2025-03-11 17:59 ` Rob Herring
2025-03-12 8:39 ` Krzysztof Kozlowski
2025-03-12 8:48 ` Ernest Van Hoecke
2025-03-12 8:41 ` Krzysztof Kozlowski
2025-03-07 13:52 ` [PATCH v3 4/5] ASoC: wm8904: get platform data from DT Francesco Dolcini
2025-03-07 13:52 ` [PATCH v3 5/5] ASoC: wm8904: add DMIC support Francesco Dolcini
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=20250307135244.100443-3-francesco@dolcini.it \
--to=francesco@dolcini.it \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=ernest.vanhoecke@toradex.com \
--cc=francesco.dolcini@toradex.com \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=tiwai@suse.com \
/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