* [PATCH] ASoC: mpc8610: tell the CS4270 codec that it's the master
@ 2011-11-22 20:38 Timur Tabi
2011-11-22 23:05 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Timur Tabi @ 2011-11-22 20:38 UTC (permalink / raw)
To: lrg, broonie, alsa-devel
Commit ac601555 ("ASoC: Return early with -EINVAL if invalid dai format is
detected") requires the machine driver to tell the CS4270 codec driver
whether the CS4270 should be configured for master or slave operation.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
sound/soc/fsl/mpc8610_hpcd.c | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c
index 31af405..ae49f1c 100644
--- a/sound/soc/fsl/mpc8610_hpcd.c
+++ b/sound/soc/fsl/mpc8610_hpcd.c
@@ -392,7 +392,8 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
}
if (strcasecmp(sprop, "i2s-slave") == 0) {
- machine_data->dai_format = SND_SOC_DAIFMT_I2S;
+ machine_data->dai_format =
+ SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM;
machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT;
machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN;
@@ -409,31 +410,38 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
}
machine_data->clk_frequency = be32_to_cpup(iprop);
} else if (strcasecmp(sprop, "i2s-master") == 0) {
- machine_data->dai_format = SND_SOC_DAIFMT_I2S;
+ machine_data->dai_format =
+ SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS;
machine_data->codec_clk_direction = SND_SOC_CLOCK_IN;
machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT;
} else if (strcasecmp(sprop, "lj-slave") == 0) {
- machine_data->dai_format = SND_SOC_DAIFMT_LEFT_J;
+ machine_data->dai_format =
+ SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM;
machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT;
machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN;
} else if (strcasecmp(sprop, "lj-master") == 0) {
- machine_data->dai_format = SND_SOC_DAIFMT_LEFT_J;
+ machine_data->dai_format =
+ SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBS_CFS;
machine_data->codec_clk_direction = SND_SOC_CLOCK_IN;
machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT;
} else if (strcasecmp(sprop, "rj-slave") == 0) {
- machine_data->dai_format = SND_SOC_DAIFMT_RIGHT_J;
+ machine_data->dai_format =
+ SND_SOC_DAIFMT_RIGHT_J | SND_SOC_DAIFMT_CBM_CFM;
machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT;
machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN;
} else if (strcasecmp(sprop, "rj-master") == 0) {
- machine_data->dai_format = SND_SOC_DAIFMT_RIGHT_J;
+ machine_data->dai_format =
+ SND_SOC_DAIFMT_RIGHT_J | SND_SOC_DAIFMT_CBS_CFS;
machine_data->codec_clk_direction = SND_SOC_CLOCK_IN;
machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT;
} else if (strcasecmp(sprop, "ac97-slave") == 0) {
- machine_data->dai_format = SND_SOC_DAIFMT_AC97;
+ machine_data->dai_format =
+ SND_SOC_DAIFMT_AC97 | SND_SOC_DAIFMT_CBM_CFM;
machine_data->codec_clk_direction = SND_SOC_CLOCK_OUT;
machine_data->cpu_clk_direction = SND_SOC_CLOCK_IN;
} else if (strcasecmp(sprop, "ac97-master") == 0) {
- machine_data->dai_format = SND_SOC_DAIFMT_AC97;
+ machine_data->dai_format =
+ SND_SOC_DAIFMT_AC97 | SND_SOC_DAIFMT_CBS_CFS;
machine_data->codec_clk_direction = SND_SOC_CLOCK_IN;
machine_data->cpu_clk_direction = SND_SOC_CLOCK_OUT;
} else {
--
1.7.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: mpc8610: tell the CS4270 codec that it's the master
2011-11-22 20:38 [PATCH] ASoC: mpc8610: tell the CS4270 codec that it's the master Timur Tabi
@ 2011-11-22 23:05 ` Mark Brown
2011-11-23 5:30 ` Tabi Timur-B04825
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2011-11-22 23:05 UTC (permalink / raw)
To: Timur Tabi; +Cc: alsa-devel, lrg
On Tue, Nov 22, 2011 at 02:38:59PM -0600, Timur Tabi wrote:
> Commit ac601555 ("ASoC: Return early with -EINVAL if invalid dai format is
> detected") requires the machine driver to tell the CS4270 codec driver
> whether the CS4270 should be configured for master or slave operation.
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: mpc8610: tell the CS4270 codec that it's the master
2011-11-22 23:05 ` Mark Brown
@ 2011-11-23 5:30 ` Tabi Timur-B04825
2011-11-23 10:30 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Tabi Timur-B04825 @ 2011-11-23 5:30 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel@alsa-project.org, lrg@ti.com
Mark Brown wrote:
> On Tue, Nov 22, 2011 at 02:38:59PM -0600, Timur Tabi wrote:
>> Commit ac601555 ("ASoC: Return early with -EINVAL if invalid dai format is
>> detected") requires the machine driver to tell the CS4270 codec driver
>> whether the CS4270 should be configured for master or slave operation.
>
> Applied, thanks.
So it turns out that the commit message for this patch is wrong. Sorry.
The commit that broke the MPC8610 is "ASoC: Allow DAI formats to be
specified in the dai_link", which changed the definition of
SND_SOC_DAIFMT_CBM_CFM to a non-zero value. Patch "ASoC: Return early
with -EINVAL if invalid dai format is detected" doesn't really do anything.
I don't know if it's too late to amend the commit, but if it isn't, the
proper message is:
Commit 4eae080d ("ASoC: Add cs4270 support for slave mode configurations")
requires the machine driver to set one of the SND_SOC_DAIFMT_CBx_xxx
values. The MPC8610 machine driver should be setting
SND_SOC_DAIFMT_CBM_CFM, but since that value is zero, no one noticed.
Commit 75d9ac46 ("ASoC: Allow DAI formats to be specified in the
dai_link"), however, changed the value of SND_SOC_DAIFMT_CBM_CFM from zero
to a non-zero value, which means that it now needs to be specifically set
by the machine driver.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: mpc8610: tell the CS4270 codec that it's the master
2011-11-23 5:30 ` Tabi Timur-B04825
@ 2011-11-23 10:30 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2011-11-23 10:30 UTC (permalink / raw)
To: Tabi Timur-B04825; +Cc: alsa-devel@alsa-project.org, lrg@ti.com
On Wed, Nov 23, 2011 at 05:30:08AM +0000, Tabi Timur-B04825 wrote:
> I don't know if it's too late to amend the commit, but if it isn't, the
> proper message is:
Sorry, there's already merges based off the commit.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-23 10:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-22 20:38 [PATCH] ASoC: mpc8610: tell the CS4270 codec that it's the master Timur Tabi
2011-11-22 23:05 ` Mark Brown
2011-11-23 5:30 ` Tabi Timur-B04825
2011-11-23 10:30 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.