From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>,
Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Cc: Mark Brown <broonie@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Maciej Strozek <mstrozek@opensource.cirrus.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Srinivas Kandagatla <srini@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, patches@opensource.cirrus.com,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 8/8] ASoC: codecs: add Qualcomm Tambora (WCD9378) SDCA codec
Date: Wed, 2 Sep 2026 13:26:03 +0100 [thread overview]
Message-ID: <3bf36ae1-d771-4ccc-b306-9cd19f626462@oss.qualcomm.com> (raw)
In-Reply-To: <anNfCj2e5kPZhaK0@opensource.cirrus.com>
On 8/5/26 5:04 PM, Charles Keepax wrote:
> On Thu, Jul 23, 2026 at 12:42:18AM +0100, Srinivas Kandagatla wrote:
>> Add support for the Qualcomm Tambora (WCD9378) headset codec in SDCA
>> mode over SoundWire.
>>
>> WCD9378 ("Tambora") is a low-power stereo audio codec used across
>> Qualcomm mobile and compute platforms. It integrates a headphone
>> amplifier, mono earpiece output, three analogue microphone inputs
>> with independent programmable mic-bias supplies, jack and button
>> detection, and SoundWire dataports for both playback and capture.
>>
>> Assisted-by: Claude:claude-opus-4-7
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
>> ---
>> + if (entity_id == WCD9378_PDE34_ENTITY_ID) {
>> + unsigned int mic_bias = SDW_SDCA_CTL(function_id,
>> + WCD9378_IT33_ENTITY_ID,
>> + WCD9378_IT33_MICBIAS_SEL, 0);
>> +
>> + regcache_drop_region(regmap, mic_bias, mic_bias);
>> + ret = regmap_write(regmap, mic_bias, ctrl_it33_micbias_vals[0]);
>> + if (ret)
>> + dev_err(&slave->dev, "IT33 MIC_BIAS: %d\n", ret);
>> + } else if (entity_id == WCD9378_PDE47_ENTITY_ID) {
>> + /* Announce commit-group count for the FU42 writes in pde_post_pmu. */
>> + ret = regmap_write(core->dev_regmap,
>> + WCD9378_ENT0_COMMIT_GROUP_COUNT_ADDR,
>> + WCD9378_ENT0_COMMIT_GROUP_COUNT_TWO);
>> + if (ret)
>> + dev_err(&slave->dev, "Commit_Group_Count: %d\n", ret);
>> +
>> + /* Let the master's WR FIFO drain before PDE47_REQ_PS=0. */
>> + usleep_range(2000, 2500);
>
> Feels a bit odd using these callbacks for commit groups, really
> that is a thing that should be implemented more generically. That
> is a pretty serious task, so I can probably look past this as
> vendor specific thing for now. I guess my only points would be
> can you live without the commit groups and just use the current
> values? And if not, are you prepared that there is a good chance
> this gets missed when someone does implement commit groups and
> this breaks.
>
Mos of this is gone now in v2.
>> + /*
>> + * Unmute FU42 CH1/CH2 and stage 0 dB volume via the _CN (NEXT) alias
>> + * so all four staged writes activate together on the SCP_COMMIT
>> + * below. Writes go to the vendor slave regmap because FU42
>> + * addresses are outside the SDCA class regmap's routing.
>> + */
>> + ret = regmap_write(core->dev_regmap, WCD9378_FU42_MUTE_CH1_ADDR,
>> + WCD9378_FU42_MUTE_UNMUTE);
>> + if (ret)
>> + dev_err(&slave->dev, "FU42 MUTE_CH1: %d\n", ret);
>> +
>> + ret = regmap_write(core->dev_regmap, WCD9378_FU42_MUTE_CH2_ADDR,
>> + WCD9378_FU42_MUTE_UNMUTE);
>> + if (ret)
>> + dev_err(&slave->dev, "FU42 MUTE_CH2: %d\n", ret);
>> +
>> + ret = regmap_write(core->dev_regmap, WCD9378_FU42_CH_VOL_CH1_MSB_ADDR,
>> + WCD9378_FU42_CH_VOL_UNITY_BYTE);
>> + if (ret)
>> + dev_err(&slave->dev, "FU42 CH1_MSB: %d\n", ret);
>> + ret = regmap_write(core->dev_regmap, WCD9378_FU42_CH_VOL_CH1_LSB_ADDR,
>> + WCD9378_FU42_CH_VOL_UNITY_BYTE);
>> + if (ret)
>> + dev_err(&slave->dev, "FU42 CH1_LSB: %d\n", ret);
>> + ret = regmap_write(core->dev_regmap, WCD9378_FU42_CH_VOL_CH2_MSB_ADDR,
>> + WCD9378_FU42_CH_VOL_UNITY_BYTE);
>> + if (ret)
>> + dev_err(&slave->dev, "FU42 CH2_MSB: %d\n", ret);
>> + ret = regmap_write(core->dev_regmap, WCD9378_FU42_CH_VOL_CH2_LSB_ADDR,
>> + WCD9378_FU42_CH_VOL_UNITY_BYTE);
>> + if (ret)
>> + dev_err(&slave->dev, "FU42 CH2_LSB: %d\n", ret);
>
> These should all really be part of the function regmap they are
> function controls. Also would mean you have the MBQ so you don't
> need to do two writes per register. I assume, with the commit
> group stuff, these are writing the next value rather than the
> current? But nothing here updates the functions regmap for the
> new values, is it ok that those two get out of sync? Or do we
> not define these controls at the function level?
These are now part of the core in v2 which exposes them as proper mixer
controls.
These work fine as long as we apply the mixers after the PDE transition.
Which is not what user is expecting.
This behavior is because the codec seems to reset some registers to
default when we transition from PS3->PS0 state, volume, mute and micbias
are going back to default values, leaving the stream in mute.
I can try to re-apply them in the codec callback hook, but in general
how should we handle this in sdca core?
--srini
>
> Thanks,
> Charles
next prev parent reply other threads:[~2026-09-02 12:26 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-22 23:42 [RFC PATCH 0/8] ASoC: SDCA: enable on DT platforms and add Qualcomm WCD9378 (Tambora) codec Srinivas Kandagatla
2026-07-22 23:42 ` [RFC PATCH 1/8] ASoC: SDCA: hw_params: program upstream Input Terminals for OT DAI Srinivas Kandagatla
2026-07-24 13:14 ` Charles Keepax
2026-07-24 13:53 ` Charles Keepax
2026-07-24 16:35 ` Srinivas Kandagatla
2026-07-27 8:33 ` Charles Keepax
2026-07-27 12:42 ` Srinivas Kandagatla
2026-07-22 23:42 ` [RFC PATCH 2/8] ASoC: SDCA: allow building without ACPI Srinivas Kandagatla
2026-07-22 23:42 ` [RFC PATCH 3/8] ASoC: SDCA: expose class helpers with hw_ops for non-DisCo platforms Srinivas Kandagatla
2026-08-05 15:45 ` Charles Keepax
2026-07-22 23:42 ` [RFC PATCH 4/8] ASoC: SDCA: add PDE pre/post-pmu hooks to hw_ops Srinivas Kandagatla
2026-08-05 15:50 ` Charles Keepax
2026-07-22 23:42 ` [RFC PATCH 5/8] ASoC: SDCA: class_function: xlate sound-dai cell by entity index Srinivas Kandagatla
2026-07-22 23:42 ` [RFC PATCH 6/8] ASoC: SDCA: register SDCA_FUNCTION_TYPE_SIMPLE_JACK in class function driver Srinivas Kandagatla
2026-07-23 10:55 ` Charles Keepax
2026-07-22 23:42 ` [RFC PATCH 7/8] dt-bindings: sound: qcom: add Tambora WCD9378 SDCA codec Srinivas Kandagatla
2026-07-23 9:14 ` Konrad Dybcio
2026-07-23 13:28 ` Srinivas Kandagatla
2026-07-23 13:31 ` Konrad Dybcio
2026-07-29 11:40 ` Krzysztof Kozlowski
2026-07-29 12:17 ` Srinivas Kandagatla
2026-07-29 12:30 ` Krzysztof Kozlowski
2026-07-29 12:36 ` Srinivas Kandagatla
2026-07-29 12:43 ` Krzysztof Kozlowski
2026-07-29 13:02 ` Srinivas Kandagatla
2026-07-29 13:23 ` Krzysztof Kozlowski
2026-07-29 13:34 ` Srinivas Kandagatla
2026-07-29 14:04 ` Krzysztof Kozlowski
2026-07-29 17:23 ` Jorijn van der Graaf
2026-07-22 23:42 ` [RFC PATCH 8/8] ASoC: codecs: add Qualcomm Tambora (WCD9378) " Srinivas Kandagatla
2026-08-05 16:04 ` Charles Keepax
2026-09-02 12:26 ` Srinivas Kandagatla [this message]
2026-09-02 14:15 ` Charles Keepax
2026-07-23 10:17 ` [RFC PATCH 0/8] ASoC: SDCA: enable on DT platforms and add Qualcomm WCD9378 (Tambora) codec Charles Keepax
2026-07-23 13:24 ` Srinivas Kandagatla
2026-07-24 12:36 ` Charles Keepax
2026-07-24 14:31 ` Srinivas Kandagatla
2026-07-24 15:40 ` Charles Keepax
2026-07-24 16:29 ` Srinivas Kandagatla
2026-07-29 11:14 ` Srinivas Kandagatla
2026-07-29 11:41 ` Krzysztof Kozlowski
2026-07-30 9:08 ` Charles Keepax
2026-07-30 9:11 ` Krzysztof Kozlowski
2026-07-30 10:20 ` Charles Keepax
2026-08-18 12:26 ` Charles Keepax
2026-07-23 19:40 ` Jorijn van der Graaf
2026-07-24 12:17 ` Srinivas Kandagatla
2026-07-24 19:14 ` Jorijn van der Graaf
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=3bf36ae1-d771-4ccc-b306-9cd19f626462@oss.qualcomm.com \
--to=srinivas.kandagatla@oss.qualcomm.com \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jorijnvdgraaf@catcrafts.net \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mstrozek@opensource.cirrus.com \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=rf@opensource.cirrus.com \
--cc=robh@kernel.org \
--cc=srini@kernel.org \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.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®