From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
David Rhodes <david.rhodes@cirrus.com>,
Lee Jones <lee@kernel.org>
Cc: patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, mfd@lists.linux.dev
Subject: [PATCH 2/4] ASoC: arizona: always parse device properties regardless of platform data
Date: Thu, 05 Nov 2026 21:39:33 -0800 [thread overview]
Message-ID: <20261105-arizona-asoc-v1-2-25ec7338446e@gmail.com> (raw)
In-Reply-To: <20261105-arizona-asoc-v1-0-25ec7338446e@gmail.com>
Always parse device properties in the Arizona jack detection driver and
codec drivers even when platform data is provided, allowing DT, ACPI,
or software node properties to augment platform data configurations.
In the jack detection driver, initialize the headphone detect channel
from existing platform data before querying device properties so an
absent property does not clobber it with the default channel. Preserve
existing boolean platform data flags using bitwise OR assignments.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
sound/soc/codecs/arizona-jack.c | 27 ++++++++++++++-------------
sound/soc/codecs/cs47l24.c | 3 +--
sound/soc/codecs/wm5102.c | 3 +--
sound/soc/codecs/wm5110.c | 3 +--
sound/soc/codecs/wm8997.c | 3 +--
sound/soc/codecs/wm8998.c | 3 +--
6 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/sound/soc/codecs/arizona-jack.c b/sound/soc/codecs/arizona-jack.c
index 6587d46a1867..d5f14fc8af7f 100644
--- a/sound/soc/codecs/arizona-jack.c
+++ b/sound/soc/codecs/arizona-jack.c
@@ -1184,7 +1184,7 @@ static int arizona_extcon_device_get_pdata(struct device *dev,
struct arizona *arizona)
{
struct arizona_pdata *pdata = &arizona->pdata;
- unsigned int val = ARIZONA_ACCDET_MODE_HPL;
+ unsigned int val = pdata->hpdet_channel ?: ARIZONA_ACCDET_MODE_HPL;
int ret;
device_property_read_u32(arizona->dev, "wlf,hpdet-channel", &val);
@@ -1213,21 +1213,23 @@ static int arizona_extcon_device_get_pdata(struct device *dev,
device_property_read_u32(arizona->dev, "wlf,micd-timeout-ms",
&pdata->micd_timeout);
- pdata->micd_force_micbias = device_property_read_bool(arizona->dev,
- "wlf,micd-force-micbias");
+ pdata->micd_force_micbias |=
+ device_property_read_bool(arizona->dev,
+ "wlf,micd-force-micbias");
- pdata->micd_software_compare = device_property_read_bool(arizona->dev,
- "wlf,micd-software-compare");
+ pdata->micd_software_compare |=
+ device_property_read_bool(arizona->dev,
+ "wlf,micd-software-compare");
- pdata->jd_invert = device_property_read_bool(arizona->dev,
- "wlf,jd-invert");
+ pdata->jd_invert |= device_property_read_bool(arizona->dev,
+ "wlf,jd-invert");
device_property_read_u32(arizona->dev, "wlf,gpsw", &pdata->gpsw);
- pdata->jd_gpio5 = device_property_read_bool(arizona->dev,
- "wlf,use-jd2");
- pdata->jd_gpio5_nopull = device_property_read_bool(arizona->dev,
- "wlf,use-jd2-nopull");
+ pdata->jd_gpio5 |= device_property_read_bool(arizona->dev,
+ "wlf,use-jd2");
+ pdata->jd_gpio5_nopull |=
+ device_property_read_bool(arizona->dev, "wlf,use-jd2-nopull");
ret = arizona_extcon_get_micd_configs(dev, arizona);
if (ret < 0)
@@ -1242,8 +1244,7 @@ int arizona_jack_codec_dev_probe(struct arizona_priv *info, struct device *dev)
struct arizona_pdata *pdata = &arizona->pdata;
int ret, mode;
- if (!dev_get_platdata(arizona->dev))
- arizona_extcon_device_get_pdata(dev, arizona);
+ arizona_extcon_device_get_pdata(dev, arizona);
info->micvdd = devm_regulator_get(dev, "MICVDD");
if (IS_ERR(info->micvdd))
diff --git a/sound/soc/codecs/cs47l24.c b/sound/soc/codecs/cs47l24.c
index 09cef46f09fc..6965a2ec7642 100644
--- a/sound/soc/codecs/cs47l24.c
+++ b/sound/soc/codecs/cs47l24.c
@@ -1222,8 +1222,7 @@ static int cs47l24_probe(struct platform_device *pdev)
if (!cs47l24)
return -ENOMEM;
- if (!dev_get_platdata(arizona->dev))
- arizona_get_audio_pdata(arizona);
+ arizona_get_audio_pdata(arizona);
platform_set_drvdata(pdev, cs47l24);
diff --git a/sound/soc/codecs/wm5102.c b/sound/soc/codecs/wm5102.c
index bd747171212e..f7aaf1433ad7 100644
--- a/sound/soc/codecs/wm5102.c
+++ b/sound/soc/codecs/wm5102.c
@@ -2041,8 +2041,7 @@ static int wm5102_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, wm5102);
- if (!dev_get_platdata(arizona->dev))
- arizona_get_audio_pdata(arizona);
+ arizona_get_audio_pdata(arizona);
mutex_init(&arizona->dac_comp_lock);
diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c
index 73c4ffabf4ec..58bcd54aff11 100644
--- a/sound/soc/codecs/wm5110.c
+++ b/sound/soc/codecs/wm5110.c
@@ -2403,8 +2403,7 @@ static int wm5110_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, wm5110);
- if (!dev_get_platdata(arizona->dev))
- arizona_get_audio_pdata(arizona);
+ arizona_get_audio_pdata(arizona);
wm5110->core.arizona = arizona;
wm5110->core.num_inputs = 8;
diff --git a/sound/soc/codecs/wm8997.c b/sound/soc/codecs/wm8997.c
index c126afb65928..877305a83283 100644
--- a/sound/soc/codecs/wm8997.c
+++ b/sound/soc/codecs/wm8997.c
@@ -1119,8 +1119,7 @@ static int wm8997_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, wm8997);
- if (!dev_get_platdata(arizona->dev))
- arizona_get_audio_pdata(arizona);
+ arizona_get_audio_pdata(arizona);
wm8997->core.arizona = arizona;
wm8997->core.num_inputs = 4;
diff --git a/sound/soc/codecs/wm8998.c b/sound/soc/codecs/wm8998.c
index fdb2018e9367..28af93104201 100644
--- a/sound/soc/codecs/wm8998.c
+++ b/sound/soc/codecs/wm8998.c
@@ -1346,8 +1346,7 @@ static int wm8998_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, wm8998);
- if (!dev_get_platdata(arizona->dev))
- arizona_get_audio_pdata(arizona);
+ arizona_get_audio_pdata(arizona);
wm8998->core.arizona = arizona;
wm8998->core.num_inputs = 3; /* IN1L, IN1R, IN2 */
--
2.56.0.506.g506a7eabc5-goog
next prev parent reply other threads:[~2026-11-06 5:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 5:39 [PATCH 0/4] ASoC: arizona: switch to generic device properties and clean up Dmitry Torokhov
2026-11-06 5:39 ` [PATCH 1/4] ASoC: arizona: convert audio pdata parsing to generic device properties Dmitry Torokhov
2026-11-06 5:39 ` Dmitry Torokhov [this message]
2026-11-06 5:39 ` [PATCH 3/4] ASoC: arizona: drop unused HPDET accessory ID support Dmitry Torokhov
2026-11-06 9:36 ` Charles Keepax
2026-11-06 5:39 ` [PATCH 4/4] ASoC: arizona: clean up coding style and formatting Dmitry Torokhov
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=20261105-arizona-asoc-v1-2-25ec7338446e@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=david.rhodes@cirrus.com \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=rf@opensource.cirrus.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
all inboxes | Powered by JetHome®