Tested and the following is something we can use without creating a new dailink.
On SSP1, for dmic we need to fix the channels which is derived from dmic_numFor speakers and headsets its 48Khz, 2 ch and 24 bit and thisis set to either 2 or 4 dmic_constraints. No other formats need to be set.
setting is done based on the front-end dai For speakers, however
support only
16 bit, so we set it back to 16 bit If the front end dai is dmic,
then the channel
speakers and headset which are on different SSP. This is the reason we
All the SSP1 usages do not have the same parameters (as dmic is on
SSP1 and its different as given above) Most parameters are same for
had a single fixup function.
of the snd_soc_acpi_mach structure based on the number of dmic on the
board.
The channel is something that might be different from speakers.
We might not want to constraint the dmic capture to always be 48Khz as well.
Given this, there seems to me, 2 ways to set it:
1. Derive if the fixup is being called for dmic or speaker 2. Having a new dailink
If #2 is not preferred (going by Pierre's comments), can we use rtd-
cpu_dai/codec_dai->name to figure out if its for dmic or speaker?I can test this and get back to you.
struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
if (!strcmp(codec_dai->name, KBL_REALTEK_DMIC_CODEC_DAI)) {
if (params_channels(params) == 2 || DMIC_CH(dmic_constraints) == 2)
channels->min = channels->max = 2;
else
channels->min = channels->max = 4;
} else {
rate->min = rate->max = 48000;
channels->min = channels->max = 2;
snd_mask_none(fmt);
snd_mask_set_format(fmt, pcm_fmt);
}
Pierre, thoughts?