Skip to contentSkip to conversation

ASoC: mpc8610: tell the CS4270 codec that it's the master

PATCH Applied Timur Tabi 3 participants 4 messages Nov 22, 2011 – Nov 23, 2011

Subsystems (2)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH 1/1 ASoC: mpc8610: tell the CS4270 codec that it's the master

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.

---
 sound/soc/fsl/mpc8610_hpcd.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)
sound/soc/fsl/mpc8610_hpcd.c +16 -8
index 31af405..ae49f1c 100644
@@ -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 {
Signature · 1 line
1.7.3.4
Applied
#1 lore raw
Quoted 3 lines · Timur Tabi

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.

#2 lore raw
Quoted 6 lines · Mark Brown
Quoted 3 lines · Timur Tabi

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.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#3 lore raw
Quoted 2 lines · 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.