From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?P=E9ter?= Ujfalusi Subject: Re: [PATCH for-3.2 1/2] ASoC: omap-mcbsp: Fix FS polarity for LEFT_J, DSP_A and DSP_B formats Date: Fri, 30 Sep 2011 11:47:33 +0300 Message-ID: <4047208.99FlxY0R56@barack> References: <1317369333-20814-1-git-send-email-jarkko.nikula@bitmer.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from na3sys009aog116.obsmtp.com (na3sys009aog116.obsmtp.com [74.125.149.240]) by alsa0.perex.cz (Postfix) with ESMTP id 4038324375 for ; Fri, 30 Sep 2011 10:47:25 +0200 (CEST) Received: by mail-bw0-f44.google.com with SMTP id q10so2234707bka.17 for ; Fri, 30 Sep 2011 01:47:22 -0700 (PDT) In-Reply-To: <1317369333-20814-1-git-send-email-jarkko.nikula@bitmer.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Jarkko Nikula Cc: alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood List-Id: alsa-devel@alsa-project.org On Friday 30 September 2011 10:55:32 Jarkko Nikula wrote: > Commit 75d9ac4 ("ASoC: Allow DAI formats to be specified in the dai_link") > changed DAI format flag values and we cannot simply invert anymore e.g. > frame-sync with ^=3D SND_SOC_DAIFMT_NB_IF (which was anyway misuse) as th= ere > is no anymore fixed bit position for bit-clock or frame-sync inversion. > = > Fix this by relying only on DAI format flag values passed to us and by not > making any assumption on individual bit positions. > = > Signed-off-by: Jarkko Nikula > Cc: Peter Ujfalusi I have missed the 75d9ac4 ;) As a note: omap-mcbsp still needs the runtime configuration of dai format... Acked-by: Peter Ujfalusi > --- > sound/soc/omap/omap-mcbsp.c | 12 +++++++----- > 1 files changed, 7 insertions(+), 5 deletions(-) > = > diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c > index 1391ea0..894f2f3 100644 > --- a/sound/soc/omap/omap-mcbsp.c > +++ b/sound/soc/omap/omap-mcbsp.c > @@ -398,7 +398,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_= dai > *cpu_dai, { > struct omap_mcbsp_data *mcbsp_data =3D snd_soc_dai_get_drvdata(cpu_dai); > struct omap_mcbsp_reg_cfg *regs =3D &mcbsp_data->regs; > - unsigned int temp_fmt =3D fmt; > + bool inv_fs =3D false; > = > if (mcbsp_data->configured) > return 0; > @@ -430,21 +430,21 @@ static int omap_mcbsp_dai_set_dai_fmt(struct > snd_soc_dai *cpu_dai, regs->xcr2 |=3D XDATDLY(0); > regs->spcr1 |=3D RJUST(2); > /* Invert FS polarity configuration */ > - temp_fmt ^=3D SND_SOC_DAIFMT_NB_IF; > + inv_fs =3D true; > break; > case SND_SOC_DAIFMT_DSP_A: > /* 1-bit data delay */ > regs->rcr2 |=3D RDATDLY(1); > regs->xcr2 |=3D XDATDLY(1); > /* Invert FS polarity configuration */ > - temp_fmt ^=3D SND_SOC_DAIFMT_NB_IF; > + inv_fs =3D true; > break; > case SND_SOC_DAIFMT_DSP_B: > /* 0-bit data delay */ > regs->rcr2 |=3D RDATDLY(0); > regs->xcr2 |=3D XDATDLY(0); > /* Invert FS polarity configuration */ > - temp_fmt ^=3D SND_SOC_DAIFMT_NB_IF; > + inv_fs =3D true; > break; > default: > /* Unsupported data format */ > @@ -468,7 +468,7 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_= dai > *cpu_dai, } > = > /* Set bit clock (CLKX/CLKR) and FS polarities */ > - switch (temp_fmt & SND_SOC_DAIFMT_INV_MASK) { > + switch (fmt & SND_SOC_DAIFMT_INV_MASK) { > case SND_SOC_DAIFMT_NB_NF: > /* > * Normal BCLK + FS. > @@ -489,6 +489,8 @@ static int omap_mcbsp_dai_set_dai_fmt(struct snd_soc_= dai > *cpu_dai, default: > return -EINVAL; > } > + if (inv_fs =3D=3D true) > + regs->pcr0 ^=3D FSXP | FSRP; > = > return 0; > } -- P=E9ter