Skip to contentSkip to conversation

ASoC: SAMSUNG: Add SND_SOC_DAIFMT_CONT option for snd_soc_set_fmt()

PATCH In review 박상수 2 participants 7 messages Aug 26, 2012 – Sep 6, 2012

Subsystems (4)
lore
Share & tools
lore

박상수

author
#0 lore raw

PATCH 1/1 ASoC: SAMSUNG: Add SND_SOC_DAIFMT_CONT option for snd_soc_set_fmt()

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.

---
 sound/soc/samsung/smdk_wm8994pcm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/soc/samsung/smdk_wm8994pcm.c +1 -0
index 77ecba9..cb88cbc 100644
@@ -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)
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · �ڻ���

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...

sound/soc/samsung/smdk_wm8994pcm.c static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream, · line 82

Quoted 5 lines
sound/soc/samsung/smdk_wm8994pcm.c +1 -0
 	/* 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?

#2 lore raw
Quoted 7 lines · Mark Brown
Quoted 3 lines · 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.

Quoted 9 lines

sound/soc/samsung/smdk_wm8994pcm.c static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream, · line 82

Quoted 6 lines
sound/soc/samsung/smdk_wm8994pcm.c +1 -0
 	/* 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.

Quoted 3 lines

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.

Quoted 2 lines

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.

Quoted 5 lines

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

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.

Quoted 6 lines · Mark Brown
Quoted 3 lines

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.

Quoted 17 lines
Quoted 1 line

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;
        }
Quoted 1 line

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).

#4 lore raw
Quoted 4 lines · Mark Brown

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?

Quoted 11 lines
Quoted 4 lines · Mark Brown
Quoted 2 lines

a whole lot of sense on the slave side, it's related to the clock

generation so should have no

Quoted 1 line
Quoted 1 line

effect at all on the slave side. The driver code looks reasonably

sensible though.

Quoted 1 line

You mean cpu side is slave?

Yes.

But, Samsung pcm is working only for cpu master.

Quoted 20 lines
Quoted 5 lines
Quoted 3 lines

What specifically is going wrong here?

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

below.

Quoted 12 lines
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;
        }
Quoted 8 lines
Quoted 1 line

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.)

Quoted 5 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw
Quoted 7 lines · Sangsu Park
Quoted 4 lines · Mark Brown

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.

Quoted 2 lines

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.

#6 lore raw
Quoted 9 lines · Mark Brown
Quoted 7 lines · Sangsu Park
Quoted 4 lines · Mark Brown

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?

Quoted 9 lines

Looks like it, thanks.

Quoted 2 lines

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.

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel