All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: WM8580: Debug interface index
@ 2010-12-03  1:34 Jassi Brar
  2010-12-03 11:34 ` Liam Girdwood
  0 siblings, 1 reply; 5+ messages in thread
From: Jassi Brar @ 2010-12-03  1:34 UTC (permalink / raw)
  To: alsa-devel; +Cc: kgene.kim, broonie, Jassi Brar, lrg

We want the index of DAI's driver here.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
---
 sound/soc/codecs/wm8580.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index e2a9276..cb7765f 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -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);
 }
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: WM8580: Debug interface index
  2010-12-03  1:34 [PATCH] ASoC: WM8580: Debug interface index Jassi Brar
@ 2010-12-03 11:34 ` Liam Girdwood
  2010-12-03 16:39   ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Liam Girdwood @ 2010-12-03 11:34 UTC (permalink / raw)
  To: Jassi Brar; +Cc: alsa-devel, kgene.kim, broonie

On Fri, 2010-12-03 at 10:34 +0900, Jassi Brar wrote:
> We want the index of DAI's driver here.
> 

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

> Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
> ---
>  sound/soc/codecs/wm8580.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
> index e2a9276..cb7765f 100644
> --- a/sound/soc/codecs/wm8580.c
> +++ b/sound/soc/codecs/wm8580.c
> @@ -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);
>  }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: WM8580: Debug interface index
  2010-12-03 11:34 ` Liam Girdwood
@ 2010-12-03 16:39   ` Mark Brown
  2010-12-04 15:26     ` Jassi Brar
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-12-03 16:39 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, kgene.kim, Jassi Brar

On Fri, Dec 03, 2010 at 11:34:36AM +0000, Liam Girdwood wrote:
> On Fri, 2010-12-03 at 10:34 +0900, Jassi Brar wrote:
> > 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: WM8580: Debug interface index
  2010-12-03 16:39   ` Mark Brown
@ 2010-12-04 15:26     ` Jassi Brar
  2010-12-20 12:34       ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Jassi Brar @ 2010-12-04 15:26 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, kgene.kim, Jassi Brar, Liam Girdwood

On Sat, Dec 4, 2010 at 1:39 AM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Fri, Dec 03, 2010 at 11:34:36AM +0000, Liam Girdwood wrote:
>> On Fri, 2010-12-03 at 10:34 +0900, Jassi Brar wrote:
>> > 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
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: WM8580: Debug interface index
  2010-12-04 15:26     ` Jassi Brar
@ 2010-12-20 12:34       ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2010-12-20 12:34 UTC (permalink / raw)
  To: Jassi Brar; +Cc: alsa-devel, kgene.kim, Jassi Brar, Liam Girdwood

On Sun, Dec 05, 2010 at 12:26:43AM +0900, Jassi Brar wrote:

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-12-20 12:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-03  1:34 [PATCH] ASoC: WM8580: Debug interface index Jassi Brar
2010-12-03 11:34 ` Liam Girdwood
2010-12-03 16:39   ` Mark Brown
2010-12-04 15:26     ` Jassi Brar
2010-12-20 12:34       ` 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.