alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Rajeev kumar <rajeev-dlh.kumar@st.com>
To: Axel Lin <axel.lin@ingics.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@ti.com>
Subject: Re: [PATCH RFT] ASoC: sta529: Fix update register bits in sta529_set_dai_fmt
Date: Thu, 20 Dec 2012 15:47:38 +0530	[thread overview]
Message-ID: <50D2E5C2.3010306@st.com> (raw)
In-Reply-To: <1355991445.11688.2.camel@phoenix>

Hello Axel,

On 12/20/2012 1:47 PM, Axel Lin wrote:
> 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.
>
> Signed-off-by: Axel Lin<axel.lin@ingics.com>
> ---
> 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.

Acked-By: Rajeev Kumar <rajeev-dlh.kumar@st.com>

> Thanks,
> Axel
>   sound/soc/codecs/sta529.c |    9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c
> index ab355c4..40c07be 100644
> --- a/sound/soc/codecs/sta529.c
> +++ b/sound/soc/codecs/sta529.c
> @@ -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;
>   }

  reply	other threads:[~2012-12-20 10:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20  8:17 [PATCH RFT] ASoC: sta529: Fix update register bits in sta529_set_dai_fmt Axel Lin
2012-12-20 10:17 ` Rajeev kumar [this message]
2012-12-20 16:01 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50D2E5C2.3010306@st.com \
    --to=rajeev-dlh.kumar@st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=axel.lin@ingics.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).