Skip to content

Commit

Permalink
ASoC: codecs: tas5720: add TAS5722 TDM slot width setting support
Browse files Browse the repository at this point in the history
Unlike the TAS5720, the TAS5722 can be configured to utilize 16-bit wide
slots in TDM mode. This can help easing audio clocking/frequency
requirements.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Andreas Dannenberg authored and Mark Brown committed Aug 31, 2018
1 parent ec94c17 commit db658f4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sound/soc/codecs/tas5720.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static int tas5720_set_dai_tdm_slot(struct snd_soc_dai *dai,
int slots, int slot_width)
{
struct snd_soc_component *component = dai->component;
struct tas5720_data *tas5720 = snd_soc_component_get_drvdata(component);
unsigned int first_slot;
int ret;

Expand Down Expand Up @@ -185,6 +186,20 @@ static int tas5720_set_dai_tdm_slot(struct snd_soc_dai *dai,
if (ret < 0)
goto error_snd_soc_component_update_bits;

/* Configure TDM slot width. This is only applicable to TAS5722. */
switch (tas5720->devtype) {
case TAS5722:
ret = snd_soc_component_update_bits(component, TAS5722_DIGITAL_CTRL2_REG,
TAS5722_TDM_SLOT_16B,
slot_width == 16 ?
TAS5722_TDM_SLOT_16B : 0);
if (ret < 0)
goto error_snd_soc_component_update_bits;
break;
default:
break;
}

return 0;

error_snd_soc_component_update_bits:
Expand Down

0 comments on commit db658f4

Please sign in to comment.