Re: [PATCH 23/44] ASoC: codecs: max*: use .auto_selectable_formats

Peter Rosin <[email protected]>
Newsgroups org.kernel.vger.linux-sound
Message-ID <[email protected]>
On 2026-08-04 19:37, Mark Brown wrote:
> On Tue, Aug 04, 2026 at 12:42:26AM +0000, Kuninori Morimoto wrote:
>> We can use .auto_selectable_formats. Let's adds it.
> 
>> +static const u64 max9860_selectable_formats =
>> +	SND_SOC_POSSIBLE_DAIFMT_I2S	|
>> +	SND_SOC_POSSIBLE_DAIFMT_LEFT_J	|
>> +	SND_SOC_POSSIBLE_DAIFMT_DSP_A	|
>> +	SND_SOC_POSSIBLE_DAIFMT_DSP_B	|
>> +	SND_SOC_POSSIBLE_DAIFMT_NB_NF	|
>> +	SND_SOC_POSSIBLE_DAIFMT_NB_IF	|
>> +	SND_SOC_POSSIBLE_DAIFMT_IB_NF	|
>> +	SND_SOC_POSSIBLE_DAIFMT_IB_IF;
> 
> This has the same issue the Apple controller had where not all clock
> inversion setups are supported with all formats, I2S style and DSP style
> are different with DSP only supporting normal frame.

Hi!

I agree with this, but I worry that more such limitations are ignored.

E.g. max98090 has this:

	/* Remove 24-bit format support if it is not in right justified mode. */
	if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_RIGHT_J) {
		substream->runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
		snd_pcm_hw_constraint_msbits(substream->runtime, 0, 16, 16);
	}

Should RIGHT_J be preferred over I2S/LEFT_J/DSP_A for that codec?

I started looking at max98088 before proceeding to max98090 when the
above problem was spotted. I then stopped looking. It wasn't exactly
hard to find an example.

On the other hand, I'm not familiar with exactly how the auto selection
works...

Cheers,
Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.