ASoC: sta529: Fix update register bits in sta529_set_dai_fmt
PATCH 1/1 ASoC: sta529: Fix update register bits in sta529_set_dai_fmt
Both the mask and mode settings are wrong in current code.
According to the datasheet:
S2PCFG0 (0x0A)
BIT[3:1] DATA_FORMAT
serial interface protocol format:
000: left Justified
001: I2S (default)
010: right justified
100: PCM no delay
101: PCM delay
111: DSP
Thus fixes the defines for LEFT_J_DATA_FORMAT, I2S_DATA_FORMAT, and RIGHT_J_DATA_FORMAT.
Also adds define for DATA_FORMAT_MSK.
---
Hi Rajeev,
I don't have this hardware, can you test this patch? Thanks,
Axel
sound/soc/codecs/sta529.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
sound/soc/codecs/sta529.c +5 -4
@@ -74,9 +74,10 @@ SNDRV_PCM_FMTBIT_S32_LE)#define S2PC_VALUE 0x98#define CLOCK_OUT 0x60 -#define LEFT_J_DATA_FORMAT 0x10 -#define I2S_DATA_FORMAT 0x12 -#define RIGHT_J_DATA_FORMAT 0x14 +#define DATA_FORMAT_MSK 0x0E +#define LEFT_J_DATA_FORMAT 0x00 +#define I2S_DATA_FORMAT 0x02 +#define RIGHT_J_DATA_FORMAT 0x04#define CODEC_MUTE_VAL 0x80#define POWER_CNTLMSAK 0x40
@@ -289,7 +290,7 @@ static int sta529_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt)return -EINVAL ; } -snd_soc_update_bits (codec,STA529_S2PCFG0 ,0x0D , mode); +snd_soc_update_bits (codec,STA529_S2PCFG0 ,DATA_FORMAT_MSK , mode);return 0 ; }
Signature · 1 line
1.7.9.5
Hello Axel,
Quoted 14 lines · Axel Lin
Both the mask and mode settings are wrong in current code.
According to the datasheet:
S2PCFG0 (
0x0A)
BIT[3:1]DATA_FORMAT
serial interface protocol format:
000: left Justified
001: I2S (default)
010: right justified
100: PCM no delay
101: PCM delay
111: DSP
Quoted 8 lines
Thus fixes the defines for
LEFT_J_DATA_FORMAT,I2S_DATA_FORMAT, andRIGHT_J_DATA_FORMAT.
Also adds define forDATA_FORMAT_MSK.Signed-off-by Axel Lin<[email protected]>---
Hi Rajeev,
I don't have this hardware, can you test this patch?
Thanks for pointing it out. I have tested it and is working fine.
Quoted 34 lines
Thanks,
Axelsound/soc/codecs/sta529.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)sound/soc/codecs/sta529.c +4
-3@@ -74,9 +74,10 @@ SNDRV_PCM_FMTBIT_S32_LE)#define S2PC_VALUE 0x98#define CLOCK_OUT 0x60 -#define LEFT_J_DATA_FORMAT 0x10 -#define I2S_DATA_FORMAT 0x12 -#define RIGHT_J_DATA_FORMAT 0x14 +#define DATA_FORMAT_MSK 0x0E +#define LEFT_J_DATA_FORMAT 0x00 +#define I2S_DATA_FORMAT 0x02 +#define RIGHT_J_DATA_FORMAT 0x04#define CODEC_MUTE_VAL 0x80#define POWER_CNTLMSAK 0x40sound/soc/codecs/sta529.c +1
-1@@ -289,7 +290,7 @@ static int sta529_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt)return -EINVAL ; } -snd_soc_update_bits (codec,STA529_S2PCFG0 ,0x0D , mode); +snd_soc_update_bits (codec,STA529_S2PCFG0 ,DATA_FORMAT_MSK , mode);return 0 ; }
Mark Brown
AppliedQuoted 3 lines · Axel Lin
Both the mask and mode settings are wrong in current code.
According to the datasheet:
Applied, thanks.