Skip to content

Commit 067e2f3

Browse files
gtrainaviciuspelwell
authored andcommitted
Pisound Micro: Workaround for snd_soc_dai_set_tdm_slot with slots=0
Even though it's documented that specifying slots=0 can be used to disable the TDM mode, error checking introduced in 6.12.31 version broke this, therefore, for the time being, a workaround is to provide a xlate_tdm_slot_mask operation implementation to return 0 instead of -EINVAL as it does in case slots argument is 0. Signed-off-by: Giedrius Trainavičius <[email protected]>
1 parent 565442e commit 067e2f3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sound/drivers/upisnd/upisnd_codec.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,14 @@ static int adau1961_set_dai_fmt(struct snd_soc_dai *dai,
583583
return 0;
584584
}
585585

586+
static int adau1961_xlate_tdm_slot_mask(unsigned int slots,
587+
unsigned int *tx_mask,
588+
unsigned int *rx_mask)
589+
{
590+
// Workaround for snd_soc_dai_set_tdm_slot issue when slots=0.
591+
return 0;
592+
}
593+
586594
static int adau1961_set_dai_tdm_slot(struct snd_soc_dai *dai,
587595
unsigned int tx_mask,
588596
unsigned int rx_mask,
@@ -698,6 +706,7 @@ static const struct snd_soc_dai_ops adau1961_dai_ops = {
698706
.set_pll = adau1961_set_dai_pll,
699707
.set_tdm_slot = adau1961_set_dai_tdm_slot,
700708
.startup = adau1961_startup,
709+
.xlate_tdm_slot_mask = adau1961_xlate_tdm_slot_mask,
701710
};
702711

703712
static bool adau1961_precious_register(struct device *dev, unsigned int reg)

0 commit comments

Comments
 (0)