diff mbox

ASoC: SAMSUNG: Add SND_SOC_DAIFMT_CONT option for snd_soc_set_fmt()

Message ID 003101cd8367$3476e650$9d64b2f0$@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

??? Aug. 26, 2012, 8:45 a.m. UTC
SND_SOC_DAIFMT_CONT option is now needed because of below commit:

ASoC: Allow DAI formats to be specified in the dai_link

Otherwise, s3c_pcm_set_fmt() returns -EINVAL.

Signed-off-by: Sangsu Park <sangsu4u.park@samsung.com>
---
 sound/soc/samsung/smdk_wm8994pcm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Mark Brown Aug. 27, 2012, 8:45 p.m. UTC | #1
On Sun, Aug 26, 2012 at 05:45:54PM +0900, ????? wrote:
> SND_SOC_DAIFMT_CONT option is now needed because of below commit:
> 
> ASoC: Allow DAI formats to be specified in the dai_link

Clearly it's not a direct consequence of this commit, that just
introduces a new optional facility which...

>  	/* Set the cpu DAI configuration */
>  	ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_B
> +				| SND_SOC_DAIFMT_CONT
>  				| SND_SOC_DAIFMT_IB_NF
>  				| SND_SOC_DAIFMT_CBS_CFS);

...isn't being used by the driver.

Looking at the above it looks like the PCM driver is doing something
very odd - _CONT doesn't make a whole lot of sense on the slave side,
it's related to the clock generation so should have no effect at all on
the slave side.  The driver code looks reasonably sensible though.

What specifically is going wrong here?
??? Aug. 29, 2012, 11:06 a.m. UTC | #2
On Sun, Aug 26, 2012 at 05:45:54PM +0900, Mark Brown wrote:
> On Sun, Aug 26, 2012 at 05:45:54PM +0900,  ?    wrote:
> > SND_SOC_DAIFMT_CONT option is now needed because of below commit:
> >
> > ASoC: Allow DAI formats to be specified in the dai_link
> 
> Clearly it's not a direct consequence of this commit, that just introduces a new optional facility
> which...
OK, I'll change it.
> 
> >  	/* Set the cpu DAI configuration */
> >  	ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_B
> > +				| SND_SOC_DAIFMT_CONT
> >  				| SND_SOC_DAIFMT_IB_NF
> >  				| SND_SOC_DAIFMT_CBS_CFS);
> 
> ...isn't being used by the driver.
> 
> Looking at the above it looks like the PCM driver is doing something very odd - _CONT doesn't make
> a whole lot of sense on the slave side, it's related to the clock generation so should have no
> effect at all on the slave side.  The driver code looks reasonably sensible though.
You mean cpu side is slave? 
And I think that pcm driver can be changed to solve this issue.
> 
> What specifically is going wrong here?
SND_SOC_DAIFMT_CONT is used sound/soc/Samsung/pcm.c (s3c_pcm_set_fmt()) like below.

switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
        case SND_SOC_DAIFMT_CONT:
                pcm->idleclk = 1;
                break;
        case SND_SOC_DAIFMT_GATED:
                pcm->idleclk = 0;
                break;
        default:
                dev_err(pcm->dev, "Invalid Clock gating request!\n");
                ret = -EINVAL;
                goto exit;
        }

If fmt argument has no SND_SOC_DAIFMT_ option, s3c_pcm_set_fmt() return -EINVAL.

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown Aug. 30, 2012, 5:43 p.m. UTC | #3
On Wed, Aug 29, 2012 at 08:06:32PM +0900, Sangsu Park wrote:

Please check your mailer configuration, it looks like it's reformatting
all the text with much longer line widths.

> On Sun, Aug 26, 2012 at 05:45:54PM +0900, Mark Brown wrote:

> > a whole lot of sense on the slave side, it's related to the clock generation so should have no
> > effect at all on the slave side.  The driver code looks reasonably sensible though.

> You mean cpu side is slave? 

Yes.


> > What specifically is going wrong here?

> SND_SOC_DAIFMT_CONT is used sound/soc/Samsung/pcm.c (s3c_pcm_set_fmt()) like below.

> switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
>         case SND_SOC_DAIFMT_CONT:
>                 pcm->idleclk = 1;
>                 break;
>         case SND_SOC_DAIFMT_GATED:
>                 pcm->idleclk = 0;
>                 break;
>         default:
>                 dev_err(pcm->dev, "Invalid Clock gating request!\n");
>                 ret = -EINVAL;
>                 goto exit;
>         }

> If fmt argument has no SND_SOC_DAIFMT_ option, s3c_pcm_set_fmt() return -EINVAL.

So, clearly this is unrelated to the change you mentioned in your commit
message - it looks like this is just a plain issue in the machine
driver.  That said the above code should be changed to at least ignore
the setting in slave mode (since the clock shouldn't be being driven and
it doesn't matter).
??? Sept. 3, 2012, 2:10 a.m. UTC | #4
On Sun, Aug 31, 2012 at 2:43 AM +0900, Mark Brown wrote:
> On Wed, Aug 29, 2012 at 08:06:32PM +0900, Sangsu Park wrote:
> 
> Please check your mailer configuration, it looks like it's reformatting
> all the text with much longer line widths.

I've changed line width configuration. Is it ok now?

> 
> > On Sun, Aug 26, 2012 at 05:45:54PM +0900, Mark Brown wrote:
> 
> > > a whole lot of sense on the slave side, it's related to the clock
> generation so should have no
> > > effect at all on the slave side.  The driver code looks reasonably
> sensible though.
> 
> > You mean cpu side is slave?
> 
> Yes.

But, Samsung pcm is working only for cpu master. 

> 
> 
> > > What specifically is going wrong here?
> 
> > SND_SOC_DAIFMT_CONT is used sound/soc/Samsung/pcm.c (s3c_pcm_set_fmt()) like
> below.
> 
> > switch (fmt & SND_SOC_DAIFMT_CLOCK_MASK) {
> >         case SND_SOC_DAIFMT_CONT:
> >                 pcm->idleclk = 1;
> >                 break;
> >         case SND_SOC_DAIFMT_GATED:
> >                 pcm->idleclk = 0;
> >                 break;
> >         default:
> >                 dev_err(pcm->dev, "Invalid Clock gating request!\n");
> >                 ret = -EINVAL;
> >                 goto exit;
> >         }
> 
> > If fmt argument has no SND_SOC_DAIFMT_ option, s3c_pcm_set_fmt() return -
> EINVAL.
> 
> So, clearly this is unrelated to the change you mentioned in your commit
> message - it looks like this is just a plain issue in the machine
> driver.  That said the above code should be changed to at least ignore
> the setting in slave mode (since the clock shouldn't be being driven and
> it doesn't matter).

Do you think that changing pcm driver is right approach?
Then I'll fix pcm driver. (I think that pcm driver has some strange code.)

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mark Brown Sept. 6, 2012, 12:21 a.m. UTC | #5
On Mon, Sep 03, 2012 at 11:10:03AM +0900, Sangsu Park wrote:
> On Sun, Aug 31, 2012 at 2:43 AM +0900, Mark Brown wrote:
> > On Wed, Aug 29, 2012 at 08:06:32PM +0900, Sangsu Park wrote:

> > Please check your mailer configuration, it looks like it's reformatting
> > all the text with much longer line widths.

> I've changed line width configuration. Is it ok now?

Looks like it, thanks.

> Do you think that changing pcm driver is right approach?
> Then I'll fix pcm driver. (I think that pcm driver has some strange code.)

Well, we could do both.  It'd certainly be more natural to make it have
a default given that this isn't something that normally needs to be
configured.
??? Sept. 6, 2012, 8:57 a.m. UTC | #6
On Thurs, Sep 06, 2012 at 9:22 AM +0900, Mark Brown wrote:
> On Mon, Sep 03, 2012 at 11:10:03AM +0900, Sangsu Park wrote:
> > On Sun, Aug 31, 2012 at 2:43 AM +0900, Mark Brown wrote:
> > > On Wed, Aug 29, 2012 at 08:06:32PM +0900, Sangsu Park wrote:
> 
> > > Please check your mailer configuration, it looks like it's reformatting
> > > all the text with much longer line widths.
> 
> > I've changed line width configuration. Is it ok now?
> 
> Looks like it, thanks.
> 
> > Do you think that changing pcm driver is right approach?
> > Then I'll fix pcm driver. (I think that pcm driver has some strange code.)
> 
> Well, we could do both.  It'd certainly be more natural to make it have
> a default given that this isn't something that normally needs to be
> configured.
> 
Then, I'll fix pcm driver to use default given
and resend that patch.

Thanks.
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox

Patch

diff --git a/sound/soc/samsung/smdk_wm8994pcm.c b/sound/soc/samsung/smdk_wm8994pcm.c
index 77ecba9..cb88cbc 100644
--- a/sound/soc/samsung/smdk_wm8994pcm.c
+++ b/sound/soc/samsung/smdk_wm8994pcm.c
@@ -77,6 +77,7 @@  static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream,
 
 	/* Set the cpu DAI configuration */
 	ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_B
+				| SND_SOC_DAIFMT_CONT
 				| SND_SOC_DAIFMT_IB_NF
 				| SND_SOC_DAIFMT_CBS_CFS);
 	if (ret < 0)