[PATCH V3 6/7] ASoC: Samsung: wm8994: Register the osc clock.

2013-08-07 Thread Padmavathi Venna
This patch registers the 16MHz oscillator clock as fixed clk.

Signed-off-by: Padmavathi Venna padm...@samsung.com
---
 sound/soc/samsung/smdk_wm8994.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c
index 581ea4a..a6edded 100644
--- a/sound/soc/samsung/smdk_wm8994.c
+++ b/sound/soc/samsung/smdk_wm8994.c
@@ -9,6 +9,7 @@
 
 #include ../codecs/wm8994.h
 #include sound/pcm_params.h
+#include linux/clk-provider.h
 #include linux/module.h
 #include linux/of.h
 
@@ -37,6 +38,15 @@
 /* SMDK has a 16.934MHZ crystal attached to WM8994 */
 #define SMDK_WM8994_FREQ 16934000
 
+/* 16.9MHz fixed oscillator clock */
+static void init_osc_clock(void)
+{
+   struct device_node *np;
+
+   np = of_find_compatible_node(NULL, NULL, osc3_clk16mhz);
+   of_fixed_clk_setup(np);
+}
+
 static int smdk_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
 {
@@ -173,6 +183,8 @@ static int smdk_audio_probe(struct platform_device *pdev)
smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
}
 
+   init_osc_clock();
+
ret = snd_soc_register_card(card);
 
if (ret)
-- 
1.7.4.4

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V3 6/7] ASoC: Samsung: wm8994: Register the osc clock.

2013-08-07 Thread Mark Brown
On Wed, Aug 07, 2013 at 02:40:15PM +0530, Padmavathi Venna wrote:
 This patch registers the 16MHz oscillator clock as fixed clk.

 +/* 16.9MHz fixed oscillator clock */
 +static void init_osc_clock(void)
 +{
 + struct device_node *np;
 +
 + np = of_find_compatible_node(NULL, NULL, osc3_clk16mhz);
 + of_fixed_clk_setup(np);
 +}
 +
  static int smdk_hw_params(struct snd_pcm_substream *substream,
   struct snd_pcm_hw_params *params)
  {
 @@ -173,6 +183,8 @@ static int smdk_audio_probe(struct platform_device *pdev)
   smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
   }
  
 + init_osc_clock();
 +

This doesn't seem great - it means that this machine driver needs to
know about a specifically named fixed clock which makes it hard to reuse
on other similar boards.  For example I'm intending to reuse this on
Arndale.  Mike?


signature.asc
Description: Digital signature


Re: [PATCH V3 6/7] ASoC: Samsung: wm8994: Register the osc clock.

2013-08-07 Thread Padma Venkat
Hi Mark,

On Wed, Aug 7, 2013 at 3:40 PM, Mark Brown broo...@kernel.org wrote:
 On Wed, Aug 07, 2013 at 02:40:15PM +0530, Padmavathi Venna wrote:
 This patch registers the 16MHz oscillator clock as fixed clk.

 +/* 16.9MHz fixed oscillator clock */
 +static void init_osc_clock(void)
 +{
 + struct device_node *np;
 +
 + np = of_find_compatible_node(NULL, NULL, osc3_clk16mhz);
 + of_fixed_clk_setup(np);
 +}
 +
  static int smdk_hw_params(struct snd_pcm_substream *substream,
   struct snd_pcm_hw_params *params)
  {
 @@ -173,6 +183,8 @@ static int smdk_audio_probe(struct platform_device *pdev)
   smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
   }

 + init_osc_clock();
 +

 This doesn't seem great - it means that this machine driver needs to

Yes. True. But I am not sure of the correct place to keep this code.
Any suggestions?

Thanks
Padma

 know about a specifically named fixed clock which makes it hard to reuse
 on other similar boards.  For example I'm intending to reuse this on
 Arndale.  Mike?
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V3 6/7] ASoC: Samsung: wm8994: Register the osc clock.

2013-08-07 Thread Tomasz Figa
On Wednesday 07 of August 2013 14:40:15 Padmavathi Venna wrote:
 This patch registers the 16MHz oscillator clock as fixed clk.
 
 Signed-off-by: Padmavathi Venna padm...@samsung.com
 ---
  sound/soc/samsung/smdk_wm8994.c |   12 
  1 files changed, 12 insertions(+), 0 deletions(-)
 
 diff --git a/sound/soc/samsung/smdk_wm8994.c
 b/sound/soc/samsung/smdk_wm8994.c index 581ea4a..a6edded 100644
 --- a/sound/soc/samsung/smdk_wm8994.c
 +++ b/sound/soc/samsung/smdk_wm8994.c
 @@ -9,6 +9,7 @@
 
  #include ../codecs/wm8994.h
  #include sound/pcm_params.h
 +#include linux/clk-provider.h
  #include linux/module.h
  #include linux/of.h
 
 @@ -37,6 +38,15 @@
  /* SMDK has a 16.934MHZ crystal attached to WM8994 */
  #define SMDK_WM8994_FREQ 16934000
 
 +/* 16.9MHz fixed oscillator clock */
 +static void init_osc_clock(void)
 +{
 + struct device_node *np;
 +
 + np = of_find_compatible_node(NULL, NULL, osc3_clk16mhz);
 + of_fixed_clk_setup(np);
 +}
 +
  static int smdk_hw_params(struct snd_pcm_substream *substream,
   struct snd_pcm_hw_params *params)
  {
 @@ -173,6 +183,8 @@ static int smdk_audio_probe(struct platform_device
 *pdev) smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
   }
 
 + init_osc_clock();
 +
   ret = snd_soc_register_card(card);
 
   if (ret)

I don't think this patch is needed at all. You can use generic fixed rate 
clock bindings[1] to define a fixed rate clock using device tree.

Best regards,
Tomasz

[1] - Documentation/devicetree/bindings/clock/fixed-clock.txt

--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V3 6/7] ASoC: Samsung: wm8994: Register the osc clock.

2013-08-07 Thread Mark Brown
On Wed, Aug 07, 2013 at 05:18:10PM +0200, Tomasz Figa wrote:

 I don't think this patch is needed at all. You can use generic fixed rate 
 clock bindings[1] to define a fixed rate clock using device tree.

OK, good - that's what I'd have expected but I wasn't sure if that
hadn't been defined for some reason.


signature.asc
Description: Digital signature