Skip to content

Commit cb67a58

Browse files
marcanjannau
authored andcommitted
ASoC: tas2770: Set the SDOUT polarity correctly
TX launch polarity needs to be the opposite of RX capture polarity, to generate the right bit slot alignment. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent 923d742 commit cb67a58

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

sound/soc/codecs/tas2770.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
363363
struct snd_soc_component *component = dai->component;
364364
struct tas2770_priv *tas2770 =
365365
snd_soc_component_get_drvdata(component);
366-
u8 tdm_rx_start_slot = 0, invert_fpol = 0, fpol_preinv = 0, asi_cfg_1 = 0;
366+
u8 tdm_rx_start_slot = 0, invert_fpol = 0, fpol_preinv = 0, asi_cfg_1 = 0, asi_cfg_4 = 0;
367367
int ret;
368368

369369
switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
@@ -380,6 +380,7 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
380380
fallthrough;
381381
case SND_SOC_DAIFMT_NB_NF:
382382
asi_cfg_1 |= TAS2770_TDM_CFG_REG1_RX_RSING;
383+
asi_cfg_4 |= TAS2770_TDM_CFG_REG4_TX_EDGE_FALLING;
383384
break;
384385
case SND_SOC_DAIFMT_IB_IF:
385386
invert_fpol = 1;
@@ -398,6 +399,12 @@ static int tas2770_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
398399
if (ret < 0)
399400
return ret;
400401

402+
ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG4,
403+
TAS2770_TDM_CFG_REG4_TX_EDGE_FALLING,
404+
asi_cfg_4);
405+
if (ret < 0)
406+
return ret;
407+
401408
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
402409
case SND_SOC_DAIFMT_I2S:
403410
tdm_rx_start_slot = 1;

0 commit comments

Comments
 (0)