Re: [PATCH v2 2/2] ASoC: codecs: add Qualcomm WSA885X codec driver

From: Prasad Kumpatla

Date: Tue Jul 07 2026 - 08:45:06 EST



On 7/3/2026 8:37 PM, Mark Brown wrote:
On Wed, Jul 01, 2026 at 07:29:13PM +0530, Prasad Kumpatla wrote:
Add an ASoC codec driver for the Qualcomm WSA885X stereo smart speaker
amplifier controlled over I2C.

Hi Mark,

Thanks for reviewing patch and feedback.

+static struct snd_soc_dai_driver wsa885x_dai[] = {
+ {
+ .name = "wsa885x_dai_drv",
+ .playback = {
+ .stream_name = "WSA885X TDM Playback",
+ .channels_min = 1,
+ .channels_max = 2,
+ .rates = SNDRV_PCM_RATE_8000_192000 |
+ SNDRV_PCM_RATE_352800 |
+ SNDRV_PCM_RATE_384000,
+ .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |
+ SNDRV_PCM_FMTBIT_S32_LE,
+ },
+ .ops = &wsa885x_dai_ops,
+ },
+};
Does the device actually support all the rates advertised, 11.025kHz for
example?
Thanks for pointing this out. I have only validated a subset of the advertised sample rates and
have not specifically verified all rates within the range (e.g. 11.025 kHz).
I'll restrict the supported rates to those that have been explicitly tested and validated.

+static int wsa885x_rx_slot_mask_put(struct snd_kcontrol *kcontrol,
+ struct snd_ctl_elem_value *ucontrol)
+{
+ struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
+ struct wsa885x_priv *wsa885x = snd_soc_component_get_drvdata(component);
+ u32 mask = ucontrol->value.integer.value[0];
+
+ if (!wsa885x_is_valid_rx_slot_mask(mask))
+ return -EINVAL;
+
+ if (wsa885x->rx_slot_mask == mask)
+ return 0;
+
+ wsa885x->rx_slot_mask = mask;
+
+ return 1;
+}
This looks like you're trying to put TDM configuration in the control
API, it should be done via set_tdm_slot() - the driver does have one,
but it only configures mono vs stereo with no control over slot
placement.
The slot mask is use-case dependent and needs to be switched dynamically at runtime
(e.g. stereo speaker playback versus mono voice-call scenarios). The mixer control was
introduced to allow userspace to select the appropriate slot assignment when the active
use case changes. Given that `set_tdm_slot()` is generally used for DAI slot configuration,
could you please advise if there is any preferred ASoC approach for supporting runtime slot-mask
changes driven by use-case transitions?

Thanks,

Prasad