From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
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>,
patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, mfd@lists.linux.dev
Subject: Re: [PATCH 2/4] ASoC: arizona: always parse device properties regardless of platform data
Date: Mon, 23 Nov 2026 11:52:13 -0800 [thread overview]
Message-ID: <dfdf0c3f2c02672514077465784ae1e6@gmail.com> (raw)
In-Reply-To: <179414246010.3630016.7821414370886873553.b4-review@b4>
Hi Mark,
On Sun, Nov 08, 2026 at 12:54:20PM +0000, Mark Brown wrote:
> > @@ -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;
>
> This changes the default from ARIZONA_ACCDET_MODE_MIC to
> ARIZONA_ACCDET_MODE_HPL, and might be clearer if written using a normal
> logic statement.
ARIZONA_ACCDET_MODE_MIC (0) is not actually a valid headphone detection
channel: hpdet_channel is only programmed before starting ARIZONA_HP_POLL
to measure headphone impedance on HPL or HPR, and the switch right below
(as well as the DT binding) rejects 0 and falls back to HPL.
Before commit 9e86b2ad4c11 ("extcon: arizona: Add support for select
accessory detect mode when headphone detection"), ARIZONA_ACCDET_MODE_HPL
was hardcoded for all boards; that commit only initialized the default in
the OF path, leaving platform-data boards that omit hpdet_channel (such
as crag6410) with 0 by accident.
Fair point on the ternary though. I will rewrite this in v2 using a plain
if check (only validating "wlf,hpdet-channel" when the property is
present, and defaulting unset pdata->hpdet_channel to
ARIZONA_ACCDET_MODE_HPL in arizona_jack_codec_dev_probe(), matching
pdata->micd_timeout) and note the default behavior in the commit message.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2026-11-23 19:52 UTC|newest]
Thread overview: 8+ 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 ` [PATCH 2/4] ASoC: arizona: always parse device properties regardless of platform data Dmitry Torokhov
2026-11-08 12:54 ` Mark Brown
2026-11-23 19:52 ` 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=dfdf0c3f2c02672514077465784ae1e6@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