Skip to contentSkip to conversation

ASoC: WM8580: Debug interface index

PATCH In review Jassi Brar 4 participants 5 messages Dec 3, 2010 – Dec 20, 2010

Subsystems (3)
lore
Share & tools
lore

Jassi Brar

author
#0 lore raw

PATCH 1/1 ASoC: WM8580: Debug interface index

We want the index of DAI's driver here.

---
 sound/soc/codecs/wm8580.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
sound/soc/codecs/wm8580.c +4 -4
index e2a9276..cb7765f 100644
@@ -507,13 +507,13 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	/* Look up the SYSCLK ratio; accept only exact matches */
-	ratio = wm8580->sysclk[dai->id] / params_rate(params);
+	ratio = wm8580->sysclk[dai->driver->id] / params_rate(params);
 	for (i = 0; i < ARRAY_SIZE(wm8580_sysclk_ratios); i++)
 		if (ratio == wm8580_sysclk_ratios[i])
 			break;
 	if (i == ARRAY_SIZE(wm8580_sysclk_ratios)) {
 		dev_err(codec->dev, "Invalid clock ratio %d/%d\n",
-			wm8580->sysclk[dai->id], params_rate(params));
+			wm8580->sysclk[dai->driver->id], params_rate(params));
 		return -EINVAL;
 	}
 	paifa |= i;
@@ -716,7 +716,7 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 
 	switch (clk_id) {
 	case WM8580_CLKSRC_ADCMCLK:
-		if (dai->id != WM8580_DAI_PAIFTX)
+		if (dai->driver->id != WM8580_DAI_PAIFTX)
 			return -EINVAL;
 		sel = 0 << sel_shift;
 		break;
@@ -735,7 +735,7 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 	}
 
 	/* We really should validate PLL settings but not yet */
-	wm8580->sysclk[dai->id] = freq;
+	wm8580->sysclk[dai->driver->id] = freq;
 
 	return snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel);
 }
Signature · 1 line
1.6.2.5
#1 lore raw
Quoted 2 lines · Jassi Brar

We want the index of DAI's driver here.

It's fine but could you add a little more context here.

Quoted 43 lines
---
 sound/soc/codecs/wm8580.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
sound/soc/codecs/wm8580.c +4 -4
index e2a9276..cb7765f 100644
@@ -507,13 +507,13 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	/* Look up the SYSCLK ratio; accept only exact matches */
-	ratio = wm8580->sysclk[dai->id] / params_rate(params);
+	ratio = wm8580->sysclk[dai->driver->id] / params_rate(params);
 	for (i = 0; i < ARRAY_SIZE(wm8580_sysclk_ratios); i++)
 		if (ratio == wm8580_sysclk_ratios[i])
 			break;
 	if (i == ARRAY_SIZE(wm8580_sysclk_ratios)) {
 		dev_err(codec->dev, "Invalid clock ratio %d/%d\n",
-			wm8580->sysclk[dai->id], params_rate(params));
+			wm8580->sysclk[dai->driver->id], params_rate(params));
 		return -EINVAL;
 	}
 	paifa |= i;
@@ -716,7 +716,7 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 
 	switch (clk_id) {
 	case WM8580_CLKSRC_ADCMCLK:
-		if (dai->id != WM8580_DAI_PAIFTX)
+		if (dai->driver->id != WM8580_DAI_PAIFTX)
 			return -EINVAL;
 		sel = 0 << sel_shift;
 		break;
@@ -735,7 +735,7 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 	}
 
 	/* We really should validate PLL settings but not yet */
-	wm8580->sysclk[dai->id] = freq;
+	wm8580->sysclk[dai->driver->id] = freq;
 
 	return snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel);
 }
#2 lore raw
Quoted 4 lines · Liam Girdwood
Quoted 1 line · Jassi Brar

We want the index of DAI's driver here.

It's fine but could you add a little more context here.

Yes, please. Indeed, the DAI ID should be being initialised from the driver ID by the core so it's a bit surprising if they diverge - why do we want the driver index? Though I've gone ahead and applied anyway as at worst it's a noop.

#3 lore raw
Quoted 10 lines · Mark Brown
Quoted 4 lines · Liam Girdwood
Quoted 1 line · Jassi Brar

We want the index of DAI's driver here.

It's fine but could you add a little more context here.

Yes, please.  Indeed, the DAI ID should be being initialised from the driver ID by the core so it's a bit surprising if they diverge - why do we want the driver index?  Though I've gone ahead and applied anyway as at worst it's a noop.

Just for the sake of consistency.
We moved to using driver's id since the commit 'ASoC: multi-component - ASoC Multi-Component Support'.
_______________________________________________
Alsa-devel mailing list [email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#4 lore raw
Quoted 3 lines · Jassi Brar

Just for the sake of consistency.
We moved to using driver's id since the commit 'ASoC: multi-component - ASoC Multi-Component Support'.

That's not actually true - the ID is initialised by default from the driver, but the referenced copy is in the DAI runtime structure.