Re: [alsa-devel] [PATCH] ASoC: max98088: Add master clock handling

2015-02-19 Thread Tushar Behera
On 02/20/2015 12:48 AM, Andreas Färber wrote:
> If master clock is provided through device tree, then update
> the master clock frequency during set_sysclk.
> 
> Cc: Tushar Behera 
> Signed-off-by: Andreas Färber 
> ---
>  sound/soc/codecs/max98088.c | 24 
>  1 file changed, 24 insertions(+)
> 

Looks good.

Acked-by: Tushar Behera 

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [alsa-devel] [PATCH] ASoC: max98088: Add master clock handling

2015-02-19 Thread Tushar Behera
On 02/20/2015 12:48 AM, Andreas Färber wrote:
 If master clock is provided through device tree, then update
 the master clock frequency during set_sysclk.
 
 Cc: Tushar Behera tushar.beh...@linaro.org
 Signed-off-by: Andreas Färber afaer...@suse.de
 ---
  sound/soc/codecs/max98088.c | 24 
  1 file changed, 24 insertions(+)
 

Looks good.

Acked-by: Tushar Behera trbli...@gmail.com

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [alsa-devel] [PATCH 4/6] ASoC: samsung: Document binding for max98089 based Snow driver

2015-02-18 Thread Tushar Behera
On 02/18/2015 11:55 PM, Andreas Färber wrote:
> Signed-off-by: Andreas Färber 
> ---
>  Documentation/devicetree/bindings/sound/snow.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/sound/snow.txt 
> b/Documentation/devicetree/bindings/sound/snow.txt
> index 6df74f15687f..1430a6bdb2ae 100644
> --- a/Documentation/devicetree/bindings/sound/snow.txt
> +++ b/Documentation/devicetree/bindings/sound/snow.txt
> @@ -2,6 +2,7 @@ Audio Binding for Snow boards
>  
>  Required properties:
>  - compatible : Can be one of the following,
> + "google,snow-audio-max98089" or
>   "google,snow-audio-max98090" or
>   "google,snow-audio-max98091" or
>           "google,snow-audio-max98095"
> 

Looks good.

Acked-by: Tushar Behera 

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [alsa-devel] [PATCH 4/6] ASoC: samsung: Document binding for max98089 based Snow driver

2015-02-18 Thread Tushar Behera
On 02/18/2015 11:55 PM, Andreas Färber wrote:
 Signed-off-by: Andreas Färber afaer...@suse.de
 ---
  Documentation/devicetree/bindings/sound/snow.txt | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/Documentation/devicetree/bindings/sound/snow.txt 
 b/Documentation/devicetree/bindings/sound/snow.txt
 index 6df74f15687f..1430a6bdb2ae 100644
 --- a/Documentation/devicetree/bindings/sound/snow.txt
 +++ b/Documentation/devicetree/bindings/sound/snow.txt
 @@ -2,6 +2,7 @@ Audio Binding for Snow boards
  
  Required properties:
  - compatible : Can be one of the following,
 + google,snow-audio-max98089 or
   google,snow-audio-max98090 or
   google,snow-audio-max98091 or
   google,snow-audio-max98095
 

Looks good.

Acked-by: Tushar Behera trbli...@gmail.com

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 3/3] clk: exynos-audss: Use samsung clock APIs to register/unregister clocks

2014-07-14 Thread Tushar Behera
On Mon, Jul 14, 2014 at 9:04 PM, Sylwester Nawrocki
 wrote:
> On 11/07/14 14:00, Tushar Behera wrote:
>> @@ -103,17 +140,11 @@ static int exynos_audss_clk_probe(struct 
>> platform_device *pdev)
>>   return PTR_ERR(reg_base);
>>   }
>>
>> - clk_table = devm_kzalloc(>dev,
>> - sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>> - GFP_KERNEL);
>> - if (!clk_table)
>> + ctx = samsung_clk_init(pdev->dev.of_node, reg_base, nr_clks);
>
> There is an issue here that this registers the clk provider before all
> its clocks are registered with the clk core. Therefore it introduces
> a race condition.
>
> Please have a look at patch [1], you may want to rebase this series
> onto that patch.
>

Thanks for the pointer. I will re-post.

>> + samsung_clk_register_div(ctx, exynos_audss_div_clks,
>> + ARRAY_SIZE(exynos_audss_div_clks));
> [...]
>> + samsung_clk_register_gate(ctx, exynos_audss_gate_clks,
>> + ARRAY_SIZE(exynos_audss_gate_clks));
> [...]
>> - ret = of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
>> - _data);
>> - if (ret) {
>> - dev_err(>dev, "failed to add clock provider\n");
>> - goto unregister;
>> + samsung_clk_register_gate(ctx, exynos5420_audss_gate_clks,
>> + 
>> ARRAY_SIZE(exynos5420_audss_gate_clks));
>>   }
>
> [1]
> https://git.kernel.org/cgit/linux/kernel/git/tfiga/samsung-clk.git/commit/?h=samsung-clk-next=d5e136a21b2028fb1f45143ea7112d5869bfc6c7
>
> --
> Regards,
> Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2 3/3] clk: exynos-audss: Use samsung clock APIs to register/unregister clocks

2014-07-14 Thread Tushar Behera
On Mon, Jul 14, 2014 at 9:04 PM, Sylwester Nawrocki
s.nawro...@samsung.com wrote:
 On 11/07/14 14:00, Tushar Behera wrote:
 @@ -103,17 +140,11 @@ static int exynos_audss_clk_probe(struct 
 platform_device *pdev)
   return PTR_ERR(reg_base);
   }

 - clk_table = devm_kzalloc(pdev-dev,
 - sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 - GFP_KERNEL);
 - if (!clk_table)
 + ctx = samsung_clk_init(pdev-dev.of_node, reg_base, nr_clks);

 There is an issue here that this registers the clk provider before all
 its clocks are registered with the clk core. Therefore it introduces
 a race condition.

 Please have a look at patch [1], you may want to rebase this series
 onto that patch.


Thanks for the pointer. I will re-post.

 + samsung_clk_register_div(ctx, exynos_audss_div_clks,
 + ARRAY_SIZE(exynos_audss_div_clks));
 [...]
 + samsung_clk_register_gate(ctx, exynos_audss_gate_clks,
 + ARRAY_SIZE(exynos_audss_gate_clks));
 [...]
 - ret = of_clk_add_provider(pdev-dev.of_node, of_clk_src_onecell_get,
 - clk_data);
 - if (ret) {
 - dev_err(pdev-dev, failed to add clock provider\n);
 - goto unregister;
 + samsung_clk_register_gate(ctx, exynos5420_audss_gate_clks,
 + 
 ARRAY_SIZE(exynos5420_audss_gate_clks));
   }

 [1]
 https://git.kernel.org/cgit/linux/kernel/git/tfiga/samsung-clk.git/commit/?h=samsung-clk-nextid=d5e136a21b2028fb1f45143ea7112d5869bfc6c7

 --
 Regards,
 Sylwester
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] clk: exynos-audss: Update as per existing framework

2014-07-11 Thread Tushar Behera
On 07/11/2014 04:10 PM, Sylwester Nawrocki wrote:
> Hi Tushar,
> 
> On 11/07/14 11:37, Tushar Behera wrote:
>> Change exynos-audss clock driver as per existing clock framework from
>> the existing module driver framework.
> 
> Can you explain what's the actual issue you're trying to solve with that
> patch ? What's the problem with this driver being a platform driver ?
> It feels we're moving in circles here, see
> 
> commit b37a4224104568198b93fb9831224cfe7d83fff8
> Author: Andrew Bresticker 
> Date:   Wed Sep 25 14:12:47 2013 -0700
> 
> clk: exynos-audss: convert to platform device
> 
> The Exynos AudioSS clock controller will later be modified to allow
> input clocks to be specified via device-tree in order to support
> multiple Exynos SoCs.  This will introduce a dependency on the core
> SoC clock controller being initialized first so that the AudioSS driver
> can look up its input clocks, but the order in which clock providers
> are probed in of_clk_init() is not guaranteed.  Since deferred probing
> is not supported in of_clk_init() and the AudioSS block is not the core
> controller, we can initialize it later as a platform device.
> 
> Signed-off-by: Andrew Bresticker 
> Acked-by: Tomasz Figa 
> Reviewed-by: Sylwester Nawrocki 
> Acked-by: Mike Turquette 
> Acked-by: Kukjin Kim 
> Signed-off-by: Tomasz Figa 
> 
> I realize of_clk_init() now handles better clock provider dependencies,
> nevertheless do we really need all this churn ?
> 

I have sent v2 of the patchset while retaining the platform driver
infrastructure. Awaiting your review comments on that.

> --
> Thanks,
> Sylwester
> 

Thanks,
-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 3/3] clk: exynos-audss: Use samsung clock APIs to register/unregister clocks

2014-07-11 Thread Tushar Behera
Using samsung clock APIs to register/unregister clocks will save some
lines of code.

Signed-off-by: Tushar Behera 
---
Changes of v2:
* Retain platform driver structure.

 drivers/clk/samsung/clk-exynos-audss.c |  146 
 1 file changed, 56 insertions(+), 90 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c 
b/drivers/clk/samsung/clk-exynos-audss.c
index 1a5294c..2b90967 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,16 +19,16 @@
 
 #include 
 
+#include "clk.h"
+
 enum exynos_audss_clk_type {
TYPE_EXYNOS4210,
TYPE_EXYNOS5250,
TYPE_EXYNOS5420,
 };
 
-static DEFINE_SPINLOCK(lock);
-static struct clk **clk_table;
+static struct samsung_clk_provider *ctx;
 static void __iomem *reg_base;
-static struct clk_onecell_data clk_data;
 
 #define ASS_CLK_SRC 0x0
 #define ASS_CLK_DIV 0x4
@@ -78,7 +78,7 @@ static const struct of_device_id exynos_audss_clk_of_match[] 
= {
 /* register exynos_audss clocks */
 static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-   int i, ret = 0;
+   int i;
struct resource *res;
struct clk *tmp;
const char *clk_name_ref[] = {
@@ -87,14 +87,51 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
"fin_pll", "fout_epll", "cdclk0", "sclk_audio0", "sclk_pcm0"};
const char *mout_audss_p[] = {"fin_pll", "fout_epll"};
const char *mout_i2s_p[] = {"mout_audss", "cdclk0", "sclk_audio0"};
-   const char *sclk_pcm_p = "sclk_pcm0";
+   char sclk_pcm_p[32];
const struct of_device_id *match;
enum exynos_audss_clk_type variant;
 
+   struct samsung_mux_clock exynos_audss_mux_clks[] = {
+   MUX(EXYNOS_MOUT_AUDSS, "mout_audss", mout_audss_p,
+   ASS_CLK_SRC, 0, 1),
+   MUX(EXYNOS_MOUT_I2S, "mout_i2s", mout_i2s_p,
+   ASS_CLK_SRC, 2, 2),
+   };
+
+   struct samsung_div_clock exynos_audss_div_clks[] = {
+   DIV(EXYNOS_DOUT_SRP, "dout_srp", "mout_audss",
+   ASS_CLK_DIV, 0, 4),
+   DIV(EXYNOS_DOUT_AUD_BUS, "dout_aud_bus", "dout_srp",
+   ASS_CLK_DIV, 4, 4),
+   DIV(EXYNOS_DOUT_I2S, "dout_i2s", "mout_i2s", ASS_CLK_DIV, 8, 4),
+   };
+
+   struct samsung_gate_clock exynos_audss_gate_clks[] = {
+   GATE(EXYNOS_SRP_CLK, "srp_clk", "dout_srp",
+   ASS_CLK_GATE, 0, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_I2S_BUS, "i2s_bus", "dout_aud_bus",
+   ASS_CLK_GATE, 2, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_SCLK_I2S, "sclk_i2s", "dout_i2s",
+   ASS_CLK_GATE, 3, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_PCM_BUS, "pcm_bus", "sclk_pcm",
+   ASS_CLK_GATE, 4, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_SCLK_PCM, "sclk_pcm", sclk_pcm_p,
+   ASS_CLK_GATE, 5, CLK_SET_RATE_PARENT, 0),
+   };
+
+   struct samsung_gate_clock exynos5420_audss_gate_clks[] = {
+   GATE(EXYNOS_ADMA, "adma", "dout_srp",
+   ASS_CLK_GATE, 9, CLK_SET_RATE_PARENT, 0),
+   };
+
+   int nr_clks = EXYNOS_AUDSS_MAX_CLKS;
+
match = of_match_node(exynos_audss_clk_of_match, pdev->dev.of_node);
if (!match)
return -EINVAL;
variant = (enum exynos_audss_clk_type)match->data;
+   if (variant != TYPE_EXYNOS5420)
+   nr_clks--;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
reg_base = devm_ioremap_resource(>dev, res);
@@ -103,17 +140,11 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
return PTR_ERR(reg_base);
}
 
-   clk_table = devm_kzalloc(>dev,
-   sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
-   GFP_KERNEL);
-   if (!clk_table)
+   ctx = samsung_clk_init(pdev->dev.of_node, reg_base, nr_clks);
+   if (!ctx) {
+   dev_err(>dev, "failed to get clock provier context\n");
return -ENOMEM;
-
-   clk_data.clks = clk_table;
-   if (variant == TYPE_EXYNOS5420)
-   clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-   else
-   clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS - 1;
+   }
 
for (i = 0; i < ARRAY_SIZE(clk_name_ref); i++) {
tmp = clk_get(>dev, clk_name_re

[PATCH V2 2/3] clk: samsung: Add API to unregister clocks

2014-07-11 Thread Tushar Behera
Added an API to unregister all the clocks defined within a context. This
is helpful in case where the clock is registered through a platform
driver and we want to unregister the clocks during remove callback.

Signed-off-by: Tushar Behera 
---
Changelog:
This is new patch required because of changes to patch 3/3.

 drivers/clk/samsung/clk.c |   19 +++
 drivers/clk/samsung/clk.h |2 ++
 2 files changed, 21 insertions(+)

diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c
index 49629c7..b9310b9 100644
--- a/drivers/clk/samsung/clk.c
+++ b/drivers/clk/samsung/clk.c
@@ -83,6 +83,25 @@ struct samsung_clk_provider *__init samsung_clk_init(struct 
device_node *np,
return ctx;
 }
 
+/* API to remove a clock provider */
+void samsung_clk_exit(struct device_node *np, struct samsung_clk_provider *ctx)
+{
+   int i;
+
+   if (np)
+   of_clk_del_provider(np);
+
+   if (!ctx)
+   return;
+
+   for (i = 0; i < ctx->clk_data.clk_num; i++)
+   if (!IS_ERR(ctx->clk_data.clks[i]))
+   clk_unregister(ctx->clk_data.clks[i]);
+
+   kfree(ctx->clk_data.clks);
+   kfree(ctx);
+}
+
 /* add a clock instance to the clock lookup table used for dt based lookup */
 void samsung_clk_add_lookup(struct samsung_clk_provider *ctx, struct clk *clk,
unsigned int id)
diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h
index 9693b80..8ecc85a 100644
--- a/drivers/clk/samsung/clk.h
+++ b/drivers/clk/samsung/clk.h
@@ -327,6 +327,8 @@ struct samsung_pll_clock {
 extern struct samsung_clk_provider *__init samsung_clk_init(
struct device_node *np, void __iomem *base,
unsigned long nr_clks);
+extern void samsung_clk_exit(struct device_node *np,
+   struct samsung_clk_provider *ctx);
 extern void __init samsung_clk_of_register_fixed_ext(
struct samsung_clk_provider *ctx,
struct samsung_fixed_rate_clock *fixed_rate_clk,
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 0/3] clk: exynos-audss: Adapt to exising clock framework

2014-07-11 Thread Tushar Behera
Generic cleanup and usage of samsung clock register/unregister APIs.

The patches are tested on Exynos5800 based Peach-Pi board. More tests are
welcome.

Tushar Behera (3):
  clk: exynos-audss: Simplify code to get clock names
  clk: samsung: Add API to unregister clocks
  clk: exynos-audss: Use samsung clock APIs to register/unregister
clocks

 drivers/clk/samsung/clk-exynos-audss.c |  179 +---
 drivers/clk/samsung/clk.c  |   19 
 drivers/clk/samsung/clk.h  |2 +
 3 files changed, 95 insertions(+), 105 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 1/3] clk: exynos-audss: Simplify code to get clock names

2014-07-11 Thread Tushar Behera
Instead of getting the clock names individually, it would be good to put
the logic within a loop.

Signed-off-by: Tushar Behera 
---
Changes for V2:
* Calling clk_put as soon as the clock is not required anymore

 drivers/clk/samsung/clk-exynos-audss.c |   35 +---
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c 
b/drivers/clk/samsung/clk-exynos-audss.c
index 13eae14c..1a5294c 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -80,10 +80,14 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
 {
int i, ret = 0;
struct resource *res;
+   struct clk *tmp;
+   const char *clk_name_ref[] = {
+   "pll_ref", "pll_in", "cdclk", "sclk_audio", "sclk_pcm_in" };
+   const char *clk_name_actual[] = {
+   "fin_pll", "fout_epll", "cdclk0", "sclk_audio0", "sclk_pcm0"};
const char *mout_audss_p[] = {"fin_pll", "fout_epll"};
const char *mout_i2s_p[] = {"mout_audss", "cdclk0", "sclk_audio0"};
const char *sclk_pcm_p = "sclk_pcm0";
-   struct clk *pll_ref, *pll_in, *cdclk, *sclk_audio, *sclk_pcm_in;
const struct of_device_id *match;
enum exynos_audss_clk_type variant;
 
@@ -111,23 +115,25 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
else
clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS - 1;
 
-   pll_ref = devm_clk_get(>dev, "pll_ref");
-   pll_in = devm_clk_get(>dev, "pll_in");
-   if (!IS_ERR(pll_ref))
-   mout_audss_p[0] = __clk_get_name(pll_ref);
-   if (!IS_ERR(pll_in))
-   mout_audss_p[1] = __clk_get_name(pll_in);
+   for (i = 0; i < ARRAY_SIZE(clk_name_ref); i++) {
+   tmp = clk_get(>dev, clk_name_ref[i]);
+   if (!IS_ERR(tmp)) {
+   clk_name_actual[i] = __clk_get_name(tmp);
+   clk_put(tmp);
+   }
+   }
+
+   mout_audss_p[0] = clk_name_actual[0];
+   mout_audss_p[1] = clk_name_actual[1];
+   mout_i2s_p[1] = clk_name_actual[2];
+   mout_i2s_p[2] = clk_name_actual[3];
+   sclk_pcm_p = clk_name_actual[4];
+
clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
mout_audss_p, ARRAY_SIZE(mout_audss_p),
CLK_SET_RATE_NO_REPARENT,
reg_base + ASS_CLK_SRC, 0, 1, 0, );
 
-   cdclk = devm_clk_get(>dev, "cdclk");
-   sclk_audio = devm_clk_get(>dev, "sclk_audio");
-   if (!IS_ERR(cdclk))
-   mout_i2s_p[1] = __clk_get_name(cdclk);
-   if (!IS_ERR(sclk_audio))
-   mout_i2s_p[2] = __clk_get_name(sclk_audio);
clk_table[EXYNOS_MOUT_I2S] = clk_register_mux(NULL, "mout_i2s",
mout_i2s_p, ARRAY_SIZE(mout_i2s_p),
CLK_SET_RATE_NO_REPARENT,
@@ -161,9 +167,6 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
 "sclk_pcm", CLK_SET_RATE_PARENT,
reg_base + ASS_CLK_GATE, 4, 0, );
 
-   sclk_pcm_in = devm_clk_get(>dev, "sclk_pcm_in");
-   if (!IS_ERR(sclk_pcm_in))
-   sclk_pcm_p = __clk_get_name(sclk_pcm_in);
clk_table[EXYNOS_SCLK_PCM] = clk_register_gate(NULL, "sclk_pcm",
sclk_pcm_p, CLK_SET_RATE_PARENT,
reg_base + ASS_CLK_GATE, 5, 0, );
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] clk: exynos-audss: Adapt to exising clock framework

2014-07-11 Thread Tushar Behera
On 07/11/2014 03:21 PM, Tomasz Figa wrote:
> Hi Tushar,
> 
> On 11.07.2014 11:37, Tushar Behera wrote:
>> The patchset is targetted as moving exising exynos-audss clock driver from 
>> being
>> a module driver. The driver is now registered through CLK_OF_DECLARE and is
>> inline with other Samsung clock drivers.
> 
> I'm afraid I have to NAK this series or at least the part converting the
> driver back to use CLK_OF_DECLARE().
> 

Considering the more prevalent usage of CLK_OF_DECLARE() in drivers/clk
led me into thinking it was the normal way for the clock drivers.
Keeping only one clock driver using a different approach looked odd to
me. Anyways, I don't have any other reason to pursue this case.

> We have deliberately made this driver a platform driver, because this is
> how drivers should be modeled in Linux kernel whenever possible.
> CLK_OF_DECLARE() should be only considered a hack to work around late
> initialization of driver model. Reverting this change without a good
> reason (and you haven't provided such) is just going backwards.
> 
> Rest of this series is actually quite nice, though, as reusing Samsung
> clock helpers reduces the line count significantly, so if you could
> rework this to keep this driver a platform driver then we could get
> something I could ack.
> 

Sure. There are still some valid cleanups even if we plan to retain the
platform driver infrastructure. I will split and repost.

> Best regards,
> Tomasz
> 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] clk: exynos-audss: Adapt to exising clock framework

2014-07-11 Thread Tushar Behera
The patchset is targetted as moving exising exynos-audss clock driver from being
a module driver. The driver is now registered through CLK_OF_DECLARE and is
inline with other Samsung clock drivers.

The patches are tested on Exynos5800 based Peach-Pi board. More tests are
welcome.

Tushar Behera (2):
  clk: exynos-audss: Simplify code to get clock names
  clk: exynos-audss: Update as per existing framework

 drivers/clk/samsung/clk-exynos-audss.c |  268 
 1 file changed, 102 insertions(+), 166 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] clk: exynos-audss: Simplify code to get clock names

2014-07-11 Thread Tushar Behera
Instead of getting the clock names individually, it would be good to put
the logic within a loop.

Signed-off-by: Tushar Behera 
---
 drivers/clk/samsung/clk-exynos-audss.c |   33 
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c 
b/drivers/clk/samsung/clk-exynos-audss.c
index 13eae14c..ebfc5da 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -80,10 +80,14 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
 {
int i, ret = 0;
struct resource *res;
+   struct clk *tmp;
+   const char *clk_name_ref[] = {
+   "pll_ref", "pll_in", "cdclk", "sclk_audio", "sclk_pcm_in" };
+   const char *clk_name_actual[] = {
+   "fin_pll", "fout_epll", "cdclk0", "sclk_audio0", "sclk_pcm0"};
const char *mout_audss_p[] = {"fin_pll", "fout_epll"};
const char *mout_i2s_p[] = {"mout_audss", "cdclk0", "sclk_audio0"};
const char *sclk_pcm_p = "sclk_pcm0";
-   struct clk *pll_ref, *pll_in, *cdclk, *sclk_audio, *sclk_pcm_in;
const struct of_device_id *match;
enum exynos_audss_clk_type variant;
 
@@ -111,23 +115,23 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
else
clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS - 1;
 
-   pll_ref = devm_clk_get(>dev, "pll_ref");
-   pll_in = devm_clk_get(>dev, "pll_in");
-   if (!IS_ERR(pll_ref))
-   mout_audss_p[0] = __clk_get_name(pll_ref);
-   if (!IS_ERR(pll_in))
-   mout_audss_p[1] = __clk_get_name(pll_in);
+   for (i = 0; i < ARRAY_SIZE(clk_name_ref); i++) {
+   tmp = devm_clk_get(>dev, clk_name_ref[i]);
+   if (!IS_ERR(tmp))
+   clk_name_actual[i] = __clk_get_name(tmp);
+   }
+
+   mout_audss_p[0] = clk_name_actual[0];
+   mout_audss_p[1] = clk_name_actual[1];
+   mout_i2s_p[1] = clk_name_actual[2];
+   mout_i2s_p[2] = clk_name_actual[3];
+   sclk_pcm_p = clk_name_actual[4];
+
clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
mout_audss_p, ARRAY_SIZE(mout_audss_p),
CLK_SET_RATE_NO_REPARENT,
reg_base + ASS_CLK_SRC, 0, 1, 0, );
 
-   cdclk = devm_clk_get(>dev, "cdclk");
-   sclk_audio = devm_clk_get(>dev, "sclk_audio");
-   if (!IS_ERR(cdclk))
-   mout_i2s_p[1] = __clk_get_name(cdclk);
-   if (!IS_ERR(sclk_audio))
-   mout_i2s_p[2] = __clk_get_name(sclk_audio);
clk_table[EXYNOS_MOUT_I2S] = clk_register_mux(NULL, "mout_i2s",
mout_i2s_p, ARRAY_SIZE(mout_i2s_p),
CLK_SET_RATE_NO_REPARENT,
@@ -161,9 +165,6 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
 "sclk_pcm", CLK_SET_RATE_PARENT,
reg_base + ASS_CLK_GATE, 4, 0, );
 
-   sclk_pcm_in = devm_clk_get(>dev, "sclk_pcm_in");
-   if (!IS_ERR(sclk_pcm_in))
-   sclk_pcm_p = __clk_get_name(sclk_pcm_in);
clk_table[EXYNOS_SCLK_PCM] = clk_register_gate(NULL, "sclk_pcm",
sclk_pcm_p, CLK_SET_RATE_PARENT,
reg_base + ASS_CLK_GATE, 5, 0, );
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] clk: exynos-audss: Update as per existing framework

2014-07-11 Thread Tushar Behera
Change exynos-audss clock driver as per existing clock framework from
the existing module driver framework.

Signed-off-by: Tushar Behera 
---
 drivers/clk/samsung/clk-exynos-audss.c |  239 
 1 file changed, 87 insertions(+), 152 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c 
b/drivers/clk/samsung/clk-exynos-audss.c
index ebfc5da..49f4163 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,26 +19,25 @@
 
 #include 
 
+#include "clk.h"
+
 enum exynos_audss_clk_type {
TYPE_EXYNOS4210,
TYPE_EXYNOS5250,
TYPE_EXYNOS5420,
 };
 
-static DEFINE_SPINLOCK(lock);
-static struct clk **clk_table;
 static void __iomem *reg_base;
-static struct clk_onecell_data clk_data;
 
-#define ASS_CLK_SRC 0x0
-#define ASS_CLK_DIV 0x4
-#define ASS_CLK_GATE 0x8
+#define ASS_CLK_SRC0x0
+#define ASS_CLK_DIV0x4
+#define ASS_CLK_GATE   0x8
 
 #ifdef CONFIG_PM_SLEEP
 static unsigned long reg_save[][2] = {
-   {ASS_CLK_SRC,  0},
-   {ASS_CLK_DIV,  0},
-   {ASS_CLK_GATE, 0},
+   {ASS_CLK_SRC,   0},
+   {ASS_CLK_DIV,   0},
+   {ASS_CLK_GATE,  0},
 };
 
 static int exynos_audss_clk_suspend(void)
@@ -65,21 +64,10 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 };
 #endif /* CONFIG_PM_SLEEP */
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-   { .compatible = "samsung,exynos4210-audss-clock",
- .data = (void *)TYPE_EXYNOS4210, },
-   { .compatible = "samsung,exynos5250-audss-clock",
- .data = (void *)TYPE_EXYNOS5250, },
-   { .compatible = "samsung,exynos5420-audss-clock",
- .data = (void *)TYPE_EXYNOS5420, },
-   {},
-};
-
-/* register exynos_audss clocks */
-static int exynos_audss_clk_probe(struct platform_device *pdev)
+static void __init exynos_audss_clk_init(struct device_node *np,
+   enum exynos_audss_clk_type variant)
 {
-   int i, ret = 0;
-   struct resource *res;
+   int i;
struct clk *tmp;
const char *clk_name_ref[] = {
"pll_ref", "pll_in", "cdclk", "sclk_audio", "sclk_pcm_in" };
@@ -87,163 +75,110 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
"fin_pll", "fout_epll", "cdclk0", "sclk_audio0", "sclk_pcm0"};
const char *mout_audss_p[] = {"fin_pll", "fout_epll"};
const char *mout_i2s_p[] = {"mout_audss", "cdclk0", "sclk_audio0"};
-   const char *sclk_pcm_p = "sclk_pcm0";
-   const struct of_device_id *match;
-   enum exynos_audss_clk_type variant;
-
-   match = of_match_node(exynos_audss_clk_of_match, pdev->dev.of_node);
-   if (!match)
-   return -EINVAL;
-   variant = (enum exynos_audss_clk_type)match->data;
-
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   reg_base = devm_ioremap_resource(>dev, res);
-   if (IS_ERR(reg_base)) {
-   dev_err(>dev, "failed to map audss registers\n");
-   return PTR_ERR(reg_base);
-   }
 
-   clk_table = devm_kzalloc(>dev,
-   sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
-   GFP_KERNEL);
-   if (!clk_table)
-   return -ENOMEM;
-
-   clk_data.clks = clk_table;
-   if (variant == TYPE_EXYNOS5420)
-   clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-   else
-   clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS - 1;
+   char sclk_pcm_p[32];
+
+   struct samsung_mux_clock exynos_audss_mux_clks[] = {
+   MUX(EXYNOS_MOUT_AUDSS, "mout_audss", mout_audss_p,
+   ASS_CLK_SRC, 0, 1),
+   MUX(EXYNOS_MOUT_I2S, "mout_i2s", mout_i2s_p,
+   ASS_CLK_SRC, 2, 2),
+   };
+
+   struct samsung_div_clock exynos_audss_div_clks[] = {
+   DIV(EXYNOS_DOUT_SRP, "dout_srp", "mout_audss",
+   ASS_CLK_DIV, 0, 4),
+   DIV(EXYNOS_DOUT_AUD_BUS, "dout_aud_bus", "dout_srp",
+   ASS_CLK_DIV, 4, 4),
+   DIV(EXYNOS_DOUT_I2S, "dout_i2s", "mout_i2s", ASS_CLK_DIV, 8, 4),
+   };
+
+   struct samsung_gate_clock exynos_audss_gate_clks[] = {
+   GATE(EXYNOS_SRP_CLK, "srp_clk", "dout_srp",
+   ASS_CLK_GATE, 0, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_I2S_BUS, "i2s_bus", "dout_aud_bus",
+   ASS_CLK_GATE, 2, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_SCLK_I2S, "sclk_i2s"

Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-07-11 Thread Tushar Behera
On 06/13/2014 02:39 AM, Mike Turquette wrote:
> Quoting Tushar Behera (2014-06-12 00:29:23)
>> On Wed, Jun 11, 2014 at 10:20 PM, Mike Turquette  
>> wrote:
>>> Quoting Tushar Behera (2014-06-10 22:32:17)
>>>> When the output clock of AUDSS mux is disabled, we are getting kernel
>>>> oops while doing a clk_get() on other clocks provided by AUDSS. Though
>>>> user manual doesn't specify this dependency, we came across this issue
>>>> while disabling the parent of AUDSS mux clocks.
>>>
>>> Hi Tushar,
>>>
>>> Can you help me understand better what the actual problem is? What is
>>> the root cause of the kernel oops?
>>
>> Currently AUDSS mux has two parents, XXTI crystal and MAU_EPLL clock.
>> As per observation, when the output of AUDSS mux is gated, we are not
>> able to do any operation on the clocks provided by MAU block (mostly
>> the clocks used by ADMA and audio blocks).
> 
> I tried to get a datasheet for Exynos 54xx but could not find it. I even
> looked at the public 5250 data sheet, but it is completely missing
> Chapter 34, "Audio Subsystem", which apparently contains Figure 34-3,
> "Clock names and clock tree diagram of MAUDIO_BLK".
> 
> So without any clue about your hardware (not for lack of trying) I would
> guess that somewhere in the parent hierarchy you have an interface clock
> which must be enabled in order for you to touch the registers pertaining
> to the downstream audio clocks.
> 

Yes, right. As per observation, we need to keep the output of AUDSS mux
enabled to access the registers present in MAU block.

> The right way to handle this requires two steps:
> 
> 1) model your interface clock in the Linux clock framework if you
> haven't already (I assume it is a gate clock, or the child of a gate
> clock)
> 

The interface clock is already part of the clock framework.

> 2) the clk_ops callbacks for the affected audio clocks should wrap their
> operations (i.e. critical secion) with a clk_enable/clk_disable pair,
> where the clock being enables/disable is the interface clock mentioned
> above in #1
> 
> The CCF is reentrant, so you can do this by simply using the top-level
> clk.h API from within your clk_ops callbacks.
> 

Right now, the clocks are registered with clk_register_mux,
clk_register_div and clk_register_gate calls which in turn set
appropriate clk_ops callbacks. If I need to wrap the register access
during these clk_ops callbacks with clk_enable/clk_disable of interface
lock, I would have to reimplement the clk_ops callbacks in
clk-exynos-audss driver.

Is that the approach that you are suggesting?

> I might be totally wrong about the cause of the hang, but that's my best
> guess based on everyone's bug reports.
> 

There are 5 gate clocks within MAU block. While disabling the unused
clocks, if CLK_MAU_EPLL is disabled first, then we are getting this
system hang.


> Regards,
> Mike
> 
>>
>>>
>>> You mention calling clk_get on child clocks of the AUDSS mux fails, but
>>> I cannot imagine why. How can the enable/disable state of a clock affect
>>> the ability to clk_get other clocks?
>>>
>>
>> I might have a little vogue while updating the commit message
>> (mentioning about clk_get which surely is only a s/w operation), but
>> there is definitely some issue with handling those clocks under given
>> scenario.
>>
>> I am on leave till end of this week, so I will update you more with
>> the logs on Monday.
>>
>> Thanks,
>> --
>> Tushar
> 
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-07-11 Thread Tushar Behera
On 06/13/2014 02:39 AM, Mike Turquette wrote:
 Quoting Tushar Behera (2014-06-12 00:29:23)
 On Wed, Jun 11, 2014 at 10:20 PM, Mike Turquette mturque...@linaro.org 
 wrote:
 Quoting Tushar Behera (2014-06-10 22:32:17)
 When the output clock of AUDSS mux is disabled, we are getting kernel
 oops while doing a clk_get() on other clocks provided by AUDSS. Though
 user manual doesn't specify this dependency, we came across this issue
 while disabling the parent of AUDSS mux clocks.

 Hi Tushar,

 Can you help me understand better what the actual problem is? What is
 the root cause of the kernel oops?

 Currently AUDSS mux has two parents, XXTI crystal and MAU_EPLL clock.
 As per observation, when the output of AUDSS mux is gated, we are not
 able to do any operation on the clocks provided by MAU block (mostly
 the clocks used by ADMA and audio blocks).
 
 I tried to get a datasheet for Exynos 54xx but could not find it. I even
 looked at the public 5250 data sheet, but it is completely missing
 Chapter 34, Audio Subsystem, which apparently contains Figure 34-3,
 Clock names and clock tree diagram of MAUDIO_BLK.
 
 So without any clue about your hardware (not for lack of trying) I would
 guess that somewhere in the parent hierarchy you have an interface clock
 which must be enabled in order for you to touch the registers pertaining
 to the downstream audio clocks.
 

Yes, right. As per observation, we need to keep the output of AUDSS mux
enabled to access the registers present in MAU block.

 The right way to handle this requires two steps:
 
 1) model your interface clock in the Linux clock framework if you
 haven't already (I assume it is a gate clock, or the child of a gate
 clock)
 

The interface clock is already part of the clock framework.

 2) the clk_ops callbacks for the affected audio clocks should wrap their
 operations (i.e. critical secion) with a clk_enable/clk_disable pair,
 where the clock being enables/disable is the interface clock mentioned
 above in #1
 
 The CCF is reentrant, so you can do this by simply using the top-level
 clk.h API from within your clk_ops callbacks.
 

Right now, the clocks are registered with clk_register_mux,
clk_register_div and clk_register_gate calls which in turn set
appropriate clk_ops callbacks. If I need to wrap the register access
during these clk_ops callbacks with clk_enable/clk_disable of interface
lock, I would have to reimplement the clk_ops callbacks in
clk-exynos-audss driver.

Is that the approach that you are suggesting?

 I might be totally wrong about the cause of the hang, but that's my best
 guess based on everyone's bug reports.
 

There are 5 gate clocks within MAU block. While disabling the unused
clocks, if CLK_MAU_EPLL is disabled first, then we are getting this
system hang.


 Regards,
 Mike
 


 You mention calling clk_get on child clocks of the AUDSS mux fails, but
 I cannot imagine why. How can the enable/disable state of a clock affect
 the ability to clk_get other clocks?


 I might have a little vogue while updating the commit message
 (mentioning about clk_get which surely is only a s/w operation), but
 there is definitely some issue with handling those clocks under given
 scenario.

 I am on leave till end of this week, so I will update you more with
 the logs on Monday.

 Thanks,
 --
 Tushar
 
 ___
 linux-arm-kernel mailing list
 linux-arm-ker...@lists.infradead.org
 http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] clk: exynos-audss: Update as per existing framework

2014-07-11 Thread Tushar Behera
Change exynos-audss clock driver as per existing clock framework from
the existing module driver framework.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 drivers/clk/samsung/clk-exynos-audss.c |  239 
 1 file changed, 87 insertions(+), 152 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c 
b/drivers/clk/samsung/clk-exynos-audss.c
index ebfc5da..49f4163 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,26 +19,25 @@
 
 #include dt-bindings/clock/exynos-audss-clk.h
 
+#include clk.h
+
 enum exynos_audss_clk_type {
TYPE_EXYNOS4210,
TYPE_EXYNOS5250,
TYPE_EXYNOS5420,
 };
 
-static DEFINE_SPINLOCK(lock);
-static struct clk **clk_table;
 static void __iomem *reg_base;
-static struct clk_onecell_data clk_data;
 
-#define ASS_CLK_SRC 0x0
-#define ASS_CLK_DIV 0x4
-#define ASS_CLK_GATE 0x8
+#define ASS_CLK_SRC0x0
+#define ASS_CLK_DIV0x4
+#define ASS_CLK_GATE   0x8
 
 #ifdef CONFIG_PM_SLEEP
 static unsigned long reg_save[][2] = {
-   {ASS_CLK_SRC,  0},
-   {ASS_CLK_DIV,  0},
-   {ASS_CLK_GATE, 0},
+   {ASS_CLK_SRC,   0},
+   {ASS_CLK_DIV,   0},
+   {ASS_CLK_GATE,  0},
 };
 
 static int exynos_audss_clk_suspend(void)
@@ -65,21 +64,10 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 };
 #endif /* CONFIG_PM_SLEEP */
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-   { .compatible = samsung,exynos4210-audss-clock,
- .data = (void *)TYPE_EXYNOS4210, },
-   { .compatible = samsung,exynos5250-audss-clock,
- .data = (void *)TYPE_EXYNOS5250, },
-   { .compatible = samsung,exynos5420-audss-clock,
- .data = (void *)TYPE_EXYNOS5420, },
-   {},
-};
-
-/* register exynos_audss clocks */
-static int exynos_audss_clk_probe(struct platform_device *pdev)
+static void __init exynos_audss_clk_init(struct device_node *np,
+   enum exynos_audss_clk_type variant)
 {
-   int i, ret = 0;
-   struct resource *res;
+   int i;
struct clk *tmp;
const char *clk_name_ref[] = {
pll_ref, pll_in, cdclk, sclk_audio, sclk_pcm_in };
@@ -87,163 +75,110 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
fin_pll, fout_epll, cdclk0, sclk_audio0, sclk_pcm0};
const char *mout_audss_p[] = {fin_pll, fout_epll};
const char *mout_i2s_p[] = {mout_audss, cdclk0, sclk_audio0};
-   const char *sclk_pcm_p = sclk_pcm0;
-   const struct of_device_id *match;
-   enum exynos_audss_clk_type variant;
-
-   match = of_match_node(exynos_audss_clk_of_match, pdev-dev.of_node);
-   if (!match)
-   return -EINVAL;
-   variant = (enum exynos_audss_clk_type)match-data;
-
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   reg_base = devm_ioremap_resource(pdev-dev, res);
-   if (IS_ERR(reg_base)) {
-   dev_err(pdev-dev, failed to map audss registers\n);
-   return PTR_ERR(reg_base);
-   }
 
-   clk_table = devm_kzalloc(pdev-dev,
-   sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
-   GFP_KERNEL);
-   if (!clk_table)
-   return -ENOMEM;
-
-   clk_data.clks = clk_table;
-   if (variant == TYPE_EXYNOS5420)
-   clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-   else
-   clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS - 1;
+   char sclk_pcm_p[32];
+
+   struct samsung_mux_clock exynos_audss_mux_clks[] = {
+   MUX(EXYNOS_MOUT_AUDSS, mout_audss, mout_audss_p,
+   ASS_CLK_SRC, 0, 1),
+   MUX(EXYNOS_MOUT_I2S, mout_i2s, mout_i2s_p,
+   ASS_CLK_SRC, 2, 2),
+   };
+
+   struct samsung_div_clock exynos_audss_div_clks[] = {
+   DIV(EXYNOS_DOUT_SRP, dout_srp, mout_audss,
+   ASS_CLK_DIV, 0, 4),
+   DIV(EXYNOS_DOUT_AUD_BUS, dout_aud_bus, dout_srp,
+   ASS_CLK_DIV, 4, 4),
+   DIV(EXYNOS_DOUT_I2S, dout_i2s, mout_i2s, ASS_CLK_DIV, 8, 4),
+   };
+
+   struct samsung_gate_clock exynos_audss_gate_clks[] = {
+   GATE(EXYNOS_SRP_CLK, srp_clk, dout_srp,
+   ASS_CLK_GATE, 0, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_I2S_BUS, i2s_bus, dout_aud_bus,
+   ASS_CLK_GATE, 2, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_SCLK_I2S, sclk_i2s, dout_i2s,
+   ASS_CLK_GATE, 3, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_PCM_BUS, pcm_bus, sclk_pcm,
+   ASS_CLK_GATE, 4, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_SCLK_PCM, sclk_pcm, sclk_pcm_p,
+   ASS_CLK_GATE, 5, CLK_SET_RATE_PARENT, 0

[PATCH 0/2] clk: exynos-audss: Adapt to exising clock framework

2014-07-11 Thread Tushar Behera
The patchset is targetted as moving exising exynos-audss clock driver from being
a module driver. The driver is now registered through CLK_OF_DECLARE and is
inline with other Samsung clock drivers.

The patches are tested on Exynos5800 based Peach-Pi board. More tests are
welcome.

Tushar Behera (2):
  clk: exynos-audss: Simplify code to get clock names
  clk: exynos-audss: Update as per existing framework

 drivers/clk/samsung/clk-exynos-audss.c |  268 
 1 file changed, 102 insertions(+), 166 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] clk: exynos-audss: Simplify code to get clock names

2014-07-11 Thread Tushar Behera
Instead of getting the clock names individually, it would be good to put
the logic within a loop.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 drivers/clk/samsung/clk-exynos-audss.c |   33 
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c 
b/drivers/clk/samsung/clk-exynos-audss.c
index 13eae14c..ebfc5da 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -80,10 +80,14 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
 {
int i, ret = 0;
struct resource *res;
+   struct clk *tmp;
+   const char *clk_name_ref[] = {
+   pll_ref, pll_in, cdclk, sclk_audio, sclk_pcm_in };
+   const char *clk_name_actual[] = {
+   fin_pll, fout_epll, cdclk0, sclk_audio0, sclk_pcm0};
const char *mout_audss_p[] = {fin_pll, fout_epll};
const char *mout_i2s_p[] = {mout_audss, cdclk0, sclk_audio0};
const char *sclk_pcm_p = sclk_pcm0;
-   struct clk *pll_ref, *pll_in, *cdclk, *sclk_audio, *sclk_pcm_in;
const struct of_device_id *match;
enum exynos_audss_clk_type variant;
 
@@ -111,23 +115,23 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
else
clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS - 1;
 
-   pll_ref = devm_clk_get(pdev-dev, pll_ref);
-   pll_in = devm_clk_get(pdev-dev, pll_in);
-   if (!IS_ERR(pll_ref))
-   mout_audss_p[0] = __clk_get_name(pll_ref);
-   if (!IS_ERR(pll_in))
-   mout_audss_p[1] = __clk_get_name(pll_in);
+   for (i = 0; i  ARRAY_SIZE(clk_name_ref); i++) {
+   tmp = devm_clk_get(pdev-dev, clk_name_ref[i]);
+   if (!IS_ERR(tmp))
+   clk_name_actual[i] = __clk_get_name(tmp);
+   }
+
+   mout_audss_p[0] = clk_name_actual[0];
+   mout_audss_p[1] = clk_name_actual[1];
+   mout_i2s_p[1] = clk_name_actual[2];
+   mout_i2s_p[2] = clk_name_actual[3];
+   sclk_pcm_p = clk_name_actual[4];
+
clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, mout_audss,
mout_audss_p, ARRAY_SIZE(mout_audss_p),
CLK_SET_RATE_NO_REPARENT,
reg_base + ASS_CLK_SRC, 0, 1, 0, lock);
 
-   cdclk = devm_clk_get(pdev-dev, cdclk);
-   sclk_audio = devm_clk_get(pdev-dev, sclk_audio);
-   if (!IS_ERR(cdclk))
-   mout_i2s_p[1] = __clk_get_name(cdclk);
-   if (!IS_ERR(sclk_audio))
-   mout_i2s_p[2] = __clk_get_name(sclk_audio);
clk_table[EXYNOS_MOUT_I2S] = clk_register_mux(NULL, mout_i2s,
mout_i2s_p, ARRAY_SIZE(mout_i2s_p),
CLK_SET_RATE_NO_REPARENT,
@@ -161,9 +165,6 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
 sclk_pcm, CLK_SET_RATE_PARENT,
reg_base + ASS_CLK_GATE, 4, 0, lock);
 
-   sclk_pcm_in = devm_clk_get(pdev-dev, sclk_pcm_in);
-   if (!IS_ERR(sclk_pcm_in))
-   sclk_pcm_p = __clk_get_name(sclk_pcm_in);
clk_table[EXYNOS_SCLK_PCM] = clk_register_gate(NULL, sclk_pcm,
sclk_pcm_p, CLK_SET_RATE_PARENT,
reg_base + ASS_CLK_GATE, 5, 0, lock);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] clk: exynos-audss: Adapt to exising clock framework

2014-07-11 Thread Tushar Behera
On 07/11/2014 03:21 PM, Tomasz Figa wrote:
 Hi Tushar,
 
 On 11.07.2014 11:37, Tushar Behera wrote:
 The patchset is targetted as moving exising exynos-audss clock driver from 
 being
 a module driver. The driver is now registered through CLK_OF_DECLARE and is
 inline with other Samsung clock drivers.
 
 I'm afraid I have to NAK this series or at least the part converting the
 driver back to use CLK_OF_DECLARE().
 

Considering the more prevalent usage of CLK_OF_DECLARE() in drivers/clk
led me into thinking it was the normal way for the clock drivers.
Keeping only one clock driver using a different approach looked odd to
me. Anyways, I don't have any other reason to pursue this case.

 We have deliberately made this driver a platform driver, because this is
 how drivers should be modeled in Linux kernel whenever possible.
 CLK_OF_DECLARE() should be only considered a hack to work around late
 initialization of driver model. Reverting this change without a good
 reason (and you haven't provided such) is just going backwards.
 
 Rest of this series is actually quite nice, though, as reusing Samsung
 clock helpers reduces the line count significantly, so if you could
 rework this to keep this driver a platform driver then we could get
 something I could ack.
 

Sure. There are still some valid cleanups even if we plan to retain the
platform driver infrastructure. I will split and repost.

 Best regards,
 Tomasz
 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 0/3] clk: exynos-audss: Adapt to exising clock framework

2014-07-11 Thread Tushar Behera
Generic cleanup and usage of samsung clock register/unregister APIs.

The patches are tested on Exynos5800 based Peach-Pi board. More tests are
welcome.

Tushar Behera (3):
  clk: exynos-audss: Simplify code to get clock names
  clk: samsung: Add API to unregister clocks
  clk: exynos-audss: Use samsung clock APIs to register/unregister
clocks

 drivers/clk/samsung/clk-exynos-audss.c |  179 +---
 drivers/clk/samsung/clk.c  |   19 
 drivers/clk/samsung/clk.h  |2 +
 3 files changed, 95 insertions(+), 105 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 1/3] clk: exynos-audss: Simplify code to get clock names

2014-07-11 Thread Tushar Behera
Instead of getting the clock names individually, it would be good to put
the logic within a loop.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
Changes for V2:
* Calling clk_put as soon as the clock is not required anymore

 drivers/clk/samsung/clk-exynos-audss.c |   35 +---
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c 
b/drivers/clk/samsung/clk-exynos-audss.c
index 13eae14c..1a5294c 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -80,10 +80,14 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
 {
int i, ret = 0;
struct resource *res;
+   struct clk *tmp;
+   const char *clk_name_ref[] = {
+   pll_ref, pll_in, cdclk, sclk_audio, sclk_pcm_in };
+   const char *clk_name_actual[] = {
+   fin_pll, fout_epll, cdclk0, sclk_audio0, sclk_pcm0};
const char *mout_audss_p[] = {fin_pll, fout_epll};
const char *mout_i2s_p[] = {mout_audss, cdclk0, sclk_audio0};
const char *sclk_pcm_p = sclk_pcm0;
-   struct clk *pll_ref, *pll_in, *cdclk, *sclk_audio, *sclk_pcm_in;
const struct of_device_id *match;
enum exynos_audss_clk_type variant;
 
@@ -111,23 +115,25 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
else
clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS - 1;
 
-   pll_ref = devm_clk_get(pdev-dev, pll_ref);
-   pll_in = devm_clk_get(pdev-dev, pll_in);
-   if (!IS_ERR(pll_ref))
-   mout_audss_p[0] = __clk_get_name(pll_ref);
-   if (!IS_ERR(pll_in))
-   mout_audss_p[1] = __clk_get_name(pll_in);
+   for (i = 0; i  ARRAY_SIZE(clk_name_ref); i++) {
+   tmp = clk_get(pdev-dev, clk_name_ref[i]);
+   if (!IS_ERR(tmp)) {
+   clk_name_actual[i] = __clk_get_name(tmp);
+   clk_put(tmp);
+   }
+   }
+
+   mout_audss_p[0] = clk_name_actual[0];
+   mout_audss_p[1] = clk_name_actual[1];
+   mout_i2s_p[1] = clk_name_actual[2];
+   mout_i2s_p[2] = clk_name_actual[3];
+   sclk_pcm_p = clk_name_actual[4];
+
clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, mout_audss,
mout_audss_p, ARRAY_SIZE(mout_audss_p),
CLK_SET_RATE_NO_REPARENT,
reg_base + ASS_CLK_SRC, 0, 1, 0, lock);
 
-   cdclk = devm_clk_get(pdev-dev, cdclk);
-   sclk_audio = devm_clk_get(pdev-dev, sclk_audio);
-   if (!IS_ERR(cdclk))
-   mout_i2s_p[1] = __clk_get_name(cdclk);
-   if (!IS_ERR(sclk_audio))
-   mout_i2s_p[2] = __clk_get_name(sclk_audio);
clk_table[EXYNOS_MOUT_I2S] = clk_register_mux(NULL, mout_i2s,
mout_i2s_p, ARRAY_SIZE(mout_i2s_p),
CLK_SET_RATE_NO_REPARENT,
@@ -161,9 +167,6 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
 sclk_pcm, CLK_SET_RATE_PARENT,
reg_base + ASS_CLK_GATE, 4, 0, lock);
 
-   sclk_pcm_in = devm_clk_get(pdev-dev, sclk_pcm_in);
-   if (!IS_ERR(sclk_pcm_in))
-   sclk_pcm_p = __clk_get_name(sclk_pcm_in);
clk_table[EXYNOS_SCLK_PCM] = clk_register_gate(NULL, sclk_pcm,
sclk_pcm_p, CLK_SET_RATE_PARENT,
reg_base + ASS_CLK_GATE, 5, 0, lock);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 2/3] clk: samsung: Add API to unregister clocks

2014-07-11 Thread Tushar Behera
Added an API to unregister all the clocks defined within a context. This
is helpful in case where the clock is registered through a platform
driver and we want to unregister the clocks during remove callback.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
Changelog:
This is new patch required because of changes to patch 3/3.

 drivers/clk/samsung/clk.c |   19 +++
 drivers/clk/samsung/clk.h |2 ++
 2 files changed, 21 insertions(+)

diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c
index 49629c7..b9310b9 100644
--- a/drivers/clk/samsung/clk.c
+++ b/drivers/clk/samsung/clk.c
@@ -83,6 +83,25 @@ struct samsung_clk_provider *__init samsung_clk_init(struct 
device_node *np,
return ctx;
 }
 
+/* API to remove a clock provider */
+void samsung_clk_exit(struct device_node *np, struct samsung_clk_provider *ctx)
+{
+   int i;
+
+   if (np)
+   of_clk_del_provider(np);
+
+   if (!ctx)
+   return;
+
+   for (i = 0; i  ctx-clk_data.clk_num; i++)
+   if (!IS_ERR(ctx-clk_data.clks[i]))
+   clk_unregister(ctx-clk_data.clks[i]);
+
+   kfree(ctx-clk_data.clks);
+   kfree(ctx);
+}
+
 /* add a clock instance to the clock lookup table used for dt based lookup */
 void samsung_clk_add_lookup(struct samsung_clk_provider *ctx, struct clk *clk,
unsigned int id)
diff --git a/drivers/clk/samsung/clk.h b/drivers/clk/samsung/clk.h
index 9693b80..8ecc85a 100644
--- a/drivers/clk/samsung/clk.h
+++ b/drivers/clk/samsung/clk.h
@@ -327,6 +327,8 @@ struct samsung_pll_clock {
 extern struct samsung_clk_provider *__init samsung_clk_init(
struct device_node *np, void __iomem *base,
unsigned long nr_clks);
+extern void samsung_clk_exit(struct device_node *np,
+   struct samsung_clk_provider *ctx);
 extern void __init samsung_clk_of_register_fixed_ext(
struct samsung_clk_provider *ctx,
struct samsung_fixed_rate_clock *fixed_rate_clk,
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 3/3] clk: exynos-audss: Use samsung clock APIs to register/unregister clocks

2014-07-11 Thread Tushar Behera
Using samsung clock APIs to register/unregister clocks will save some
lines of code.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
Changes of v2:
* Retain platform driver structure.

 drivers/clk/samsung/clk-exynos-audss.c |  146 
 1 file changed, 56 insertions(+), 90 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c 
b/drivers/clk/samsung/clk-exynos-audss.c
index 1a5294c..2b90967 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,16 +19,16 @@
 
 #include dt-bindings/clock/exynos-audss-clk.h
 
+#include clk.h
+
 enum exynos_audss_clk_type {
TYPE_EXYNOS4210,
TYPE_EXYNOS5250,
TYPE_EXYNOS5420,
 };
 
-static DEFINE_SPINLOCK(lock);
-static struct clk **clk_table;
+static struct samsung_clk_provider *ctx;
 static void __iomem *reg_base;
-static struct clk_onecell_data clk_data;
 
 #define ASS_CLK_SRC 0x0
 #define ASS_CLK_DIV 0x4
@@ -78,7 +78,7 @@ static const struct of_device_id exynos_audss_clk_of_match[] 
= {
 /* register exynos_audss clocks */
 static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-   int i, ret = 0;
+   int i;
struct resource *res;
struct clk *tmp;
const char *clk_name_ref[] = {
@@ -87,14 +87,51 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
fin_pll, fout_epll, cdclk0, sclk_audio0, sclk_pcm0};
const char *mout_audss_p[] = {fin_pll, fout_epll};
const char *mout_i2s_p[] = {mout_audss, cdclk0, sclk_audio0};
-   const char *sclk_pcm_p = sclk_pcm0;
+   char sclk_pcm_p[32];
const struct of_device_id *match;
enum exynos_audss_clk_type variant;
 
+   struct samsung_mux_clock exynos_audss_mux_clks[] = {
+   MUX(EXYNOS_MOUT_AUDSS, mout_audss, mout_audss_p,
+   ASS_CLK_SRC, 0, 1),
+   MUX(EXYNOS_MOUT_I2S, mout_i2s, mout_i2s_p,
+   ASS_CLK_SRC, 2, 2),
+   };
+
+   struct samsung_div_clock exynos_audss_div_clks[] = {
+   DIV(EXYNOS_DOUT_SRP, dout_srp, mout_audss,
+   ASS_CLK_DIV, 0, 4),
+   DIV(EXYNOS_DOUT_AUD_BUS, dout_aud_bus, dout_srp,
+   ASS_CLK_DIV, 4, 4),
+   DIV(EXYNOS_DOUT_I2S, dout_i2s, mout_i2s, ASS_CLK_DIV, 8, 4),
+   };
+
+   struct samsung_gate_clock exynos_audss_gate_clks[] = {
+   GATE(EXYNOS_SRP_CLK, srp_clk, dout_srp,
+   ASS_CLK_GATE, 0, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_I2S_BUS, i2s_bus, dout_aud_bus,
+   ASS_CLK_GATE, 2, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_SCLK_I2S, sclk_i2s, dout_i2s,
+   ASS_CLK_GATE, 3, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_PCM_BUS, pcm_bus, sclk_pcm,
+   ASS_CLK_GATE, 4, CLK_SET_RATE_PARENT, 0),
+   GATE(EXYNOS_SCLK_PCM, sclk_pcm, sclk_pcm_p,
+   ASS_CLK_GATE, 5, CLK_SET_RATE_PARENT, 0),
+   };
+
+   struct samsung_gate_clock exynos5420_audss_gate_clks[] = {
+   GATE(EXYNOS_ADMA, adma, dout_srp,
+   ASS_CLK_GATE, 9, CLK_SET_RATE_PARENT, 0),
+   };
+
+   int nr_clks = EXYNOS_AUDSS_MAX_CLKS;
+
match = of_match_node(exynos_audss_clk_of_match, pdev-dev.of_node);
if (!match)
return -EINVAL;
variant = (enum exynos_audss_clk_type)match-data;
+   if (variant != TYPE_EXYNOS5420)
+   nr_clks--;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
reg_base = devm_ioremap_resource(pdev-dev, res);
@@ -103,17 +140,11 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
return PTR_ERR(reg_base);
}
 
-   clk_table = devm_kzalloc(pdev-dev,
-   sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
-   GFP_KERNEL);
-   if (!clk_table)
+   ctx = samsung_clk_init(pdev-dev.of_node, reg_base, nr_clks);
+   if (!ctx) {
+   dev_err(pdev-dev, failed to get clock provier context\n);
return -ENOMEM;
-
-   clk_data.clks = clk_table;
-   if (variant == TYPE_EXYNOS5420)
-   clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-   else
-   clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS - 1;
+   }
 
for (i = 0; i  ARRAY_SIZE(clk_name_ref); i++) {
tmp = clk_get(pdev-dev, clk_name_ref[i]);
@@ -127,69 +158,20 @@ static int exynos_audss_clk_probe(struct platform_device 
*pdev)
mout_audss_p[1] = clk_name_actual[1];
mout_i2s_p[1] = clk_name_actual[2];
mout_i2s_p[2] = clk_name_actual[3];
-   sclk_pcm_p = clk_name_actual[4];
-
-   clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, mout_audss

Re: [PATCH 2/2] clk: exynos-audss: Update as per existing framework

2014-07-11 Thread Tushar Behera
On 07/11/2014 04:10 PM, Sylwester Nawrocki wrote:
 Hi Tushar,
 
 On 11/07/14 11:37, Tushar Behera wrote:
 Change exynos-audss clock driver as per existing clock framework from
 the existing module driver framework.
 
 Can you explain what's the actual issue you're trying to solve with that
 patch ? What's the problem with this driver being a platform driver ?
 It feels we're moving in circles here, see
 
 commit b37a4224104568198b93fb9831224cfe7d83fff8
 Author: Andrew Bresticker abres...@chromium.org
 Date:   Wed Sep 25 14:12:47 2013 -0700
 
 clk: exynos-audss: convert to platform device
 
 The Exynos AudioSS clock controller will later be modified to allow
 input clocks to be specified via device-tree in order to support
 multiple Exynos SoCs.  This will introduce a dependency on the core
 SoC clock controller being initialized first so that the AudioSS driver
 can look up its input clocks, but the order in which clock providers
 are probed in of_clk_init() is not guaranteed.  Since deferred probing
 is not supported in of_clk_init() and the AudioSS block is not the core
 controller, we can initialize it later as a platform device.
 
 Signed-off-by: Andrew Bresticker abres...@chromium.org
 Acked-by: Tomasz Figa t.f...@samsung.com
 Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
 Acked-by: Mike Turquette mturque...@linaro.org
 Acked-by: Kukjin Kim kgene@samsung.com
 Signed-off-by: Tomasz Figa t.f...@samsung.com
 
 I realize of_clk_init() now handles better clock provider dependencies,
 nevertheless do we really need all this churn ?
 

I have sent v2 of the patchset while retaining the platform driver
infrastructure. Awaiting your review comments on that.

 --
 Thanks,
 Sylwester
 

Thanks,
-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-07-09 Thread Tushar Behera
On 07/09/2014 03:44 PM, Javier Martinez Canillas wrote:
> Hello Tushar,
> 
> On Tue, Jul 8, 2014 at 5:00 AM, Tushar Behera  wrote:
>>>>
>>>> The u-boot version is a little different on my Peach-Pi as compared to
>>>> the market release version. Not sure if that is making any difference.
>>>>
>>>> Peach # version
>>>>
>>>> U-Boot 2013.04 (Feb 13 2014 - 16:35:03) for Peach
>>>> armv7a-cros-linux-gnueabi-gcc.real (4.8.1_cos_gg_feea904_4.8.1-r66)
>>>> 4.8.x-google 20130905 (prerelease)
>>>> GNU ld (binutils-2.22_cos_gg_2) 2.22
>>>>
>>>
> 
> I'm using the same U-Boot version than Kevin (U-Boot 2013.04-gb98ed09)
> and on my setup using chained nv-uboot I also need patch 1/3 along
> with 2/3 to fix the issue.
> 
>>> Note that I've applied this only from this series so I'm not sure how
>>> much the problem can be solved...any updates for 1/3 and 3/3?
>>>
>>> - Kukjin
>>
>> Thanks for applying 2/3. I am working on 1/3 to see if we are following
>> the right approach to fix Kevin's issue (unfortunately, I am not hitting
>> the bug on my board ATM). 3/3 has already been merged through a
>> different patchset.
>>
> 
> I'm sending as an attachment my complete boot log when booting today's
> next (20140709) until it hangs and my u-boot env vars. I hope that
> helps.
> 

Would you please check the behaviour after enabling following config
options?

diff --git a/arch/arm/configs/exynos_defconfig
b/arch/arm/configs/exynos_defconfig
index e07a227..d6056ab 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -93,6 +93,11 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FONTS=y
 CONFIG_FONT_7x14=y
 CONFIG_LOGO=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_SAMSUNG=y
+CONFIG_SND_SOC_SNOW=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_EXYNOS=y
@@ -109,6 +114,8 @@ CONFIG_MMC_DW_IDMAC=y
 CONFIG_MMC_DW_EXYNOS=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_S3C=y
+CONFIG_DMADEVICES=y
+CONFIG_PL330_DMA=y
 CONFIG_COMMON_CLK_MAX77686=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y


>> --
>> Tushar Behera
>> --
> 
> Best regards,
> Javier
> 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-07-09 Thread Tushar Behera
On 07/09/2014 03:44 PM, Javier Martinez Canillas wrote:
 Hello Tushar,
 
 On Tue, Jul 8, 2014 at 5:00 AM, Tushar Behera trbli...@gmail.com wrote:

 The u-boot version is a little different on my Peach-Pi as compared to
 the market release version. Not sure if that is making any difference.

 Peach # version

 U-Boot 2013.04 (Feb 13 2014 - 16:35:03) for Peach
 armv7a-cros-linux-gnueabi-gcc.real (4.8.1_cos_gg_feea904_4.8.1-r66)
 4.8.x-google 20130905 (prerelease)
 GNU ld (binutils-2.22_cos_gg_2) 2.22


 
 I'm using the same U-Boot version than Kevin (U-Boot 2013.04-gb98ed09)
 and on my setup using chained nv-uboot I also need patch 1/3 along
 with 2/3 to fix the issue.
 
 Note that I've applied this only from this series so I'm not sure how
 much the problem can be solved...any updates for 1/3 and 3/3?

 - Kukjin

 Thanks for applying 2/3. I am working on 1/3 to see if we are following
 the right approach to fix Kevin's issue (unfortunately, I am not hitting
 the bug on my board ATM). 3/3 has already been merged through a
 different patchset.

 
 I'm sending as an attachment my complete boot log when booting today's
 next (20140709) until it hangs and my u-boot env vars. I hope that
 helps.
 

Would you please check the behaviour after enabling following config
options?

diff --git a/arch/arm/configs/exynos_defconfig
b/arch/arm/configs/exynos_defconfig
index e07a227..d6056ab 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -93,6 +93,11 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FONTS=y
 CONFIG_FONT_7x14=y
 CONFIG_LOGO=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_SAMSUNG=y
+CONFIG_SND_SOC_SNOW=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_EXYNOS=y
@@ -109,6 +114,8 @@ CONFIG_MMC_DW_IDMAC=y
 CONFIG_MMC_DW_EXYNOS=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_S3C=y
+CONFIG_DMADEVICES=y
+CONFIG_PL330_DMA=y
 CONFIG_COMMON_CLK_MAX77686=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y


 --
 Tushar Behera
 --
 
 Best regards,
 Javier
 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-07-07 Thread Tushar Behera
On 07/08/2014 05:04 AM, Kukjin Kim wrote:
> On 07/01/14 20:59, Tushar Behera wrote:
>> On 06/27/2014 08:18 PM, Kevin Hilman wrote:
>>> On Fri, Jun 27, 2014 at 7:18 AM, Kevin Hilman 
>>> wrote:
>>>> On Thu, Jun 26, 2014 at 8:38 PM, Tushar Behera 
>>>> wrote:
>>>>
>>>>> Would you please provide me the environment setting of your u-boot?
>>>>> U-boot environment on my board has been over-written, I would like to
>>>>> set it same as yours and try to reproduce the issue at my end. With
>>>>> only
>>>>> 'sound init', I don't seem to hit this issue anymore.
>>>>
>>>> Attached is a full boot log using v3.16-rc2 with my patch adding
>>>> CLK_IGNORE_UNUSED to mau_epll and Doug's aclk66_peric patch.  In the
>>>> boot log, you'll see the output of 'printenv' inside u-boot where the
>>>> environment is dumped.
>>>
>>> Oops, I sent you a boot log for the octa board.  Here's the one for
>>> peach-pi with the same kernel (built with upstream exynos_defconfig)
>>>
>>> Kevin
>>>
>>
>> The u-boot version is a little different on my Peach-Pi as compared to
>> the market release version. Not sure if that is making any difference.
>>
>> Peach # version
>>
>> U-Boot 2013.04 (Feb 13 2014 - 16:35:03) for Peach
>> armv7a-cros-linux-gnueabi-gcc.real (4.8.1_cos_gg_feea904_4.8.1-r66)
>> 4.8.x-google 20130905 (prerelease)
>> GNU ld (binutils-2.22_cos_gg_2) 2.22
>>
> 
> Note that I've applied this only from this series so I'm not sure how
> much the problem can be solved...any updates for 1/3 and 3/3?
> 
> - Kukjin

Thanks for applying 2/3. I am working on 1/3 to see if we are following
the right approach to fix Kevin's issue (unfortunately, I am not hitting
the bug on my board ATM). 3/3 has already been merged through a
different patchset.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-07-07 Thread Tushar Behera
On 07/08/2014 05:04 AM, Kukjin Kim wrote:
 On 07/01/14 20:59, Tushar Behera wrote:
 On 06/27/2014 08:18 PM, Kevin Hilman wrote:
 On Fri, Jun 27, 2014 at 7:18 AM, Kevin Hilmankhil...@linaro.org 
 wrote:
 On Thu, Jun 26, 2014 at 8:38 PM, Tushar Beheratrbli...@gmail.com 
 wrote:

 Would you please provide me the environment setting of your u-boot?
 U-boot environment on my board has been over-written, I would like to
 set it same as yours and try to reproduce the issue at my end. With
 only
 'sound init', I don't seem to hit this issue anymore.

 Attached is a full boot log using v3.16-rc2 with my patch adding
 CLK_IGNORE_UNUSED to mau_epll and Doug's aclk66_peric patch.  In the
 boot log, you'll see the output of 'printenv' inside u-boot where the
 environment is dumped.

 Oops, I sent you a boot log for the octa board.  Here's the one for
 peach-pi with the same kernel (built with upstream exynos_defconfig)

 Kevin


 The u-boot version is a little different on my Peach-Pi as compared to
 the market release version. Not sure if that is making any difference.

 Peach # version

 U-Boot 2013.04 (Feb 13 2014 - 16:35:03) for Peach
 armv7a-cros-linux-gnueabi-gcc.real (4.8.1_cos_gg_feea904_4.8.1-r66)
 4.8.x-google 20130905 (prerelease)
 GNU ld (binutils-2.22_cos_gg_2) 2.22

 
 Note that I've applied this only from this series so I'm not sure how
 much the problem can be solved...any updates for 1/3 and 3/3?
 
 - Kukjin

Thanks for applying 2/3. I am working on 1/3 to see if we are following
the right approach to fix Kevin's issue (unfortunately, I am not hitting
the bug on my board ATM). 3/3 has already been merged through a
different patchset.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drm/exynos: fimd: Keep power enabled during fimd_bind

2014-07-04 Thread Tushar Behera
Under some conditions (when IOMMU is enabled), fimd_bind() accesses
hardware registers and power-domain should be enabled during that time.

fimd_bind --> fimd_mgr_initialize --> fimd_clear_channel

If the power-domain is disabled by that time, we get a boot-time crash.
It would be better to keep power-domain enabled explicitly.

Unhandled fault: external abort on non-linefetch (0x1008) at 0xf0180034
Internal error: : 1008 [#1] PREEMPT SMP ARM
...
PC is at fimd_bind+0x84/0x134
LR is at component_bind_all+0xb4/0x1d8

Signed-off-by: Tushar Behera 
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 33161ad..34275fb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -888,11 +888,15 @@ static int fimd_bind(struct device *dev, struct device 
*master, void *data)
struct fimd_context *ctx = fimd_manager.ctx;
struct drm_device *drm_dev = data;
 
+   pm_runtime_get_sync(dev);
+
fimd_mgr_initialize(_manager, drm_dev);
exynos_drm_crtc_create(_manager);
if (ctx->display)
exynos_drm_create_enc_conn(drm_dev, ctx->display);
 
+   pm_runtime_put_sync(dev);
+
return 0;
 
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] gpiolib: of: Update debug messages for of_get_named_gpiod_flags

2014-07-04 Thread Tushar Behera
Following is the debug output (only a few examples) before and after the patch.

$ dmesg | grep of_get_named_gpiod_flags

Before:
of_get_named_gpiod_flags: can't parse gpios property of node '/mmc@1222[0]'
of_get_named_gpiod_flags exited with status 0

After:
of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node 
'/mmc@1222[0]'
of_get_named_gpiod_flags: parsed 'gpios' property of node '/gpio-keys/power[0]' 
- status (0)

Signed-off-by: Tushar Behera 
---
 drivers/gpio/gpiolib-of.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index af7e25c..e60cdab 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -82,15 +82,16 @@ struct gpio_desc *of_get_named_gpiod_flags(struct 
device_node *np,
ret = of_parse_phandle_with_args(np, propname, "#gpio-cells", index,
 _data.gpiospec);
if (ret) {
-   pr_debug("%s: can't parse gpios property of node '%s[%d]'\n",
-   __func__, np->full_name, index);
+   pr_debug("%s: can't parse '%s' property of node '%s[%d]'\n",
+   __func__, propname, np->full_name, index);
return ERR_PTR(ret);
}
 
gpiochip_find(_data, of_gpiochip_find_and_xlate);
 
of_node_put(gg_data.gpiospec.np);
-   pr_debug("%s exited with status %d\n", __func__,
+   pr_debug("%s: parsed '%s' property of node '%s[%d]' - status (%d)\n",
+__func__, propname, np->full_name, index,
 PTR_ERR_OR_ZERO(gg_data.out_gpio));
return gg_data.out_gpio;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] iommu/exynos: Select ARM_DMA_USE_IOMMU

2014-07-04 Thread Tushar Behera
For IOMMU to use on Exynos platforms, we need to enable ARM_DMA_USE_IOMMU. It
would be better to select it by default when EXYNOS_IOMMU is enabled.

Signed-off-by: Tushar Behera 
---
 drivers/iommu/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index d260605..54f3ad1a 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -180,6 +180,7 @@ config EXYNOS_IOMMU
bool "Exynos IOMMU Support"
depends on ARCH_EXYNOS
select IOMMU_API
+   select ARM_DMA_USE_IOMMU
help
  Support for the IOMMU (System MMU) of Samsung Exynos application
  processor family. This enables H/W multimedia accelerators to see
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] ASoC: max98090: Add check for CODEC type

2014-07-04 Thread Tushar Behera
CODEC type (MAX98090/MAX98091) can be specified from device-tree file,
it can also be obtained from the CODEC during runtime.

Add an explicit check to figure out if both are matching, else print
a message warning about the same.

Signed-off-by: Tushar Behera 
---
 sound/soc/codecs/max98090.c |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index ca74f502..1ed06d9 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2215,6 +2215,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
 {
struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
struct max98090_cdata *cdata;
+   enum max98090_type devtype;
int ret = 0;
 
dev_dbg(codec->dev, "max98090_probe\n");
@@ -2250,16 +2251,21 @@ static int max98090_probe(struct snd_soc_codec *codec)
}
 
if ((ret >= M98090_REVA) && (ret <= M98090_REVA + 0x0f)) {
-   max98090->devtype = MAX98090;
+   devtype = MAX98090;
dev_info(codec->dev, "MAX98090 REVID=0x%02x\n", ret);
} else if ((ret >= M98091_REVA) && (ret <= M98091_REVA + 0x0f)) {
-   max98090->devtype = MAX98091;
+   devtype = MAX98091;
dev_info(codec->dev, "MAX98091 REVID=0x%02x\n", ret);
} else {
-   max98090->devtype = MAX98090;
+   devtype = MAX98090;
dev_err(codec->dev, "Unrecognized revision 0x%02x\n", ret);
}
 
+   if (max98090->devtype != devtype) {
+   dev_warn(codec->dev, "Mismatch in DT specified CODEC type.\n");
+   max98090->devtype = devtype;
+   }
+
max98090->jack_state = M98090_JACK_STATE_NO_HEADSET;
 
INIT_DELAYED_WORK(>jack_work, max98090_jack_work);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ASoC: max98090: Remove redundant max98090_handle_pdata()

2014-07-04 Thread Tushar Behera
max98090_handle_pdata() is not doing anything other than printing
a message if pdata is not valid. This can be removed.

Signed-off-by: Tushar Behera 
---
 sound/soc/codecs/max98090.c |   13 -
 1 file changed, 13 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 1ed06d9..b2b3286 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2200,17 +2200,6 @@ static struct snd_soc_dai_driver max98090_dai[] = {
 }
 };
 
-static void max98090_handle_pdata(struct snd_soc_codec *codec)
-{
-   struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
-   struct max98090_pdata *pdata = max98090->pdata;
-
-   if (!pdata) {
-   dev_err(codec->dev, "No platform data\n");
-   return;
-   }
-}
-
 static int max98090_probe(struct snd_soc_codec *codec)
 {
struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
@@ -2310,8 +2299,6 @@ static int max98090_probe(struct snd_soc_codec *codec)
snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE,
M98090_MBVSEL_MASK, M98090_MBVSEL_2V8);
 
-   max98090_handle_pdata(codec);
-
max98090_add_widgets(codec);
 
 err_access:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ASoC: core: Fix possible NULL pointer dereference

2014-07-04 Thread Tushar Behera
snd_soc_of_parse_card_name() may be called before card->dev has been
set, which results in a kernel panic.

Unable to handle kernel NULL pointer dereference at virtual address 0210
PC is at snd_soc_of_parse_card_name+0x18/0x54
LR is at snow_probe+0x5c/0xd4

Add an error check in snd_soc_of_parse_card_name() to take care of this
case and print out a message in case of error.

Signed-off-by: Tushar Behera 
---
 sound/soc/soc-core.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c4db07f..2e4bdc0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4391,9 +4391,16 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_codec);
 int snd_soc_of_parse_card_name(struct snd_soc_card *card,
   const char *propname)
 {
-   struct device_node *np = card->dev->of_node;
+   struct device_node *np;
int ret;
 
+   if (!card->dev) {
+   pr_err("card->dev is not set before calling %s\n", __func__);
+   return -EINVAL;
+   }
+
+   np = card->dev->of_node;
+
ret = of_property_read_string_index(np, propname, 0, >name);
/*
 * EINVAL means the property does not exist. This is fine providing
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] ASoC: samsung: Update sound-card name for Snow

2014-07-04 Thread Tushar Behera
Snow sound-card driver supports multiple boards with different
audio codecs. Updating the sound card name per board basis would provide
some more information to the end-user.

Signed-off-by: Tushar Behera 
---
 Documentation/devicetree/bindings/sound/snow.txt |4 
 sound/soc/samsung/snow.c |3 +++
 2 files changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/snow.txt 
b/Documentation/devicetree/bindings/sound/snow.txt
index e0b7a82..6df74f1 100644
--- a/Documentation/devicetree/bindings/sound/snow.txt
+++ b/Documentation/devicetree/bindings/sound/snow.txt
@@ -8,11 +8,15 @@ Required properties:
 - samsung,i2s-controller: The phandle of the Samsung I2S controller
 - samsung,audio-codec: The phandle of the audio codec
 
+Optional:
+- samsung,model: The name of the sound-card
+
 Example:
 
 sound {
compatible = "google,snow-audio-max98095";
 
+   samsung,model = "Snow-I2S-MAX98095";
samsung,i2s-controller = <>;
samsung,audio-codec = <>;
 };
diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c
index 8bbd348..0acf5d0 100644
--- a/sound/soc/samsung/snow.c
+++ b/sound/soc/samsung/snow.c
@@ -92,6 +92,9 @@ static int snow_probe(struct platform_device *pdev)
 
card->dev = >dev;
 
+   /* Update card-name if provided through DT, else use default name */
+   snd_soc_of_parse_card_name(card, "samsung,model");
+
ret = devm_snd_soc_register_card(>dev, card);
if (ret) {
dev_err(>dev, "snd_soc_register_card failed (%d)\n", ret);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] ASoC: samsung: Update sound-card name for Snow

2014-07-04 Thread Tushar Behera
Snow sound-card driver supports multiple boards with different
audio codecs. Updating the sound card name per board basis would provide
some more information to the end-user.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 Documentation/devicetree/bindings/sound/snow.txt |4 
 sound/soc/samsung/snow.c |3 +++
 2 files changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/snow.txt 
b/Documentation/devicetree/bindings/sound/snow.txt
index e0b7a82..6df74f1 100644
--- a/Documentation/devicetree/bindings/sound/snow.txt
+++ b/Documentation/devicetree/bindings/sound/snow.txt
@@ -8,11 +8,15 @@ Required properties:
 - samsung,i2s-controller: The phandle of the Samsung I2S controller
 - samsung,audio-codec: The phandle of the audio codec
 
+Optional:
+- samsung,model: The name of the sound-card
+
 Example:
 
 sound {
compatible = google,snow-audio-max98095;
 
+   samsung,model = Snow-I2S-MAX98095;
samsung,i2s-controller = i2s0;
samsung,audio-codec = max98095;
 };
diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c
index 8bbd348..0acf5d0 100644
--- a/sound/soc/samsung/snow.c
+++ b/sound/soc/samsung/snow.c
@@ -92,6 +92,9 @@ static int snow_probe(struct platform_device *pdev)
 
card-dev = pdev-dev;
 
+   /* Update card-name if provided through DT, else use default name */
+   snd_soc_of_parse_card_name(card, samsung,model);
+
ret = devm_snd_soc_register_card(pdev-dev, card);
if (ret) {
dev_err(pdev-dev, snd_soc_register_card failed (%d)\n, ret);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ASoC: core: Fix possible NULL pointer dereference

2014-07-04 Thread Tushar Behera
snd_soc_of_parse_card_name() may be called before card-dev has been
set, which results in a kernel panic.

Unable to handle kernel NULL pointer dereference at virtual address 0210
PC is at snd_soc_of_parse_card_name+0x18/0x54
LR is at snow_probe+0x5c/0xd4

Add an error check in snd_soc_of_parse_card_name() to take care of this
case and print out a message in case of error.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 sound/soc/soc-core.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c4db07f..2e4bdc0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4391,9 +4391,16 @@ EXPORT_SYMBOL_GPL(snd_soc_unregister_codec);
 int snd_soc_of_parse_card_name(struct snd_soc_card *card,
   const char *propname)
 {
-   struct device_node *np = card-dev-of_node;
+   struct device_node *np;
int ret;
 
+   if (!card-dev) {
+   pr_err(card-dev is not set before calling %s\n, __func__);
+   return -EINVAL;
+   }
+
+   np = card-dev-of_node;
+
ret = of_property_read_string_index(np, propname, 0, card-name);
/*
 * EINVAL means the property does not exist. This is fine providing
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ASoC: max98090: Remove redundant max98090_handle_pdata()

2014-07-04 Thread Tushar Behera
max98090_handle_pdata() is not doing anything other than printing
a message if pdata is not valid. This can be removed.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 sound/soc/codecs/max98090.c |   13 -
 1 file changed, 13 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 1ed06d9..b2b3286 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2200,17 +2200,6 @@ static struct snd_soc_dai_driver max98090_dai[] = {
 }
 };
 
-static void max98090_handle_pdata(struct snd_soc_codec *codec)
-{
-   struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
-   struct max98090_pdata *pdata = max98090-pdata;
-
-   if (!pdata) {
-   dev_err(codec-dev, No platform data\n);
-   return;
-   }
-}
-
 static int max98090_probe(struct snd_soc_codec *codec)
 {
struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
@@ -2310,8 +2299,6 @@ static int max98090_probe(struct snd_soc_codec *codec)
snd_soc_update_bits(codec, M98090_REG_MIC_BIAS_VOLTAGE,
M98090_MBVSEL_MASK, M98090_MBVSEL_2V8);
 
-   max98090_handle_pdata(codec);
-
max98090_add_widgets(codec);
 
 err_access:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] ASoC: max98090: Add check for CODEC type

2014-07-04 Thread Tushar Behera
CODEC type (MAX98090/MAX98091) can be specified from device-tree file,
it can also be obtained from the CODEC during runtime.

Add an explicit check to figure out if both are matching, else print
a message warning about the same.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 sound/soc/codecs/max98090.c |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index ca74f502..1ed06d9 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2215,6 +2215,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
 {
struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
struct max98090_cdata *cdata;
+   enum max98090_type devtype;
int ret = 0;
 
dev_dbg(codec-dev, max98090_probe\n);
@@ -2250,16 +2251,21 @@ static int max98090_probe(struct snd_soc_codec *codec)
}
 
if ((ret = M98090_REVA)  (ret = M98090_REVA + 0x0f)) {
-   max98090-devtype = MAX98090;
+   devtype = MAX98090;
dev_info(codec-dev, MAX98090 REVID=0x%02x\n, ret);
} else if ((ret = M98091_REVA)  (ret = M98091_REVA + 0x0f)) {
-   max98090-devtype = MAX98091;
+   devtype = MAX98091;
dev_info(codec-dev, MAX98091 REVID=0x%02x\n, ret);
} else {
-   max98090-devtype = MAX98090;
+   devtype = MAX98090;
dev_err(codec-dev, Unrecognized revision 0x%02x\n, ret);
}
 
+   if (max98090-devtype != devtype) {
+   dev_warn(codec-dev, Mismatch in DT specified CODEC type.\n);
+   max98090-devtype = devtype;
+   }
+
max98090-jack_state = M98090_JACK_STATE_NO_HEADSET;
 
INIT_DELAYED_WORK(max98090-jack_work, max98090_jack_work);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] iommu/exynos: Select ARM_DMA_USE_IOMMU

2014-07-04 Thread Tushar Behera
For IOMMU to use on Exynos platforms, we need to enable ARM_DMA_USE_IOMMU. It
would be better to select it by default when EXYNOS_IOMMU is enabled.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 drivers/iommu/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index d260605..54f3ad1a 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -180,6 +180,7 @@ config EXYNOS_IOMMU
bool Exynos IOMMU Support
depends on ARCH_EXYNOS
select IOMMU_API
+   select ARM_DMA_USE_IOMMU
help
  Support for the IOMMU (System MMU) of Samsung Exynos application
  processor family. This enables H/W multimedia accelerators to see
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] gpiolib: of: Update debug messages for of_get_named_gpiod_flags

2014-07-04 Thread Tushar Behera
Following is the debug output (only a few examples) before and after the patch.

$ dmesg | grep of_get_named_gpiod_flags

Before:
of_get_named_gpiod_flags: can't parse gpios property of node '/mmc@1222[0]'
of_get_named_gpiod_flags exited with status 0

After:
of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node 
'/mmc@1222[0]'
of_get_named_gpiod_flags: parsed 'gpios' property of node '/gpio-keys/power[0]' 
- status (0)

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 drivers/gpio/gpiolib-of.c |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index af7e25c..e60cdab 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -82,15 +82,16 @@ struct gpio_desc *of_get_named_gpiod_flags(struct 
device_node *np,
ret = of_parse_phandle_with_args(np, propname, #gpio-cells, index,
 gg_data.gpiospec);
if (ret) {
-   pr_debug(%s: can't parse gpios property of node '%s[%d]'\n,
-   __func__, np-full_name, index);
+   pr_debug(%s: can't parse '%s' property of node '%s[%d]'\n,
+   __func__, propname, np-full_name, index);
return ERR_PTR(ret);
}
 
gpiochip_find(gg_data, of_gpiochip_find_and_xlate);
 
of_node_put(gg_data.gpiospec.np);
-   pr_debug(%s exited with status %d\n, __func__,
+   pr_debug(%s: parsed '%s' property of node '%s[%d]' - status (%d)\n,
+__func__, propname, np-full_name, index,
 PTR_ERR_OR_ZERO(gg_data.out_gpio));
return gg_data.out_gpio;
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] drm/exynos: fimd: Keep power enabled during fimd_bind

2014-07-04 Thread Tushar Behera
Under some conditions (when IOMMU is enabled), fimd_bind() accesses
hardware registers and power-domain should be enabled during that time.

fimd_bind -- fimd_mgr_initialize -- fimd_clear_channel

If the power-domain is disabled by that time, we get a boot-time crash.
It would be better to keep power-domain enabled explicitly.

Unhandled fault: external abort on non-linefetch (0x1008) at 0xf0180034
Internal error: : 1008 [#1] PREEMPT SMP ARM
...
PC is at fimd_bind+0x84/0x134
LR is at component_bind_all+0xb4/0x1d8

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 33161ad..34275fb 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -888,11 +888,15 @@ static int fimd_bind(struct device *dev, struct device 
*master, void *data)
struct fimd_context *ctx = fimd_manager.ctx;
struct drm_device *drm_dev = data;
 
+   pm_runtime_get_sync(dev);
+
fimd_mgr_initialize(fimd_manager, drm_dev);
exynos_drm_crtc_create(fimd_manager);
if (ctx-display)
exynos_drm_create_enc_conn(drm_dev, ctx-display);
 
+   pm_runtime_put_sync(dev);
+
return 0;
 
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 14/14] ARM: dts: Add max77802 to exynos5420-peach-pit and exynos5800-peach-pi

2014-07-02 Thread Tushar Behera
On 06/26/2014 11:45 PM, Javier Martinez Canillas wrote:
> Peach pit and pi boards uses a Maxim 77802 power management
> IC to drive regulators and its Real Time Clock. This patch
> adds support for this chip.
> 
> These are the device nodes and pinctrl configuration that
> are present on the Peach pit DeviceTree source file in the
> the Chrome OS kernel 3.8 tree.
> 
> Signed-off-by: Javier Martinez Canillas 
> Tested-by: Naveen Krishna Chatradhi 
> ---

[ ... ]

> +
> + regulators {
> + buck1_reg: BUCK1 {
> + regulator-name = "vdd_mif";
> + regulator-min-microvolt = <80>;
> + regulator-max-microvolt = <130>;
> + regulator-always-on;
> + regulator-boot-on;
> + regulator-ramp-delay = <12500>;
> + };

IMO, adding a blank line between sub-nodes would be better.

> + buck2_reg: BUCK2 {
> + regulator-name = "vdd_arm_real";
> + regulator-min-microvolt = <80>;
> + regulator-max-microvolt = <150>;
> + regulator-always-on;
> + regulator-boot-on;
> + regulator-ramp-delay = <12500>;
> + };

[ ... ]

> + vqmmc_sdcard: ldo4_reg: LDO4 {
> + regulator-name = "vdd_sd";
> + regulator-min-microvolt = <180>;
> + regulator-max-microvolt = <280>;
> + regulator-always-on;
> +

Blank line, can be removed.

> + };

[ ... ]
> + ldo23_reg: LDO23 {
> + regulator-name = "ld0_23";

ldo_23, 'o' in place of '0'.

Similar comments for peach-pi DTS file.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 14/14] ARM: dts: Add max77802 to exynos5420-peach-pit and exynos5800-peach-pi

2014-07-02 Thread Tushar Behera
On 06/26/2014 11:45 PM, Javier Martinez Canillas wrote:
 Peach pit and pi boards uses a Maxim 77802 power management
 IC to drive regulators and its Real Time Clock. This patch
 adds support for this chip.
 
 These are the device nodes and pinctrl configuration that
 are present on the Peach pit DeviceTree source file in the
 the Chrome OS kernel 3.8 tree.
 
 Signed-off-by: Javier Martinez Canillas javier.marti...@collabora.co.uk
 Tested-by: Naveen Krishna Chatradhi ch.nav...@samsung.com
 ---

[ ... ]

 +
 + regulators {
 + buck1_reg: BUCK1 {
 + regulator-name = vdd_mif;
 + regulator-min-microvolt = 80;
 + regulator-max-microvolt = 130;
 + regulator-always-on;
 + regulator-boot-on;
 + regulator-ramp-delay = 12500;
 + };

IMO, adding a blank line between sub-nodes would be better.

 + buck2_reg: BUCK2 {
 + regulator-name = vdd_arm_real;
 + regulator-min-microvolt = 80;
 + regulator-max-microvolt = 150;
 + regulator-always-on;
 + regulator-boot-on;
 + regulator-ramp-delay = 12500;
 + };

[ ... ]

 + vqmmc_sdcard: ldo4_reg: LDO4 {
 + regulator-name = vdd_sd;
 + regulator-min-microvolt = 180;
 + regulator-max-microvolt = 280;
 + regulator-always-on;
 +

Blank line, can be removed.

 + };

[ ... ]
 + ldo23_reg: LDO23 {
 + regulator-name = ld0_23;

ldo_23, 'o' in place of '0'.

Similar comments for peach-pi DTS file.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-07-01 Thread Tushar Behera
On 06/27/2014 08:18 PM, Kevin Hilman wrote:
> On Fri, Jun 27, 2014 at 7:18 AM, Kevin Hilman  wrote:
>> On Thu, Jun 26, 2014 at 8:38 PM, Tushar Behera  wrote:
>>
>>> Would you please provide me the environment setting of your u-boot?
>>> U-boot environment on my board has been over-written, I would like to
>>> set it same as yours and try to reproduce the issue at my end. With only
>>> 'sound init', I don't seem to hit this issue anymore.
>>
>> Attached is a full boot log using v3.16-rc2 with my patch adding
>> CLK_IGNORE_UNUSED to mau_epll and Doug's aclk66_peric patch.  In the
>> boot log, you'll see the output of 'printenv' inside u-boot where the
>> environment is dumped.
> 
> Oops, I sent you a boot log for the octa board.  Here's the one for
> peach-pi with the same kernel (built with upstream exynos_defconfig)
> 
> Kevin
> 

The u-boot version is a little different on my Peach-Pi as compared to
the market release version. Not sure if that is making any difference.

Peach # version

U-Boot 2013.04 (Feb 13 2014 - 16:35:03) for Peach
armv7a-cros-linux-gnueabi-gcc.real (4.8.1_cos_gg_feea904_4.8.1-r66)
4.8.x-google 20130905 (prerelease)
GNU ld (binutils-2.22_cos_gg_2) 2.22

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-07-01 Thread Tushar Behera
On 06/27/2014 08:18 PM, Kevin Hilman wrote:
 On Fri, Jun 27, 2014 at 7:18 AM, Kevin Hilman khil...@linaro.org wrote:
 On Thu, Jun 26, 2014 at 8:38 PM, Tushar Behera trbli...@gmail.com wrote:

 Would you please provide me the environment setting of your u-boot?
 U-boot environment on my board has been over-written, I would like to
 set it same as yours and try to reproduce the issue at my end. With only
 'sound init', I don't seem to hit this issue anymore.

 Attached is a full boot log using v3.16-rc2 with my patch adding
 CLK_IGNORE_UNUSED to mau_epll and Doug's aclk66_peric patch.  In the
 boot log, you'll see the output of 'printenv' inside u-boot where the
 environment is dumped.
 
 Oops, I sent you a boot log for the octa board.  Here's the one for
 peach-pi with the same kernel (built with upstream exynos_defconfig)
 
 Kevin
 

The u-boot version is a little different on my Peach-Pi as compared to
the market release version. Not sure if that is making any difference.

Peach # version

U-Boot 2013.04 (Feb 13 2014 - 16:35:03) for Peach
armv7a-cros-linux-gnueabi-gcc.real (4.8.1_cos_gg_feea904_4.8.1-r66)
4.8.x-google 20130905 (prerelease)
GNU ld (binutils-2.22_cos_gg_2) 2.22

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-06-26 Thread Tushar Behera
On 06/26/2014 09:38 PM, Kevin Hilman wrote:
> Tushar Behera  writes:
> 
>> On Thu, Jun 26, 2014 at 4:51 AM, Kevin Hilman  wrote:
>>> Doug Anderson  writes:
>>>
>>>> Tushar,
>>>>
>>>> On Tue, Jun 10, 2014 at 10:32 PM, Tushar Behera  
>>>> wrote:
>>>>> Currently CLK_FOUT_EPLL was set as one of the parents of AUDSS mux.
>>>>> As per the user manual, it should be CLK_MAU_EPLL.
>>>>>
>>>>> The problem surfaced when the bootloader in Peach-pit board set
>>>>> the EPLL clock as the parent of AUDSS mux. While booting the kernel,
>>>>> we used to get a system hang during late boot if CLK_MAU_EPLL was
>>>>> disabled.
>>>>>
>>>>> Signed-off-by: Tushar Behera 
>>>>> Signed-off-by: Shaik Ameer Basha 
>>>>> Reported-by: Kevin Hilman 
>>>>> ---
>>>>>  arch/arm/boot/dts/exynos5420.dtsi |2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> I've tested this myself now as well.
>>>>
>>>> Tested-by: Doug Anderson 
>>>
>>> For me, this patch alone (on top of -next) doesn't solve the boot hang.
>>> I still need clk_ignore_unused for a successful boot.
>>>
>>> So, this patch might be correct, but it doesn't prevent a boot hang
>>> using a chain-loaded nv_uboot on peach-pi.  There's still another clock
>>> being disabled that causes a hang.
>>>
>>> Kevin
>>
>> Kevin,
>>
>> Can you please check if adding patch 1/3 alongwith patch 2/3 fixes the
>> issue for you?
> 
> Yes, using patch 1/3 along with 2/3 fixes the issue.
> 

Okay, that adds some more reason to re-investigate patch 1/3.

Kevin,

Would you please provide me the environment setting of your u-boot?
U-boot environment on my board has been over-written, I would like to
set it same as yours and try to reproduce the issue at my end. With only
'sound init', I don't seem to hit this issue anymore.

>> Also can you please confirm that setting CLK_IGNORE_UNUSED flag
>> CLK_MAU_EPLL alone fixes the issue, without any need for
>> clk_ignore_unused in u-boot bootargs?
> 
> Yes, I have this patch[1] in my local branch which fixes the issue
> alone, without clk_ignore_unused on the command line.
> 
> Kevin
> 
> 
> [1]
> From ab1627127730ef4507ce96cbf95047d626bbb53f Mon Sep 17 00:00:00 2001
> From: Kevin Hilman 
> Date: Thu, 5 Jun 2014 17:12:28 -0700
> Subject: [PATCH] KJH: leave mau_epll enabled
> 
> ---
>  drivers/clk/samsung/clk-exynos5420.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos5420.c 
> b/drivers/clk/samsung/clk-exynos5420.c
> index 61eccf0dd72f..ed175088ee7e 100644
> --- a/drivers/clk/samsung/clk-exynos5420.c
> +++ b/drivers/clk/samsung/clk-exynos5420.c
> @@ -911,7 +911,7 @@ static struct samsung_gate_clock exynos5x_gate_clks[] 
> __initdata = {
>   SRC_MASK_TOP2, 24, 0, 0),
>  
>   GATE(CLK_MAU_EPLL, "mau_epll", "mout_mau_epll_clk",
> - SRC_MASK_TOP7, 20, 0, 0),
> + SRC_MASK_TOP7, 20, CLK_IGNORE_UNUSED, 0),
>  
>   /* sclk */
>   GATE(CLK_SCLK_UART0, "sclk_uart0", "dout_uart0",
> 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 2/2] serial: amba-pl010: Use devres APIs

2014-06-26 Thread Tushar Behera
Migrating to use devres managed APIs devm_kzalloc, devm_ioremap and
devm_clk_get.

Signed-off-by: Tushar Behera 
Reviewed-by: Daniel Thompson 
---
Changes for V2:
* Added Reviewed-by tag
* Removed redundant asm/io.h

 drivers/tty/serial/amba-pl010.c |   48 +--
 1 file changed, 16 insertions(+), 32 deletions(-)

diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index 971af1e..2064d31 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -46,8 +46,7 @@
 #include 
 #include 
 #include 
-
-#include 
+#include 
 
 #define UART_NR8
 
@@ -688,28 +687,22 @@ static int pl010_probe(struct amba_device *dev, const 
struct amba_id *id)
if (amba_ports[i] == NULL)
break;
 
-   if (i == ARRAY_SIZE(amba_ports)) {
-   ret = -EBUSY;
-   goto out;
-   }
+   if (i == ARRAY_SIZE(amba_ports))
+   return -EBUSY;
 
-   uap = kzalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
-   if (!uap) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   uap = devm_kzalloc(>dev, sizeof(struct uart_amba_port),
+  GFP_KERNEL);
+   if (!uap)
+   return -ENOMEM;
 
-   base = ioremap(dev->res.start, resource_size(>res));
-   if (!base) {
-   ret = -ENOMEM;
-   goto free;
-   }
+   base = devm_ioremap(>dev, dev->res.start,
+   resource_size(>res));
+   if (!base)
+   return -ENOMEM;
 
-   uap->clk = clk_get(>dev, NULL);
-   if (IS_ERR(uap->clk)) {
-   ret = PTR_ERR(uap->clk);
-   goto unmap;
-   }
+   uap->clk = devm_clk_get(>dev, NULL);
+   if (IS_ERR(uap->clk))
+   return PTR_ERR(uap->clk);
 
uap->port.dev = >dev;
uap->port.mapbase = dev->res.start;
@@ -727,15 +720,9 @@ static int pl010_probe(struct amba_device *dev, const 
struct amba_id *id)
 
amba_set_drvdata(dev, uap);
ret = uart_add_one_port(_reg, >port);
-   if (ret) {
+   if (ret)
amba_ports[i] = NULL;
-   clk_put(uap->clk);
- unmap:
-   iounmap(base);
- free:
-   kfree(uap);
-   }
- out:
+
return ret;
 }
 
@@ -750,9 +737,6 @@ static int pl010_remove(struct amba_device *dev)
if (amba_ports[i] == uap)
amba_ports[i] = NULL;
 
-   iounmap(uap->port.membase);
-   clk_put(uap->clk);
-   kfree(uap);
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 1/2] serial: amba-pl011: Remove redundant label

2014-06-26 Thread Tushar Behera
The label 'out' is only used to return the error code. We can return the
error code directly and remove 'out' label.

Signed-off-by: Tushar Behera 
Reviewed-by: Daniel Thompson 
---
Changes for V2:
* Added Reviewed-by tag

 drivers/tty/serial/amba-pl011.c |   30 ++
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 0e26dcb..8572f2a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1484,7 +1484,7 @@ static int pl011_hwinit(struct uart_port *port)
 */
retval = clk_prepare_enable(uap->clk);
if (retval)
-   goto out;
+   return retval;
 
uap->port.uartclk = clk_get_rate(uap->clk);
 
@@ -1507,8 +1507,6 @@ static int pl011_hwinit(struct uart_port *port)
plat->init();
}
return 0;
- out:
-   return retval;
 }
 
 static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h)
@@ -2131,32 +2129,24 @@ static int pl011_probe(struct amba_device *dev, const 
struct amba_id *id)
if (amba_ports[i] == NULL)
break;
 
-   if (i == ARRAY_SIZE(amba_ports)) {
-   ret = -EBUSY;
-   goto out;
-   }
+   if (i == ARRAY_SIZE(amba_ports))
+   return -EBUSY;
 
uap = devm_kzalloc(>dev, sizeof(struct uart_amba_port),
   GFP_KERNEL);
-   if (uap == NULL) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (uap == NULL)
+   return -ENOMEM;
 
i = pl011_probe_dt_alias(i, >dev);
 
base = devm_ioremap(>dev, dev->res.start,
resource_size(>res));
-   if (!base) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (!base)
+   return -ENOMEM;
 
uap->clk = devm_clk_get(>dev, NULL);
-   if (IS_ERR(uap->clk)) {
-   ret = PTR_ERR(uap->clk);
-   goto out;
-   }
+   if (IS_ERR(uap->clk))
+   return PTR_ERR(uap->clk);
 
uap->vendor = vendor;
uap->lcrh_rx = vendor->lcrh_rx;
@@ -2198,7 +2188,7 @@ static int pl011_probe(struct amba_device *dev, const 
struct amba_id *id)
uart_unregister_driver(_reg);
pl011_dma_remove(uap);
}
- out:
+
return ret;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] serial: amba-pl01x: Clean up patches

2014-06-26 Thread Tushar Behera
The patches are based next-20140626 and they have only been build
tested.

Tushar Behera (2):
  serial: amba-pl011: Remove redundant label
  serial: amba-pl010: Use devres APIs

 drivers/tty/serial/amba-pl010.c |   48 +--
 drivers/tty/serial/amba-pl011.c |   30 
 2 files changed, 26 insertions(+), 52 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] serial: amba-pl010: Use devres APIs

2014-06-26 Thread Tushar Behera
On 06/23/2014 06:16 PM, Daniel Thompson wrote:
> On 23/06/14 06:59, Tushar Behera wrote:
>> Migrating to use devres managed APIs devm_kzalloc, devm_ioremap and
>> devm_clk_get.
>>
>> Signed-off-by: Tushar Behera 
>> ---
>>  drivers/tty/serial/amba-pl010.c |   46 
>> ++-
>>  1 file changed, 16 insertions(+), 30 deletions(-)
>>
>> diff --git a/drivers/tty/serial/amba-pl010.c 
>> b/drivers/tty/serial/amba-pl010.c
>> index 971af1e..af8deba 100644
>> --- a/drivers/tty/serial/amba-pl010.c
>> +++ b/drivers/tty/serial/amba-pl010.c
>> @@ -46,6 +46,7 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>  
>>  #include 
> 
> Adding  makes including  redundant.
> 

Okay, I will remove the  in next iteration.

> 
>> @@ -688,28 +689,22 @@ static int pl010_probe(struct amba_device *dev, const 
>> struct amba_id *id)
>>  if (amba_ports[i] == NULL)
>>  break;
>>  
>> -if (i == ARRAY_SIZE(amba_ports)) {
>> -ret = -EBUSY;
>> -goto out;
>> -}
>> +if (i == ARRAY_SIZE(amba_ports))
>> +return -EBUSY;
>>  
>> -uap = kzalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
>> -if (!uap) {
>> -ret = -ENOMEM;
>> -goto out;
>> -}
>> +uap = devm_kzalloc(>dev, sizeof(struct uart_amba_port),
>> +   GFP_KERNEL);
>> +if (!uap)
>> +return -ENOMEM;
>>  
>> -base = ioremap(dev->res.start, resource_size(>res));
>> -if (!base) {
>> -ret = -ENOMEM;
>> -goto free;
>> -}
>> +base = devm_ioremap(>dev, dev->res.start,
>> +resource_size(>res));
>> +if (!base)
>> +return -ENOMEM;
>>  
>> -uap->clk = clk_get(>dev, NULL);
>> -if (IS_ERR(uap->clk)) {
>> -ret = PTR_ERR(uap->clk);
>> -goto unmap;
>> -}
>> +uap->clk = devm_clk_get(>dev, NULL);
>> +if (IS_ERR(uap->clk))
>> +return PTR_ERR(uap->clk);
>>  
>>  uap->port.dev = >dev;
>>  uap->port.mapbase = dev->res.start;
>> @@ -727,15 +722,9 @@ static int pl010_probe(struct amba_device *dev, const 
>> struct amba_id *id)
>>  
>>  amba_set_drvdata(dev, uap);
>>  ret = uart_add_one_port(_reg, >port);
>> -if (ret) {
>> +if (ret)
>>  amba_ports[i] = NULL;
>> -        clk_put(uap->clk);
>> - unmap:
>> -iounmap(base);
>> - free:
>> -kfree(uap);
>> -}
>> - out:
>> +
>>  return ret;
>>  }
>>  
>> @@ -750,9 +739,6 @@ static int pl010_remove(struct amba_device *dev)
>>  if (amba_ports[i] == uap)
>>  amba_ports[i] = NULL;
>>  
>> -iounmap(uap->port.membase);
>> -clk_put(uap->clk);
>> -kfree(uap);
>>  return 0;
>>  }
> 
> Reviewed-by: Daniel Thompson 
> 

Thanks for reviewing.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] serial: amba-pl010: Use devres APIs

2014-06-26 Thread Tushar Behera
On 06/23/2014 06:16 PM, Daniel Thompson wrote:
 On 23/06/14 06:59, Tushar Behera wrote:
 Migrating to use devres managed APIs devm_kzalloc, devm_ioremap and
 devm_clk_get.

 Signed-off-by: Tushar Behera tusha...@samsung.com
 ---
  drivers/tty/serial/amba-pl010.c |   46 
 ++-
  1 file changed, 16 insertions(+), 30 deletions(-)

 diff --git a/drivers/tty/serial/amba-pl010.c 
 b/drivers/tty/serial/amba-pl010.c
 index 971af1e..af8deba 100644
 --- a/drivers/tty/serial/amba-pl010.c
 +++ b/drivers/tty/serial/amba-pl010.c
 @@ -46,6 +46,7 @@
  #include linux/amba/serial.h
  #include linux/clk.h
  #include linux/slab.h
 +#include linux/io.h
  
  #include asm/io.h
 
 Adding linux/io.h makes including asm/io.h redundant.
 

Okay, I will remove the asm/io.h in next iteration.

 
 @@ -688,28 +689,22 @@ static int pl010_probe(struct amba_device *dev, const 
 struct amba_id *id)
  if (amba_ports[i] == NULL)
  break;
  
 -if (i == ARRAY_SIZE(amba_ports)) {
 -ret = -EBUSY;
 -goto out;
 -}
 +if (i == ARRAY_SIZE(amba_ports))
 +return -EBUSY;
  
 -uap = kzalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
 -if (!uap) {
 -ret = -ENOMEM;
 -goto out;
 -}
 +uap = devm_kzalloc(dev-dev, sizeof(struct uart_amba_port),
 +   GFP_KERNEL);
 +if (!uap)
 +return -ENOMEM;
  
 -base = ioremap(dev-res.start, resource_size(dev-res));
 -if (!base) {
 -ret = -ENOMEM;
 -goto free;
 -}
 +base = devm_ioremap(dev-dev, dev-res.start,
 +resource_size(dev-res));
 +if (!base)
 +return -ENOMEM;
  
 -uap-clk = clk_get(dev-dev, NULL);
 -if (IS_ERR(uap-clk)) {
 -ret = PTR_ERR(uap-clk);
 -goto unmap;
 -}
 +uap-clk = devm_clk_get(dev-dev, NULL);
 +if (IS_ERR(uap-clk))
 +return PTR_ERR(uap-clk);
  
  uap-port.dev = dev-dev;
  uap-port.mapbase = dev-res.start;
 @@ -727,15 +722,9 @@ static int pl010_probe(struct amba_device *dev, const 
 struct amba_id *id)
  
  amba_set_drvdata(dev, uap);
  ret = uart_add_one_port(amba_reg, uap-port);
 -if (ret) {
 +if (ret)
  amba_ports[i] = NULL;
 -clk_put(uap-clk);
 - unmap:
 -iounmap(base);
 - free:
 -kfree(uap);
 -}
 - out:
 +
  return ret;
  }
  
 @@ -750,9 +739,6 @@ static int pl010_remove(struct amba_device *dev)
  if (amba_ports[i] == uap)
  amba_ports[i] = NULL;
  
 -iounmap(uap-port.membase);
 -clk_put(uap-clk);
 -kfree(uap);
  return 0;
  }
 
 Reviewed-by: Daniel Thompson daniel.thomp...@linaro.org
 

Thanks for reviewing.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] serial: amba-pl01x: Clean up patches

2014-06-26 Thread Tushar Behera
The patches are based next-20140626 and they have only been build
tested.

Tushar Behera (2):
  serial: amba-pl011: Remove redundant label
  serial: amba-pl010: Use devres APIs

 drivers/tty/serial/amba-pl010.c |   48 +--
 drivers/tty/serial/amba-pl011.c |   30 
 2 files changed, 26 insertions(+), 52 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 1/2] serial: amba-pl011: Remove redundant label

2014-06-26 Thread Tushar Behera
The label 'out' is only used to return the error code. We can return the
error code directly and remove 'out' label.

Signed-off-by: Tushar Behera tusha...@samsung.com
Reviewed-by: Daniel Thompson daniel.thomp...@linaro.org
---
Changes for V2:
* Added Reviewed-by tag

 drivers/tty/serial/amba-pl011.c |   30 ++
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 0e26dcb..8572f2a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1484,7 +1484,7 @@ static int pl011_hwinit(struct uart_port *port)
 */
retval = clk_prepare_enable(uap-clk);
if (retval)
-   goto out;
+   return retval;
 
uap-port.uartclk = clk_get_rate(uap-clk);
 
@@ -1507,8 +1507,6 @@ static int pl011_hwinit(struct uart_port *port)
plat-init();
}
return 0;
- out:
-   return retval;
 }
 
 static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h)
@@ -2131,32 +2129,24 @@ static int pl011_probe(struct amba_device *dev, const 
struct amba_id *id)
if (amba_ports[i] == NULL)
break;
 
-   if (i == ARRAY_SIZE(amba_ports)) {
-   ret = -EBUSY;
-   goto out;
-   }
+   if (i == ARRAY_SIZE(amba_ports))
+   return -EBUSY;
 
uap = devm_kzalloc(dev-dev, sizeof(struct uart_amba_port),
   GFP_KERNEL);
-   if (uap == NULL) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (uap == NULL)
+   return -ENOMEM;
 
i = pl011_probe_dt_alias(i, dev-dev);
 
base = devm_ioremap(dev-dev, dev-res.start,
resource_size(dev-res));
-   if (!base) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (!base)
+   return -ENOMEM;
 
uap-clk = devm_clk_get(dev-dev, NULL);
-   if (IS_ERR(uap-clk)) {
-   ret = PTR_ERR(uap-clk);
-   goto out;
-   }
+   if (IS_ERR(uap-clk))
+   return PTR_ERR(uap-clk);
 
uap-vendor = vendor;
uap-lcrh_rx = vendor-lcrh_rx;
@@ -2198,7 +2188,7 @@ static int pl011_probe(struct amba_device *dev, const 
struct amba_id *id)
uart_unregister_driver(amba_reg);
pl011_dma_remove(uap);
}
- out:
+
return ret;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2 2/2] serial: amba-pl010: Use devres APIs

2014-06-26 Thread Tushar Behera
Migrating to use devres managed APIs devm_kzalloc, devm_ioremap and
devm_clk_get.

Signed-off-by: Tushar Behera tusha...@samsung.com
Reviewed-by: Daniel Thompson daniel.thomp...@linaro.org
---
Changes for V2:
* Added Reviewed-by tag
* Removed redundant asm/io.h

 drivers/tty/serial/amba-pl010.c |   48 +--
 1 file changed, 16 insertions(+), 32 deletions(-)

diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index 971af1e..2064d31 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -46,8 +46,7 @@
 #include linux/amba/serial.h
 #include linux/clk.h
 #include linux/slab.h
-
-#include asm/io.h
+#include linux/io.h
 
 #define UART_NR8
 
@@ -688,28 +687,22 @@ static int pl010_probe(struct amba_device *dev, const 
struct amba_id *id)
if (amba_ports[i] == NULL)
break;
 
-   if (i == ARRAY_SIZE(amba_ports)) {
-   ret = -EBUSY;
-   goto out;
-   }
+   if (i == ARRAY_SIZE(amba_ports))
+   return -EBUSY;
 
-   uap = kzalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
-   if (!uap) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   uap = devm_kzalloc(dev-dev, sizeof(struct uart_amba_port),
+  GFP_KERNEL);
+   if (!uap)
+   return -ENOMEM;
 
-   base = ioremap(dev-res.start, resource_size(dev-res));
-   if (!base) {
-   ret = -ENOMEM;
-   goto free;
-   }
+   base = devm_ioremap(dev-dev, dev-res.start,
+   resource_size(dev-res));
+   if (!base)
+   return -ENOMEM;
 
-   uap-clk = clk_get(dev-dev, NULL);
-   if (IS_ERR(uap-clk)) {
-   ret = PTR_ERR(uap-clk);
-   goto unmap;
-   }
+   uap-clk = devm_clk_get(dev-dev, NULL);
+   if (IS_ERR(uap-clk))
+   return PTR_ERR(uap-clk);
 
uap-port.dev = dev-dev;
uap-port.mapbase = dev-res.start;
@@ -727,15 +720,9 @@ static int pl010_probe(struct amba_device *dev, const 
struct amba_id *id)
 
amba_set_drvdata(dev, uap);
ret = uart_add_one_port(amba_reg, uap-port);
-   if (ret) {
+   if (ret)
amba_ports[i] = NULL;
-   clk_put(uap-clk);
- unmap:
-   iounmap(base);
- free:
-   kfree(uap);
-   }
- out:
+
return ret;
 }
 
@@ -750,9 +737,6 @@ static int pl010_remove(struct amba_device *dev)
if (amba_ports[i] == uap)
amba_ports[i] = NULL;
 
-   iounmap(uap-port.membase);
-   clk_put(uap-clk);
-   kfree(uap);
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-06-26 Thread Tushar Behera
On 06/26/2014 09:38 PM, Kevin Hilman wrote:
 Tushar Behera trbli...@gmail.com writes:
 
 On Thu, Jun 26, 2014 at 4:51 AM, Kevin Hilman khil...@linaro.org wrote:
 Doug Anderson diand...@google.com writes:

 Tushar,

 On Tue, Jun 10, 2014 at 10:32 PM, Tushar Behera tusha...@samsung.com 
 wrote:
 Currently CLK_FOUT_EPLL was set as one of the parents of AUDSS mux.
 As per the user manual, it should be CLK_MAU_EPLL.

 The problem surfaced when the bootloader in Peach-pit board set
 the EPLL clock as the parent of AUDSS mux. While booting the kernel,
 we used to get a system hang during late boot if CLK_MAU_EPLL was
 disabled.

 Signed-off-by: Tushar Behera tusha...@samsung.com
 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 Reported-by: Kevin Hilman khil...@linaro.org
 ---
  arch/arm/boot/dts/exynos5420.dtsi |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 I've tested this myself now as well.

 Tested-by: Doug Anderson diand...@chromium.org

 For me, this patch alone (on top of -next) doesn't solve the boot hang.
 I still need clk_ignore_unused for a successful boot.

 So, this patch might be correct, but it doesn't prevent a boot hang
 using a chain-loaded nv_uboot on peach-pi.  There's still another clock
 being disabled that causes a hang.

 Kevin

 Kevin,

 Can you please check if adding patch 1/3 alongwith patch 2/3 fixes the
 issue for you?
 
 Yes, using patch 1/3 along with 2/3 fixes the issue.
 

Okay, that adds some more reason to re-investigate patch 1/3.

Kevin,

Would you please provide me the environment setting of your u-boot?
U-boot environment on my board has been over-written, I would like to
set it same as yours and try to reproduce the issue at my end. With only
'sound init', I don't seem to hit this issue anymore.

 Also can you please confirm that setting CLK_IGNORE_UNUSED flag
 CLK_MAU_EPLL alone fixes the issue, without any need for
 clk_ignore_unused in u-boot bootargs?
 
 Yes, I have this patch[1] in my local branch which fixes the issue
 alone, without clk_ignore_unused on the command line.
 
 Kevin
 
 
 [1]
 From ab1627127730ef4507ce96cbf95047d626bbb53f Mon Sep 17 00:00:00 2001
 From: Kevin Hilman khil...@linaro.org
 Date: Thu, 5 Jun 2014 17:12:28 -0700
 Subject: [PATCH] KJH: leave mau_epll enabled
 
 ---
  drivers/clk/samsung/clk-exynos5420.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/drivers/clk/samsung/clk-exynos5420.c 
 b/drivers/clk/samsung/clk-exynos5420.c
 index 61eccf0dd72f..ed175088ee7e 100644
 --- a/drivers/clk/samsung/clk-exynos5420.c
 +++ b/drivers/clk/samsung/clk-exynos5420.c
 @@ -911,7 +911,7 @@ static struct samsung_gate_clock exynos5x_gate_clks[] 
 __initdata = {
   SRC_MASK_TOP2, 24, 0, 0),
  
   GATE(CLK_MAU_EPLL, mau_epll, mout_mau_epll_clk,
 - SRC_MASK_TOP7, 20, 0, 0),
 + SRC_MASK_TOP7, 20, CLK_IGNORE_UNUSED, 0),
  
   /* sclk */
   GATE(CLK_SCLK_UART0, sclk_uart0, dout_uart0,
 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-06-25 Thread Tushar Behera
On Thu, Jun 26, 2014 at 4:51 AM, Kevin Hilman  wrote:
> Doug Anderson  writes:
>
>> Tushar,
>>
>> On Tue, Jun 10, 2014 at 10:32 PM, Tushar Behera  wrote:
>>> Currently CLK_FOUT_EPLL was set as one of the parents of AUDSS mux.
>>> As per the user manual, it should be CLK_MAU_EPLL.
>>>
>>> The problem surfaced when the bootloader in Peach-pit board set
>>> the EPLL clock as the parent of AUDSS mux. While booting the kernel,
>>> we used to get a system hang during late boot if CLK_MAU_EPLL was
>>> disabled.
>>>
>>> Signed-off-by: Tushar Behera 
>>> Signed-off-by: Shaik Ameer Basha 
>>> Reported-by: Kevin Hilman 
>>> ---
>>>  arch/arm/boot/dts/exynos5420.dtsi |2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> I've tested this myself now as well.
>>
>> Tested-by: Doug Anderson 
>
> For me, this patch alone (on top of -next) doesn't solve the boot hang.
> I still need clk_ignore_unused for a successful boot.
>
> So, this patch might be correct, but it doesn't prevent a boot hang
> using a chain-loaded nv_uboot on peach-pi.  There's still another clock
> being disabled that causes a hang.
>
> Kevin

Kevin,

Can you please check if adding patch 1/3 alongwith patch 2/3 fixes the
issue for you?

Also can you please confirm that setting CLK_IGNORE_UNUSED flag
CLK_MAU_EPLL alone fixes the issue, without any need for
clk_ignore_unused in u-boot bootargs?

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-06-25 Thread Tushar Behera
On Thu, Jun 26, 2014 at 4:51 AM, Kevin Hilman khil...@linaro.org wrote:
 Doug Anderson diand...@google.com writes:

 Tushar,

 On Tue, Jun 10, 2014 at 10:32 PM, Tushar Behera tusha...@samsung.com wrote:
 Currently CLK_FOUT_EPLL was set as one of the parents of AUDSS mux.
 As per the user manual, it should be CLK_MAU_EPLL.

 The problem surfaced when the bootloader in Peach-pit board set
 the EPLL clock as the parent of AUDSS mux. While booting the kernel,
 we used to get a system hang during late boot if CLK_MAU_EPLL was
 disabled.

 Signed-off-by: Tushar Behera tusha...@samsung.com
 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 Reported-by: Kevin Hilman khil...@linaro.org
 ---
  arch/arm/boot/dts/exynos5420.dtsi |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 I've tested this myself now as well.

 Tested-by: Doug Anderson diand...@chromium.org

 For me, this patch alone (on top of -next) doesn't solve the boot hang.
 I still need clk_ignore_unused for a successful boot.

 So, this patch might be correct, but it doesn't prevent a boot hang
 using a chain-loaded nv_uboot on peach-pi.  There's still another clock
 being disabled that causes a hang.

 Kevin

Kevin,

Can you please check if adding patch 1/3 alongwith patch 2/3 fixes the
issue for you?

Also can you please confirm that setting CLK_IGNORE_UNUSED flag
CLK_MAU_EPLL alone fixes the issue, without any need for
clk_ignore_unused in u-boot bootargs?

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-06-24 Thread Tushar Behera
On 06/25/2014 04:29 AM, Doug Anderson wrote:
> Tushar,
> 
> On Thu, Jun 12, 2014 at 12:40 AM, Tushar Behera  wrote:
>> On Wed, Jun 11, 2014 at 10:20 PM, Kevin Hilman  wrote:
>>> Tushar Behera  writes:
>>>
>>>> When the output clock of AUDSS mux is disabled, we are getting kernel
>>>> oops while doing a clk_get() on other clocks provided by AUDSS.
>>>>
>>>> Though user manual doesn't specify this dependency, we came across
>>>> this issue while disabling the parent of AUDSS mux clocks.
>>>>
>>>> Keeping the parents of AUDSS mux always enabled fixes this issue.
>>>
>>> While this patch works (and fixes the boot problem for me), it seems
>>> like it's papering over the real problem.
>>>
>>
>> Thanks for testing.
>>
>>> Seems like the right fix is actually modelling the clocks properly so
>>> that enabling a child clock ensures that the parent is also enabled.
>>>
>>
>> Patch 2/3 was to ensure we have proper clock tree defined for
>> Exynos5420. While testing with audio disabled, that patch alone fixed
>> the issue. But when audio was enabled (and hence I2S0 was trying to
>> access the clocks), we got some kernel oops during late booting, hence
>> I came up this solution.
>>
>> The solution might be a little half-baked because of the urgency to
>> push the fix, but will try to dig more into the issue on Monday when I
>> resume office.
> 
> Which Monday were you referring to?  ;)
> 

Sorry that I couldn't get deeper into this issue. Thanks for reminding
though.

> ...but in all seriousness do you have an official status update on
> this patch?  It seems as if it's not needed and all you need is
> <https://patchwork.kernel.org/patch/4333581/>, but it would be nice to
> get an official confirmation.

I have tested various scenarios with only patch 2/3, which seems to be
sufficient for the time being. I have not encountered the older issue
till now. I was thinking of testing a bit further, but given that you
have already asked for, we can go ahead with only patch 2/3 right now.

In case any further issue comes up, I will post patch 1/3 as per the
review comments that I have got.

> 
> Thanks!
> 
> -Doug
> --
> 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
> 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] ARM: dts: Add cros_ec to exynos5420-peach-pit and exynos5800-peach-pi

2014-06-24 Thread Tushar Behera
On 06/24/2014 02:19 AM, Doug Anderson wrote:
> This adds cros_ec to exynos5420-peach-pit and exynos5800-peach-pi,
> including:
> * The keyboard
> * The i2c tunnel
> * The tps65090 under the i2c tunnel
> * The battery under the i2c tunnel
> 
> To add extra motivation, it should be noted that tps65090 is one of
> the things needed to get display-related FETs turned on for pit and
> pi.
> 
> Note that this relies on a few outstanding changes:
> * Needs (spi: s3c64xx: fix broken "cs_gpios" usage in the driver) and
>   (spi: s3c64xx: for DT platofrms always get the chipselect info from
>   DT node) to work properly and match the documented bindings.  See
>   <https://patchwork.kernel.org/patch/4346701/> and
>   <https://patchwork.kernel.org/patch/4346711/>
> 
> Signed-off-by: Doug Anderson 
> Tested-by: Javier Martinez Canillas 

Along with the dependency patches on next-20140623, tested keyboard on
Peach-Pi board.

Tested-by: Tushar Behera 

Some comments below.

> ---
> Changes in v2:
> - Now just one patch since mfd patch landed.
> - Rebased to ToT linux-next
> 
>  arch/arm/boot/dts/exynos5420-peach-pit.dts | 145 
> +
>  arch/arm/boot/dts/exynos5800-peach-pi.dts  | 145 
> +
>  2 files changed, 290 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts 
> b/arch/arm/boot/dts/exynos5420-peach-pit.dts
> index 7649982..581f385 100644
> --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
> +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts

> + regulators {
> + dcdc1 {
> + ti,enable-ext-control;
> + };
> + dcdc2 {
> + ti,enable-ext-control;
> + };
> + dcdc3 {
> + ti,enable-ext-control;
> + };
> + fet1 {

"tps65090_fet1: fet1 {" ?

> + regulator-name = "vcd_led";
> + };
> + tps65090_fet2: fet2 {

I would suggest we add similar labels to fet1, fet3, fet4, fet5 and fet6
also. That way it would be easy to reference them in subsequent DT nodes.

Same comment for Peach-Pi dts file too.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] ARM: dts: Add cros_ec to exynos5420-peach-pit and exynos5800-peach-pi

2014-06-24 Thread Tushar Behera
On 06/24/2014 02:19 AM, Doug Anderson wrote:
 This adds cros_ec to exynos5420-peach-pit and exynos5800-peach-pi,
 including:
 * The keyboard
 * The i2c tunnel
 * The tps65090 under the i2c tunnel
 * The battery under the i2c tunnel
 
 To add extra motivation, it should be noted that tps65090 is one of
 the things needed to get display-related FETs turned on for pit and
 pi.
 
 Note that this relies on a few outstanding changes:
 * Needs (spi: s3c64xx: fix broken cs_gpios usage in the driver) and
   (spi: s3c64xx: for DT platofrms always get the chipselect info from
   DT node) to work properly and match the documented bindings.  See
   https://patchwork.kernel.org/patch/4346701/ and
   https://patchwork.kernel.org/patch/4346711/
 
 Signed-off-by: Doug Anderson diand...@chromium.org
 Tested-by: Javier Martinez Canillas javier.marti...@collabora.co.uk

Along with the dependency patches on next-20140623, tested keyboard on
Peach-Pi board.

Tested-by: Tushar Behera tusha...@samsung.com

Some comments below.

 ---
 Changes in v2:
 - Now just one patch since mfd patch landed.
 - Rebased to ToT linux-next
 
  arch/arm/boot/dts/exynos5420-peach-pit.dts | 145 
 +
  arch/arm/boot/dts/exynos5800-peach-pi.dts  | 145 
 +
  2 files changed, 290 insertions(+)
 
 diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts 
 b/arch/arm/boot/dts/exynos5420-peach-pit.dts
 index 7649982..581f385 100644
 --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
 +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts

 + regulators {
 + dcdc1 {
 + ti,enable-ext-control;
 + };
 + dcdc2 {
 + ti,enable-ext-control;
 + };
 + dcdc3 {
 + ti,enable-ext-control;
 + };
 + fet1 {

tps65090_fet1: fet1 { ?

 + regulator-name = vcd_led;
 + };
 + tps65090_fet2: fet2 {

I would suggest we add similar labels to fet1, fet3, fet4, fet5 and fet6
also. That way it would be easy to reference them in subsequent DT nodes.

Same comment for Peach-Pi dts file too.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-06-24 Thread Tushar Behera
On 06/25/2014 04:29 AM, Doug Anderson wrote:
 Tushar,
 
 On Thu, Jun 12, 2014 at 12:40 AM, Tushar Behera tusha...@samsung.com wrote:
 On Wed, Jun 11, 2014 at 10:20 PM, Kevin Hilman khil...@linaro.org wrote:
 Tushar Behera tusha...@samsung.com writes:

 When the output clock of AUDSS mux is disabled, we are getting kernel
 oops while doing a clk_get() on other clocks provided by AUDSS.

 Though user manual doesn't specify this dependency, we came across
 this issue while disabling the parent of AUDSS mux clocks.

 Keeping the parents of AUDSS mux always enabled fixes this issue.

 While this patch works (and fixes the boot problem for me), it seems
 like it's papering over the real problem.


 Thanks for testing.

 Seems like the right fix is actually modelling the clocks properly so
 that enabling a child clock ensures that the parent is also enabled.


 Patch 2/3 was to ensure we have proper clock tree defined for
 Exynos5420. While testing with audio disabled, that patch alone fixed
 the issue. But when audio was enabled (and hence I2S0 was trying to
 access the clocks), we got some kernel oops during late booting, hence
 I came up this solution.

 The solution might be a little half-baked because of the urgency to
 push the fix, but will try to dig more into the issue on Monday when I
 resume office.
 
 Which Monday were you referring to?  ;)
 

Sorry that I couldn't get deeper into this issue. Thanks for reminding
though.

 ...but in all seriousness do you have an official status update on
 this patch?  It seems as if it's not needed and all you need is
 https://patchwork.kernel.org/patch/4333581/, but it would be nice to
 get an official confirmation.

I have tested various scenarios with only patch 2/3, which seems to be
sufficient for the time being. I have not encountered the older issue
till now. I was thinking of testing a bit further, but given that you
have already asked for, we can go ahead with only patch 2/3 right now.

In case any further issue comes up, I will post patch 1/3 as per the
review comments that I have got.

 
 Thanks!
 
 -Doug
 --
 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
 


-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] ASoC: max98090: Add max98091 compatible string

2014-06-23 Thread Tushar Behera
On 06/21/2014 02:02 AM, Doug Anderson wrote:
> Tushar,
> 
> On Fri, Jun 20, 2014 at 1:03 AM, Tushar Behera  wrote:
>> From: Wonjoon Lee 
>>
>> The MAX98091 CODEC is the same as MAX98090 CODEC, but with an extra
>> microphone. Existing driver for MAX98090 CODEC already has support
>> for MAX98091 CODEC. Adding proper compatible string so that MAX98091
>> CODEC can be specified from device tree.
>>
>> Signed-off-by: Wonjoon Lee 
>> Signed-off-by: Doug Anderson 
>> Signed-off-by: Tushar Behera 
>> ---
>>
>> Picked from https://chromium-review.googlesource.com/#/c/184091/
>>
>>  .../devicetree/bindings/sound/max98090.txt |2 +-
>>  sound/soc/codecs/max98090.c|2 ++
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/sound/max98090.txt 
>> b/Documentation/devicetree/bindings/sound/max98090.txt
>> index a5e63fa..c454e67 100644
>> --- a/Documentation/devicetree/bindings/sound/max98090.txt
>> +++ b/Documentation/devicetree/bindings/sound/max98090.txt
>> @@ -4,7 +4,7 @@ This device supports I2C only.
>>
>>  Required properties:
>>
>> -- compatible : "maxim,max98090".
>> +- compatible : "maxim,max98090" or "maxim,max98091".
>>
>>  - reg : The I2C address of the device.
>>
>> diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
>> index f5fccc7..4f5534d 100644
>> --- a/sound/soc/codecs/max98090.c
>> +++ b/sound/soc/codecs/max98090.c
>> @@ -2460,12 +2460,14 @@ static const struct dev_pm_ops max98090_pm = {
>>
>>  static const struct i2c_device_id max98090_i2c_id[] = {
>> { "max98090", MAX98090 },
>> +   { "max98091", MAX98091 },
> 
> optional: This would allow you to add some extra error checking in
> max98090_probe() to make sure that the device-tree specified device
> matched the device that was detected.  That could be in a future
> patch, though.
> 
> Reviewed-by: Doug Anderson 
> 

Okay. I will add that in a follow-up patch.

Thanks for reviewing.
-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] usb: misc: usb3503: Update error code in print message

2014-06-23 Thread Tushar Behera
On 06/17/2014 04:54 PM, Marek Szyprowski wrote:
> Hello,
> 
> On 2014-06-17 13:08, Tushar Behera wrote:
>> 'err' is uninitialized, rather print the error code directly.
>>
>> This also fixes following warning.
>> drivers/usb/misc/usb3503.c: In function ‘usb3503_probe’:
>> drivers/usb/misc/usb3503.c:195:11: warning: ‘err’ may be used
>> uninitialized
>> in this function [-Wmaybe-uninitialized]
>>  dev_err(dev, "unable to request refclk (%d)\n", err);
>>
>> Signed-off-by: Tushar Behera 
> 
> Acked-by: Marek Szyprowski 
> 

Greg,

Would you please pick up this patch?

>> ---
>>
>> Based on next-20140616.
>>
>>   drivers/usb/misc/usb3503.c |3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
>> index f43c619..652855b 100644
>> --- a/drivers/usb/misc/usb3503.c
>> +++ b/drivers/usb/misc/usb3503.c
>> @@ -192,7 +192,8 @@ static int usb3503_probe(struct usb3503 *hub)
>> clk = devm_clk_get(dev, "refclk");
>>   if (IS_ERR(clk) && PTR_ERR(clk) != -ENOENT) {
>> -dev_err(dev, "unable to request refclk (%d)\n", err);
>> +dev_err(dev, "unable to request refclk (%ld)\n",
>> +PTR_ERR(clk));
>>   return PTR_ERR(clk);
>>   }
>>   
> 
> Best regards


-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] serial: samsung: Remove redundant label

2014-06-23 Thread Tushar Behera
probe_err label only returns the error code. This label can be removed
and the error code can be returned directly.

Signed-off-by: Tushar Behera 
---
 drivers/tty/serial/samsung.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c1d3ebd..bf93010 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1303,7 +1303,7 @@ static int s3c24xx_serial_probe(struct platform_device 
*pdev)
 
ret = s3c24xx_serial_init_port(ourport, pdev);
if (ret < 0)
-   goto probe_err;
+   return ret;
 
if (!s3c24xx_uart_drv.state) {
ret = uart_register_driver(_uart_drv);
@@ -1335,9 +1335,6 @@ static int s3c24xx_serial_probe(struct platform_device 
*pdev)
dev_err(>dev, "failed to add cpufreq notifier\n");
 
return 0;
-
- probe_err:
-   return ret;
 }
 
 static int s3c24xx_serial_remove(struct platform_device *dev)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] serial: amba-pl01x: Clean up patches

2014-06-23 Thread Tushar Behera
The patches are based next-20140620 and they have only been build
tested.

Tushar Behera (2):
  serial: amba-pl011: Simplify goto statements
  serial: amba-pl010: Use devres APIs

 drivers/tty/serial/amba-pl010.c |   46 ++-
 drivers/tty/serial/amba-pl011.c |   30 +
 2 files changed, 26 insertions(+), 50 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] serial: amba-pl010: Use devres APIs

2014-06-23 Thread Tushar Behera
Migrating to use devres managed APIs devm_kzalloc, devm_ioremap and
devm_clk_get.

Signed-off-by: Tushar Behera 
---
 drivers/tty/serial/amba-pl010.c |   46 ++-
 1 file changed, 16 insertions(+), 30 deletions(-)

diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index 971af1e..af8deba 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -688,28 +689,22 @@ static int pl010_probe(struct amba_device *dev, const 
struct amba_id *id)
if (amba_ports[i] == NULL)
break;
 
-   if (i == ARRAY_SIZE(amba_ports)) {
-   ret = -EBUSY;
-   goto out;
-   }
+   if (i == ARRAY_SIZE(amba_ports))
+   return -EBUSY;
 
-   uap = kzalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
-   if (!uap) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   uap = devm_kzalloc(>dev, sizeof(struct uart_amba_port),
+  GFP_KERNEL);
+   if (!uap)
+   return -ENOMEM;
 
-   base = ioremap(dev->res.start, resource_size(>res));
-   if (!base) {
-   ret = -ENOMEM;
-   goto free;
-   }
+   base = devm_ioremap(>dev, dev->res.start,
+   resource_size(>res));
+   if (!base)
+   return -ENOMEM;
 
-   uap->clk = clk_get(>dev, NULL);
-   if (IS_ERR(uap->clk)) {
-   ret = PTR_ERR(uap->clk);
-   goto unmap;
-   }
+   uap->clk = devm_clk_get(>dev, NULL);
+   if (IS_ERR(uap->clk))
+   return PTR_ERR(uap->clk);
 
uap->port.dev = >dev;
uap->port.mapbase = dev->res.start;
@@ -727,15 +722,9 @@ static int pl010_probe(struct amba_device *dev, const 
struct amba_id *id)
 
amba_set_drvdata(dev, uap);
ret = uart_add_one_port(_reg, >port);
-   if (ret) {
+   if (ret)
amba_ports[i] = NULL;
-   clk_put(uap->clk);
- unmap:
-   iounmap(base);
- free:
-   kfree(uap);
-   }
- out:
+
return ret;
 }
 
@@ -750,9 +739,6 @@ static int pl010_remove(struct amba_device *dev)
if (amba_ports[i] == uap)
amba_ports[i] = NULL;
 
-   iounmap(uap->port.membase);
-   clk_put(uap->clk);
-   kfree(uap);
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] serial: amba-pl011: Remove redundant label

2014-06-23 Thread Tushar Behera
The label 'out' is only used to return the error code. We can return the
error code directly and remove 'out' label.

Signed-off-by: Tushar Behera 
---
 drivers/tty/serial/amba-pl011.c |   30 ++
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 0e26dcb..8572f2a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1484,7 +1484,7 @@ static int pl011_hwinit(struct uart_port *port)
 */
retval = clk_prepare_enable(uap->clk);
if (retval)
-   goto out;
+   return retval;
 
uap->port.uartclk = clk_get_rate(uap->clk);
 
@@ -1507,8 +1507,6 @@ static int pl011_hwinit(struct uart_port *port)
plat->init();
}
return 0;
- out:
-   return retval;
 }
 
 static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h)
@@ -2131,32 +2129,24 @@ static int pl011_probe(struct amba_device *dev, const 
struct amba_id *id)
if (amba_ports[i] == NULL)
break;
 
-   if (i == ARRAY_SIZE(amba_ports)) {
-   ret = -EBUSY;
-   goto out;
-   }
+   if (i == ARRAY_SIZE(amba_ports))
+   return -EBUSY;
 
uap = devm_kzalloc(>dev, sizeof(struct uart_amba_port),
   GFP_KERNEL);
-   if (uap == NULL) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (uap == NULL)
+   return -ENOMEM;
 
i = pl011_probe_dt_alias(i, >dev);
 
base = devm_ioremap(>dev, dev->res.start,
resource_size(>res));
-   if (!base) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (!base)
+   return -ENOMEM;
 
uap->clk = devm_clk_get(>dev, NULL);
-   if (IS_ERR(uap->clk)) {
-   ret = PTR_ERR(uap->clk);
-   goto out;
-   }
+   if (IS_ERR(uap->clk))
+   return PTR_ERR(uap->clk);
 
uap->vendor = vendor;
uap->lcrh_rx = vendor->lcrh_rx;
@@ -2198,7 +2188,7 @@ static int pl011_probe(struct amba_device *dev, const 
struct amba_id *id)
uart_unregister_driver(_reg);
pl011_dma_remove(uap);
}
- out:
+
return ret;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/2] serial: amba-pl01x: Clean up patches

2014-06-23 Thread Tushar Behera
The patches are based next-20140620 and they have only been build
tested.

Tushar Behera (2):
  serial: amba-pl011: Simplify goto statements
  serial: amba-pl010: Use devres APIs

 drivers/tty/serial/amba-pl010.c |   46 ++-
 drivers/tty/serial/amba-pl011.c |   30 +
 2 files changed, 26 insertions(+), 50 deletions(-)

-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] serial: amba-pl010: Use devres APIs

2014-06-23 Thread Tushar Behera
Migrating to use devres managed APIs devm_kzalloc, devm_ioremap and
devm_clk_get.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 drivers/tty/serial/amba-pl010.c |   46 ++-
 1 file changed, 16 insertions(+), 30 deletions(-)

diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
index 971af1e..af8deba 100644
--- a/drivers/tty/serial/amba-pl010.c
+++ b/drivers/tty/serial/amba-pl010.c
@@ -46,6 +46,7 @@
 #include linux/amba/serial.h
 #include linux/clk.h
 #include linux/slab.h
+#include linux/io.h
 
 #include asm/io.h
 
@@ -688,28 +689,22 @@ static int pl010_probe(struct amba_device *dev, const 
struct amba_id *id)
if (amba_ports[i] == NULL)
break;
 
-   if (i == ARRAY_SIZE(amba_ports)) {
-   ret = -EBUSY;
-   goto out;
-   }
+   if (i == ARRAY_SIZE(amba_ports))
+   return -EBUSY;
 
-   uap = kzalloc(sizeof(struct uart_amba_port), GFP_KERNEL);
-   if (!uap) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   uap = devm_kzalloc(dev-dev, sizeof(struct uart_amba_port),
+  GFP_KERNEL);
+   if (!uap)
+   return -ENOMEM;
 
-   base = ioremap(dev-res.start, resource_size(dev-res));
-   if (!base) {
-   ret = -ENOMEM;
-   goto free;
-   }
+   base = devm_ioremap(dev-dev, dev-res.start,
+   resource_size(dev-res));
+   if (!base)
+   return -ENOMEM;
 
-   uap-clk = clk_get(dev-dev, NULL);
-   if (IS_ERR(uap-clk)) {
-   ret = PTR_ERR(uap-clk);
-   goto unmap;
-   }
+   uap-clk = devm_clk_get(dev-dev, NULL);
+   if (IS_ERR(uap-clk))
+   return PTR_ERR(uap-clk);
 
uap-port.dev = dev-dev;
uap-port.mapbase = dev-res.start;
@@ -727,15 +722,9 @@ static int pl010_probe(struct amba_device *dev, const 
struct amba_id *id)
 
amba_set_drvdata(dev, uap);
ret = uart_add_one_port(amba_reg, uap-port);
-   if (ret) {
+   if (ret)
amba_ports[i] = NULL;
-   clk_put(uap-clk);
- unmap:
-   iounmap(base);
- free:
-   kfree(uap);
-   }
- out:
+
return ret;
 }
 
@@ -750,9 +739,6 @@ static int pl010_remove(struct amba_device *dev)
if (amba_ports[i] == uap)
amba_ports[i] = NULL;
 
-   iounmap(uap-port.membase);
-   clk_put(uap-clk);
-   kfree(uap);
return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] serial: amba-pl011: Remove redundant label

2014-06-23 Thread Tushar Behera
The label 'out' is only used to return the error code. We can return the
error code directly and remove 'out' label.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 drivers/tty/serial/amba-pl011.c |   30 ++
 1 file changed, 10 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 0e26dcb..8572f2a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1484,7 +1484,7 @@ static int pl011_hwinit(struct uart_port *port)
 */
retval = clk_prepare_enable(uap-clk);
if (retval)
-   goto out;
+   return retval;
 
uap-port.uartclk = clk_get_rate(uap-clk);
 
@@ -1507,8 +1507,6 @@ static int pl011_hwinit(struct uart_port *port)
plat-init();
}
return 0;
- out:
-   return retval;
 }
 
 static void pl011_write_lcr_h(struct uart_amba_port *uap, unsigned int lcr_h)
@@ -2131,32 +2129,24 @@ static int pl011_probe(struct amba_device *dev, const 
struct amba_id *id)
if (amba_ports[i] == NULL)
break;
 
-   if (i == ARRAY_SIZE(amba_ports)) {
-   ret = -EBUSY;
-   goto out;
-   }
+   if (i == ARRAY_SIZE(amba_ports))
+   return -EBUSY;
 
uap = devm_kzalloc(dev-dev, sizeof(struct uart_amba_port),
   GFP_KERNEL);
-   if (uap == NULL) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (uap == NULL)
+   return -ENOMEM;
 
i = pl011_probe_dt_alias(i, dev-dev);
 
base = devm_ioremap(dev-dev, dev-res.start,
resource_size(dev-res));
-   if (!base) {
-   ret = -ENOMEM;
-   goto out;
-   }
+   if (!base)
+   return -ENOMEM;
 
uap-clk = devm_clk_get(dev-dev, NULL);
-   if (IS_ERR(uap-clk)) {
-   ret = PTR_ERR(uap-clk);
-   goto out;
-   }
+   if (IS_ERR(uap-clk))
+   return PTR_ERR(uap-clk);
 
uap-vendor = vendor;
uap-lcrh_rx = vendor-lcrh_rx;
@@ -2198,7 +2188,7 @@ static int pl011_probe(struct amba_device *dev, const 
struct amba_id *id)
uart_unregister_driver(amba_reg);
pl011_dma_remove(uap);
}
- out:
+
return ret;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] serial: samsung: Remove redundant label

2014-06-23 Thread Tushar Behera
probe_err label only returns the error code. This label can be removed
and the error code can be returned directly.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 drivers/tty/serial/samsung.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c1d3ebd..bf93010 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1303,7 +1303,7 @@ static int s3c24xx_serial_probe(struct platform_device 
*pdev)
 
ret = s3c24xx_serial_init_port(ourport, pdev);
if (ret  0)
-   goto probe_err;
+   return ret;
 
if (!s3c24xx_uart_drv.state) {
ret = uart_register_driver(s3c24xx_uart_drv);
@@ -1335,9 +1335,6 @@ static int s3c24xx_serial_probe(struct platform_device 
*pdev)
dev_err(pdev-dev, failed to add cpufreq notifier\n);
 
return 0;
-
- probe_err:
-   return ret;
 }
 
 static int s3c24xx_serial_remove(struct platform_device *dev)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] usb: misc: usb3503: Update error code in print message

2014-06-23 Thread Tushar Behera
On 06/17/2014 04:54 PM, Marek Szyprowski wrote:
 Hello,
 
 On 2014-06-17 13:08, Tushar Behera wrote:
 'err' is uninitialized, rather print the error code directly.

 This also fixes following warning.
 drivers/usb/misc/usb3503.c: In function ‘usb3503_probe’:
 drivers/usb/misc/usb3503.c:195:11: warning: ‘err’ may be used
 uninitialized
 in this function [-Wmaybe-uninitialized]
  dev_err(dev, unable to request refclk (%d)\n, err);

 Signed-off-by: Tushar Behera tusha...@samsung.com
 
 Acked-by: Marek Szyprowski m.szyprow...@samsung.com
 

Greg,

Would you please pick up this patch?

 ---

 Based on next-20140616.

   drivers/usb/misc/usb3503.c |3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)

 diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
 index f43c619..652855b 100644
 --- a/drivers/usb/misc/usb3503.c
 +++ b/drivers/usb/misc/usb3503.c
 @@ -192,7 +192,8 @@ static int usb3503_probe(struct usb3503 *hub)
 clk = devm_clk_get(dev, refclk);
   if (IS_ERR(clk)  PTR_ERR(clk) != -ENOENT) {
 -dev_err(dev, unable to request refclk (%d)\n, err);
 +dev_err(dev, unable to request refclk (%ld)\n,
 +PTR_ERR(clk));
   return PTR_ERR(clk);
   }
   
 
 Best regards


-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] ASoC: max98090: Add max98091 compatible string

2014-06-23 Thread Tushar Behera
On 06/21/2014 02:02 AM, Doug Anderson wrote:
 Tushar,
 
 On Fri, Jun 20, 2014 at 1:03 AM, Tushar Behera tusha...@samsung.com wrote:
 From: Wonjoon Lee woojoo@samsung.com

 The MAX98091 CODEC is the same as MAX98090 CODEC, but with an extra
 microphone. Existing driver for MAX98090 CODEC already has support
 for MAX98091 CODEC. Adding proper compatible string so that MAX98091
 CODEC can be specified from device tree.

 Signed-off-by: Wonjoon Lee woojoo@samsung.com
 Signed-off-by: Doug Anderson diand...@chromium.org
 Signed-off-by: Tushar Behera tusha...@samsung.com
 ---

 Picked from https://chromium-review.googlesource.com/#/c/184091/

  .../devicetree/bindings/sound/max98090.txt |2 +-
  sound/soc/codecs/max98090.c|2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)

 diff --git a/Documentation/devicetree/bindings/sound/max98090.txt 
 b/Documentation/devicetree/bindings/sound/max98090.txt
 index a5e63fa..c454e67 100644
 --- a/Documentation/devicetree/bindings/sound/max98090.txt
 +++ b/Documentation/devicetree/bindings/sound/max98090.txt
 @@ -4,7 +4,7 @@ This device supports I2C only.

  Required properties:

 -- compatible : maxim,max98090.
 +- compatible : maxim,max98090 or maxim,max98091.

  - reg : The I2C address of the device.

 diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
 index f5fccc7..4f5534d 100644
 --- a/sound/soc/codecs/max98090.c
 +++ b/sound/soc/codecs/max98090.c
 @@ -2460,12 +2460,14 @@ static const struct dev_pm_ops max98090_pm = {

  static const struct i2c_device_id max98090_i2c_id[] = {
 { max98090, MAX98090 },
 +   { max98091, MAX98091 },
 
 optional: This would allow you to add some extra error checking in
 max98090_probe() to make sure that the device-tree specified device
 matched the device that was detected.  That could be in a future
 patch, though.
 
 Reviewed-by: Doug Anderson diand...@chromium.org
 

Okay. I will add that in a follow-up patch.

Thanks for reviewing.
-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-06-22 Thread Tushar Behera
On Mon, Jun 16, 2014 at 4:56 PM, Tushar Behera  wrote:
> On 06/11/2014 09:28 PM, Javier Martinez Canillas wrote:
>> On Wed, Jun 11, 2014 at 7:32 AM, Tushar Behera  wrote:
>>> Currently CLK_FOUT_EPLL was set as one of the parents of AUDSS mux.
>>> As per the user manual, it should be CLK_MAU_EPLL.
>>>
>>> The problem surfaced when the bootloader in Peach-pit board set
>>> the EPLL clock as the parent of AUDSS mux. While booting the kernel,
>>> we used to get a system hang during late boot if CLK_MAU_EPLL was
>>> disabled.
>>>
>>> Signed-off-by: Tushar Behera 
>>> Signed-off-by: Shaik Ameer Basha 
>>> Reported-by: Kevin Hilman 
>>> ---
>>>  arch/arm/boot/dts/exynos5420.dtsi |2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
>>> b/arch/arm/boot/dts/exynos5420.dtsi
>>> index e385322..79e9119 100644
>>> --- a/arch/arm/boot/dts/exynos5420.dtsi
>>> +++ b/arch/arm/boot/dts/exynos5420.dtsi
>>> @@ -167,7 +167,7 @@
>>> compatible = "samsung,exynos5420-audss-clock";
>>> reg = <0x0381 0x0C>;
>>> #clock-cells = <1>;
>>> -   clocks = < CLK_FIN_PLL>, < CLK_FOUT_EPLL>,
>>> +   clocks = < CLK_FIN_PLL>, < CLK_MAU_EPLL>,
>>>  < CLK_SCLK_MAUDIO0>, < 
>>> CLK_SCLK_MAUPCM0>;
>>> clock-names = "pll_ref", "pll_in", "sclk_audio", 
>>> "sclk_pcm_in";
>>> };
>>> --
>>> 1.7.9.5
>>>
>>> --
>>
>> Tested-by: Javier Martinez Canillas 
>>
>
> Kukjin,
>
> Would you please take this patch as a fix for 3.16?
>
> --
> Tushar Behera

Kukjin,

Please pick this patch for 3.16. This is an essential fix required for
Peach-pit/Peach-pi board.

--
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-06-22 Thread Tushar Behera
On Mon, Jun 16, 2014 at 4:56 PM, Tushar Behera trbli...@gmail.com wrote:
 On 06/11/2014 09:28 PM, Javier Martinez Canillas wrote:
 On Wed, Jun 11, 2014 at 7:32 AM, Tushar Behera tusha...@samsung.com wrote:
 Currently CLK_FOUT_EPLL was set as one of the parents of AUDSS mux.
 As per the user manual, it should be CLK_MAU_EPLL.

 The problem surfaced when the bootloader in Peach-pit board set
 the EPLL clock as the parent of AUDSS mux. While booting the kernel,
 we used to get a system hang during late boot if CLK_MAU_EPLL was
 disabled.

 Signed-off-by: Tushar Behera tusha...@samsung.com
 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 Reported-by: Kevin Hilman khil...@linaro.org
 ---
  arch/arm/boot/dts/exynos5420.dtsi |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
 b/arch/arm/boot/dts/exynos5420.dtsi
 index e385322..79e9119 100644
 --- a/arch/arm/boot/dts/exynos5420.dtsi
 +++ b/arch/arm/boot/dts/exynos5420.dtsi
 @@ -167,7 +167,7 @@
 compatible = samsung,exynos5420-audss-clock;
 reg = 0x0381 0x0C;
 #clock-cells = 1;
 -   clocks = clock CLK_FIN_PLL, clock CLK_FOUT_EPLL,
 +   clocks = clock CLK_FIN_PLL, clock CLK_MAU_EPLL,
  clock CLK_SCLK_MAUDIO0, clock 
 CLK_SCLK_MAUPCM0;
 clock-names = pll_ref, pll_in, sclk_audio, 
 sclk_pcm_in;
 };
 --
 1.7.9.5

 --

 Tested-by: Javier Martinez Canillas javier.marti...@collabora.co.uk


 Kukjin,

 Would you please take this patch as a fix for 3.16?

 --
 Tushar Behera

Kukjin,

Please pick this patch for 3.16. This is an essential fix required for
Peach-pit/Peach-pi board.

--
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/3] Remove devm_request_and_ioremap()

2014-06-20 Thread Tushar Behera
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/20/2014 02:15 PM, Wolfram Sang wrote:
> On Thu, Jun 19, 2014 at 07:59:57PM -0700, 'Greg Kroah-Hartman'
> wrote:
>> On Fri, Jun 20, 2014 at 11:36:03AM +0900, Jingoo Han wrote:
>>> On Friday, June 20, 2014 3:49 AM, Wolfram Sang wrote:
>>>> 
>>>> Pretty much a year ago, Tushar cleaned up a lot of deprecated
>>>> uses of devm_request_and_ioremap, yet some remains are still
>>>> left. Remove the last two users, and let the function rest in
>>>> peace. I'd suggest that this series is picked up as a whole
>>>> to have that case finally closed. Greg? Are you interested in
>>>> picking it up?
>>> 
>>> (+cc Greg Kroah-Hartman)
>>> 
>>> I already sent the same patch as one single patch to Greg
>>> Kroah-Hartman. [1] Also, it was accepted by Greg Kroah-Hartman.
>>> [2] Thank you.
>>> 
>>> [1] https://lkml.org/lkml/2014/6/11/26 [2]
>>> https://lkml.org/lkml/2014/6/11/649
>> 
>> Yeah, I'll go apply that right now while I'm remembering it :)
> 
> For the patch above:
> 
> Reviewed-by: Wolfram Sang 
> 

If it is still not late,

Acked-by: Tushar Behera 

- -- 
Tushar Behera
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTo/YpAAoJELqclMPPkq4NOsIIAIkN+lOgWTIo3IBw7oQ9yO76
Hjn6fR2kjWOdrXrTdW3KQRzElw8hMKdPF5++GkgAkreoLSxRBLnyHdGc0jPdmxXw
gIu4O0WNQYRKYN+fkHPkl/5z10SNmZrnwcq37FK8EMCqpph7JywYOu5WyNVjMKOh
gTJ9zME+iCAzE+KlzBr7pRLySkFvgtITqBRT/lsRmGGpjH+kphSmYuY2kvz2VVLI
DE6Zy8kOyZEEDwDsm62qhoZNtzKcGoZgSqNFKU8fM9duonRhAwUQKImUnKB1H1CD
FQcmZI/4WA/6OLypUSBj/AIciK1MW/Gu6IpILjNVwQA/q3CKEaUkiHf+2HNVohU=
=FBDs
-END PGP SIGNATURE-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] ASoC: max98090: Add max98091 compatible string

2014-06-20 Thread Tushar Behera
From: Wonjoon Lee 

The MAX98091 CODEC is the same as MAX98090 CODEC, but with an extra
microphone. Existing driver for MAX98090 CODEC already has support
for MAX98091 CODEC. Adding proper compatible string so that MAX98091
CODEC can be specified from device tree.

Signed-off-by: Wonjoon Lee 
Signed-off-by: Doug Anderson 
Signed-off-by: Tushar Behera 
---

Picked from https://chromium-review.googlesource.com/#/c/184091/

 .../devicetree/bindings/sound/max98090.txt |2 +-
 sound/soc/codecs/max98090.c|2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/max98090.txt 
b/Documentation/devicetree/bindings/sound/max98090.txt
index a5e63fa..c454e67 100644
--- a/Documentation/devicetree/bindings/sound/max98090.txt
+++ b/Documentation/devicetree/bindings/sound/max98090.txt
@@ -4,7 +4,7 @@ This device supports I2C only.
 
 Required properties:
 
-- compatible : "maxim,max98090".
+- compatible : "maxim,max98090" or "maxim,max98091".
 
 - reg : The I2C address of the device.
 
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index f5fccc7..4f5534d 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2460,12 +2460,14 @@ static const struct dev_pm_ops max98090_pm = {
 
 static const struct i2c_device_id max98090_i2c_id[] = {
{ "max98090", MAX98090 },
+   { "max98091", MAX98091 },
{ }
 };
 MODULE_DEVICE_TABLE(i2c, max98090_i2c_id);
 
 static const struct of_device_id max98090_of_match[] = {
{ .compatible = "maxim,max98090", },
+   { .compatible = "maxim,max98091", },
{ }
 };
 MODULE_DEVICE_TABLE(of, max98090_of_match);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ASoC: samsung: Extend snow driver to support MAX98091

2014-06-20 Thread Tushar Behera
Peach-pi board has MAX98091 CODEC. Extend snow machine driver to support
this board.

Signed-off-by: Tushar Behera 
---
 Documentation/devicetree/bindings/sound/snow.txt |1 +
 sound/soc/samsung/snow.c |1 +
 2 files changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/snow.txt 
b/Documentation/devicetree/bindings/sound/snow.txt
index 678b191..e0b7a82 100644
--- a/Documentation/devicetree/bindings/sound/snow.txt
+++ b/Documentation/devicetree/bindings/sound/snow.txt
@@ -3,6 +3,7 @@ Audio Binding for Snow boards
 Required properties:
 - compatible : Can be one of the following,
"google,snow-audio-max98090" or
+   "google,snow-audio-max98091" or
"google,snow-audio-max98095"
 - samsung,i2s-controller: The phandle of the Samsung I2S controller
 - samsung,audio-codec: The phandle of the audio codec
diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c
index 014c177..8bbd348 100644
--- a/sound/soc/samsung/snow.c
+++ b/sound/soc/samsung/snow.c
@@ -103,6 +103,7 @@ static int snow_probe(struct platform_device *pdev)
 
 static const struct of_device_id snow_of_match[] = {
{ .compatible = "google,snow-audio-max98090", },
+   { .compatible = "google,snow-audio-max98091", },
{ .compatible = "google,snow-audio-max98095", },
{},
 };
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] ASoC: samsung: Extend snow driver to support MAX98091

2014-06-20 Thread Tushar Behera
Peach-pi board has MAX98091 CODEC. Extend snow machine driver to support
this board.

Signed-off-by: Tushar Behera tusha...@samsung.com
---
 Documentation/devicetree/bindings/sound/snow.txt |1 +
 sound/soc/samsung/snow.c |1 +
 2 files changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/snow.txt 
b/Documentation/devicetree/bindings/sound/snow.txt
index 678b191..e0b7a82 100644
--- a/Documentation/devicetree/bindings/sound/snow.txt
+++ b/Documentation/devicetree/bindings/sound/snow.txt
@@ -3,6 +3,7 @@ Audio Binding for Snow boards
 Required properties:
 - compatible : Can be one of the following,
google,snow-audio-max98090 or
+   google,snow-audio-max98091 or
google,snow-audio-max98095
 - samsung,i2s-controller: The phandle of the Samsung I2S controller
 - samsung,audio-codec: The phandle of the audio codec
diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c
index 014c177..8bbd348 100644
--- a/sound/soc/samsung/snow.c
+++ b/sound/soc/samsung/snow.c
@@ -103,6 +103,7 @@ static int snow_probe(struct platform_device *pdev)
 
 static const struct of_device_id snow_of_match[] = {
{ .compatible = google,snow-audio-max98090, },
+   { .compatible = google,snow-audio-max98091, },
{ .compatible = google,snow-audio-max98095, },
{},
 };
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] ASoC: max98090: Add max98091 compatible string

2014-06-20 Thread Tushar Behera
From: Wonjoon Lee woojoo@samsung.com

The MAX98091 CODEC is the same as MAX98090 CODEC, but with an extra
microphone. Existing driver for MAX98090 CODEC already has support
for MAX98091 CODEC. Adding proper compatible string so that MAX98091
CODEC can be specified from device tree.

Signed-off-by: Wonjoon Lee woojoo@samsung.com
Signed-off-by: Doug Anderson diand...@chromium.org
Signed-off-by: Tushar Behera tusha...@samsung.com
---

Picked from https://chromium-review.googlesource.com/#/c/184091/

 .../devicetree/bindings/sound/max98090.txt |2 +-
 sound/soc/codecs/max98090.c|2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/sound/max98090.txt 
b/Documentation/devicetree/bindings/sound/max98090.txt
index a5e63fa..c454e67 100644
--- a/Documentation/devicetree/bindings/sound/max98090.txt
+++ b/Documentation/devicetree/bindings/sound/max98090.txt
@@ -4,7 +4,7 @@ This device supports I2C only.
 
 Required properties:
 
-- compatible : maxim,max98090.
+- compatible : maxim,max98090 or maxim,max98091.
 
 - reg : The I2C address of the device.
 
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index f5fccc7..4f5534d 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2460,12 +2460,14 @@ static const struct dev_pm_ops max98090_pm = {
 
 static const struct i2c_device_id max98090_i2c_id[] = {
{ max98090, MAX98090 },
+   { max98091, MAX98091 },
{ }
 };
 MODULE_DEVICE_TABLE(i2c, max98090_i2c_id);
 
 static const struct of_device_id max98090_of_match[] = {
{ .compatible = maxim,max98090, },
+   { .compatible = maxim,max98091, },
{ }
 };
 MODULE_DEVICE_TABLE(of, max98090_of_match);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/3] Remove devm_request_and_ioremap()

2014-06-20 Thread Tushar Behera
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/20/2014 02:15 PM, Wolfram Sang wrote:
 On Thu, Jun 19, 2014 at 07:59:57PM -0700, 'Greg Kroah-Hartman'
 wrote:
 On Fri, Jun 20, 2014 at 11:36:03AM +0900, Jingoo Han wrote:
 On Friday, June 20, 2014 3:49 AM, Wolfram Sang wrote:
 
 Pretty much a year ago, Tushar cleaned up a lot of deprecated
 uses of devm_request_and_ioremap, yet some remains are still
 left. Remove the last two users, and let the function rest in
 peace. I'd suggest that this series is picked up as a whole
 to have that case finally closed. Greg? Are you interested in
 picking it up?
 
 (+cc Greg Kroah-Hartman)
 
 I already sent the same patch as one single patch to Greg
 Kroah-Hartman. [1] Also, it was accepted by Greg Kroah-Hartman.
 [2] Thank you.
 
 [1] https://lkml.org/lkml/2014/6/11/26 [2]
 https://lkml.org/lkml/2014/6/11/649
 
 Yeah, I'll go apply that right now while I'm remembering it :)
 
 For the patch above:
 
 Reviewed-by: Wolfram Sang w...@the-dreams.de
 

If it is still not late,

Acked-by: Tushar Behera trbli...@gmail.com

- -- 
Tushar Behera
-BEGIN PGP SIGNATURE-
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTo/YpAAoJELqclMPPkq4NOsIIAIkN+lOgWTIo3IBw7oQ9yO76
Hjn6fR2kjWOdrXrTdW3KQRzElw8hMKdPF5++GkgAkreoLSxRBLnyHdGc0jPdmxXw
gIu4O0WNQYRKYN+fkHPkl/5z10SNmZrnwcq37FK8EMCqpph7JywYOu5WyNVjMKOh
gTJ9zME+iCAzE+KlzBr7pRLySkFvgtITqBRT/lsRmGGpjH+kphSmYuY2kvz2VVLI
DE6Zy8kOyZEEDwDsm62qhoZNtzKcGoZgSqNFKU8fM9duonRhAwUQKImUnKB1H1CD
FQcmZI/4WA/6OLypUSBj/AIciK1MW/Gu6IpILjNVwQA/q3CKEaUkiHf+2HNVohU=
=FBDs
-END PGP SIGNATURE-
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] usb: misc: usb3503: Update error code in print message

2014-06-17 Thread Tushar Behera
'err' is uninitialized, rather print the error code directly.

This also fixes following warning.
drivers/usb/misc/usb3503.c: In function ‘usb3503_probe’:
drivers/usb/misc/usb3503.c:195:11: warning: ‘err’ may be used uninitialized
in this function [-Wmaybe-uninitialized]
dev_err(dev, "unable to request refclk (%d)\n", err);

Signed-off-by: Tushar Behera 
---

Based on next-20140616.

 drivers/usb/misc/usb3503.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index f43c619..652855b 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -192,7 +192,8 @@ static int usb3503_probe(struct usb3503 *hub)
 
clk = devm_clk_get(dev, "refclk");
if (IS_ERR(clk) && PTR_ERR(clk) != -ENOENT) {
-   dev_err(dev, "unable to request refclk (%d)\n", err);
+   dev_err(dev, "unable to request refclk (%ld)\n",
+   PTR_ERR(clk));
return PTR_ERR(clk);
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] usb: misc: usb3503: Update error code in print message

2014-06-17 Thread Tushar Behera
'err' is uninitialized, rather print the error code directly.

This also fixes following warning.
drivers/usb/misc/usb3503.c: In function ‘usb3503_probe’:
drivers/usb/misc/usb3503.c:195:11: warning: ‘err’ may be used uninitialized
in this function [-Wmaybe-uninitialized]
dev_err(dev, unable to request refclk (%d)\n, err);

Signed-off-by: Tushar Behera tusha...@samsung.com
---

Based on next-20140616.

 drivers/usb/misc/usb3503.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index f43c619..652855b 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -192,7 +192,8 @@ static int usb3503_probe(struct usb3503 *hub)
 
clk = devm_clk_get(dev, refclk);
if (IS_ERR(clk)  PTR_ERR(clk) != -ENOENT) {
-   dev_err(dev, unable to request refclk (%d)\n, err);
+   dev_err(dev, unable to request refclk (%ld)\n,
+   PTR_ERR(clk));
return PTR_ERR(clk);
}
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] ARM: dts: Enable audio support for Peach-pi board

2014-06-16 Thread Tushar Behera
On Mon, Jun 16, 2014 at 10:32 PM, Doug Anderson  wrote:
> Mark,
>
> On Mon, Jun 16, 2014 at 9:51 AM, Mark Brown  wrote:
>> On Mon, Jun 16, 2014 at 09:49:26AM -0700, Doug Anderson wrote:
>>
>>> Yes please.  I think there's supposed to be some official ordering of
>>> things.  If anyone reading this has a pointer to the official sort
>>> order of things in the device tree I'd love to see it!  ;)
>>
>> Most exact first I believe?
>
> More specifically I'm looking for the ordering between nodes and
> between properties in a node.  For instance:
>
> 1. It appears to be convention to sort children of the "pinctrl" nodes
> by the first pin number in that group.  That is:
>
> ec_spi_cs: ec-spi-cs {
>   samsung,pins = "gpb1-2";
>   ...
> };
>
> ...comes before:
> usb300_vbus_en: usb300-vbus-en {
>   samsung,pins = "gph0-0";
>   ...
> };
>
> ...that's one really good and well-defined ordering.
>
>
> 2. I have no idea how general properties should be sorted.  I tend to
> see "compatible" first but that's above the only rule I've seen.
> Sometimes I've seen "status" first, sometimes last, sometimes
> alphabetically sorted, and sometimes in a random place.  Examples:
>
> usb301_vbus_reg: regulator-usb301 {
>   compatible = "regulator-fixed";
>   regulator-name = "P5.0V_USB3CON1";
>   regulator-min-microvolt = <500>;
>   regulator-max-microvolt = <500>;
>   gpio = < 1 0>;
>   pinctrl-names = "default";
>   pinctrl-0 = <_vbus_en>;
>   enable-active-high;
> };
>
>  {
>   status = "okay";
>   hpd-gpio = < 7 GPIO_ACTIVE_HIGH>;
>   pinctrl-names = "default";
>   pinctrl-0 = <_hpd_irq>;
>   ddc = <_2>;
> };
>
>
> 3. I have no idea how to sort nodes.  In theory you could say that
> they should be sorted by base address:
>
> i2s0: i2s@0383 {
>   ...
> };
>
> hsi2c_7: i2c@12CD {
>   ...
> };
>
> i2s1: i2s@12D6 {
>   ...
> };
>
> ...that works until someone argues that all of the "i2s" nodes should
> be together.  It also doesn't work so well with the board convention
> of using aliases to refer to things in the SoC, like:
>
>  {
>   status = "okay";
> };
>
> _7 {
>   status = "okay";
> };
>
> ...it's not at all obvious in the board file what the base address in
> the SoC was.
>

In case where we are using only aliases in board file, sorting them
alphabetically would be reasonable. This rule would be easy to
reinforce.

> ---
>
> Anyway, none of this is earth shattering and it doesn't matter all
> that much.  It's just nice to have an official order to make diffing
> easier and also to avoid merge conflicts (unlikely someone changing
> different properties will both add them in the same place in the
> ordering).
>
>
> -Doug



-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] ARM: dts: Enable audio support for Peach-pi board

2014-06-16 Thread Tushar Behera
On Mon, Jun 16, 2014 at 10:19 PM, Doug Anderson  wrote:
> Tushar,
>
> On Mon, Jun 16, 2014 at 4:19 AM, Tushar Behera  wrote:
>> On 06/13/2014 10:33 PM, Doug Anderson wrote:
>>> Tushar,
>>>
>>> On Tue, Jun 10, 2014 at 10:32 PM, Tushar Behera  
>>> wrote:
>>>> Peach-pi board has MAX98090 audio codec connected on HSI2C-7 bus.
>>>
>>> If you want to be a stickler about it, peach-pi actually has a
>>> max98091.  That requires code changes to the i2c driver, though.
>>> ...and unfortunately listing two compatible strings for i2c devices is
>>> broken.  :(
>>>
>> Hi Doug,
>>
>> You are right. I checked the boot logs, the detected codec type is
>> MAX98091. Since both these CODECs are supported through a single driver
>> and the detection of chip is done during runtime, I would suggest we go
>> ahead with "max98090" compatible string. I will update the commit
>> message accordingly.
>>
>> Does that sound okay to you?
>
> As per my understanding you shouldn't do this.  You should have two patches:
>
> 1. Add "max98091".  You could simply post Wonjoon's patch from
> <https://chromium-review.googlesource.com/184091>
>
> 2. Change the device tree to refer to "max98091"
>
> The argument that the "current kernel driver has a single driver" is
> an argument that you're not supposed to make for device tree.  The
> same device tree is supposed to work for U-Boot, BSD, or any other
> platform.  On those platforms it might not be a shared driver.
>

My argument is that the device type is getting detected during
runtime, hence there is no need to differentiate between these two.

But if you prefer that way, I will repost.

>
>> If you so desire, I will submit a patch to sort peach-pi device-tree
>> nodes (w.r.t. peach-pit dts file).
>
> Yes please.  I think there's supposed to be some official ordering of
> things.  If anyone reading this has a pointer to the official sort
> order of things in the device tree I'd love to see it!  ;)
>
> -Doug

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-06-16 Thread Tushar Behera
On 06/11/2014 09:28 PM, Javier Martinez Canillas wrote:
> On Wed, Jun 11, 2014 at 7:32 AM, Tushar Behera  wrote:
>> Currently CLK_FOUT_EPLL was set as one of the parents of AUDSS mux.
>> As per the user manual, it should be CLK_MAU_EPLL.
>>
>> The problem surfaced when the bootloader in Peach-pit board set
>> the EPLL clock as the parent of AUDSS mux. While booting the kernel,
>> we used to get a system hang during late boot if CLK_MAU_EPLL was
>> disabled.
>>
>> Signed-off-by: Tushar Behera 
>> Signed-off-by: Shaik Ameer Basha 
>> Reported-by: Kevin Hilman 
>> ---
>>  arch/arm/boot/dts/exynos5420.dtsi |2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
>> b/arch/arm/boot/dts/exynos5420.dtsi
>> index e385322..79e9119 100644
>> --- a/arch/arm/boot/dts/exynos5420.dtsi
>> +++ b/arch/arm/boot/dts/exynos5420.dtsi
>> @@ -167,7 +167,7 @@
>> compatible = "samsung,exynos5420-audss-clock";
>> reg = <0x0381 0x0C>;
>> #clock-cells = <1>;
>> -   clocks = < CLK_FIN_PLL>, < CLK_FOUT_EPLL>,
>> +   clocks = < CLK_FIN_PLL>, < CLK_MAU_EPLL>,
>>  < CLK_SCLK_MAUDIO0>, < 
>> CLK_SCLK_MAUPCM0>;
>>         clock-names = "pll_ref", "pll_in", "sclk_audio", 
>> "sclk_pcm_in";
>> };
>> --
>> 1.7.9.5
>>
>> --
> 
> Tested-by: Javier Martinez Canillas 
> 

Kukjin,

Would you please take this patch as a fix for 3.16?

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] ARM: dts: Enable audio support for Peach-pi board

2014-06-16 Thread Tushar Behera
On 06/13/2014 10:33 PM, Doug Anderson wrote:
> Tushar,
> 
> On Tue, Jun 10, 2014 at 10:32 PM, Tushar Behera  wrote:
>> Peach-pi board has MAX98090 audio codec connected on HSI2C-7 bus.
> 
> If you want to be a stickler about it, peach-pi actually has a
> max98091.  That requires code changes to the i2c driver, though.
> ...and unfortunately listing two compatible strings for i2c devices is
> broken.  :(
> 
Hi Doug,

You are right. I checked the boot logs, the detected codec type is
MAX98091. Since both these CODECs are supported through a single driver
and the detection of chip is done during runtime, I would suggest we go
ahead with "max98090" compatible string. I will update the commit
message accordingly.

Does that sound okay to you?

> 
>> Signed-off-by: Tushar Behera 
>> ---
>>  arch/arm/boot/dts/exynos5800-peach-pi.dts |   31 
>> +
>>  1 file changed, 31 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts 
>> b/arch/arm/boot/dts/exynos5800-peach-pi.dts
>> index f3af207..76f5966 100644
>> --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
>> +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
>> @@ -78,9 +78,27 @@
>> pinctrl-0 = <_vbus_en>;
>> enable-active-high;
>> };
>> +
>> +   sound {
>> +   compatible = "google,snow-audio-max98090";
>> +
>> +   samsung,i2s-controller = <>;
>> +   samsung,audio-codec = <>;
>> +   };
>> +};
>> +
>> + {
>> +   status = "okay";
> 
> It would be awfully nice to keep diffs between exynos5420-peach-pit
> and exynos5800-peach-pi clean.  They're 99% the same.  I know this has
> already gotten messed up with DP/HDMI were added, but there's no need
> to make it worse.
> 

If you so desire, I will submit a patch to sort peach-pi device-tree
nodes (w.r.t. peach-pit dts file).

> Could you add these nodes in the same place within the dts they were
> added in exynos5420-peach-pit?
> 

Okay, I will add it after watchdog node.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] ARM: dts: Enable audio support for Peach-pi board

2014-06-16 Thread Tushar Behera
On 06/13/2014 10:33 PM, Doug Anderson wrote:
 Tushar,
 
 On Tue, Jun 10, 2014 at 10:32 PM, Tushar Behera tusha...@samsung.com wrote:
 Peach-pi board has MAX98090 audio codec connected on HSI2C-7 bus.
 
 If you want to be a stickler about it, peach-pi actually has a
 max98091.  That requires code changes to the i2c driver, though.
 ...and unfortunately listing two compatible strings for i2c devices is
 broken.  :(
 
Hi Doug,

You are right. I checked the boot logs, the detected codec type is
MAX98091. Since both these CODECs are supported through a single driver
and the detection of chip is done during runtime, I would suggest we go
ahead with max98090 compatible string. I will update the commit
message accordingly.

Does that sound okay to you?

 
 Signed-off-by: Tushar Behera tusha...@samsung.com
 ---
  arch/arm/boot/dts/exynos5800-peach-pi.dts |   31 
 +
  1 file changed, 31 insertions(+)

 diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts 
 b/arch/arm/boot/dts/exynos5800-peach-pi.dts
 index f3af207..76f5966 100644
 --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts
 +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts
 @@ -78,9 +78,27 @@
 pinctrl-0 = usb301_vbus_en;
 enable-active-high;
 };
 +
 +   sound {
 +   compatible = google,snow-audio-max98090;
 +
 +   samsung,i2s-controller = i2s0;
 +   samsung,audio-codec = max98090;
 +   };
 +};
 +
 +i2s0 {
 +   status = okay;
 
 It would be awfully nice to keep diffs between exynos5420-peach-pit
 and exynos5800-peach-pi clean.  They're 99% the same.  I know this has
 already gotten messed up with DP/HDMI were added, but there's no need
 to make it worse.
 

If you so desire, I will submit a patch to sort peach-pi device-tree
nodes (w.r.t. peach-pit dts file).

 Could you add these nodes in the same place within the dts they were
 added in exynos5420-peach-pit?
 

Okay, I will add it after watchdog node.

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: dts: Update the parent for Audss clocks in Exynos5420

2014-06-16 Thread Tushar Behera
On 06/11/2014 09:28 PM, Javier Martinez Canillas wrote:
 On Wed, Jun 11, 2014 at 7:32 AM, Tushar Behera tusha...@samsung.com wrote:
 Currently CLK_FOUT_EPLL was set as one of the parents of AUDSS mux.
 As per the user manual, it should be CLK_MAU_EPLL.

 The problem surfaced when the bootloader in Peach-pit board set
 the EPLL clock as the parent of AUDSS mux. While booting the kernel,
 we used to get a system hang during late boot if CLK_MAU_EPLL was
 disabled.

 Signed-off-by: Tushar Behera tusha...@samsung.com
 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 Reported-by: Kevin Hilman khil...@linaro.org
 ---
  arch/arm/boot/dts/exynos5420.dtsi |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
 b/arch/arm/boot/dts/exynos5420.dtsi
 index e385322..79e9119 100644
 --- a/arch/arm/boot/dts/exynos5420.dtsi
 +++ b/arch/arm/boot/dts/exynos5420.dtsi
 @@ -167,7 +167,7 @@
 compatible = samsung,exynos5420-audss-clock;
 reg = 0x0381 0x0C;
 #clock-cells = 1;
 -   clocks = clock CLK_FIN_PLL, clock CLK_FOUT_EPLL,
 +   clocks = clock CLK_FIN_PLL, clock CLK_MAU_EPLL,
  clock CLK_SCLK_MAUDIO0, clock 
 CLK_SCLK_MAUPCM0;
 clock-names = pll_ref, pll_in, sclk_audio, 
 sclk_pcm_in;
 };
 --
 1.7.9.5

 --
 
 Tested-by: Javier Martinez Canillas javier.marti...@collabora.co.uk
 

Kukjin,

Would you please take this patch as a fix for 3.16?

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] ARM: dts: Enable audio support for Peach-pi board

2014-06-16 Thread Tushar Behera
On Mon, Jun 16, 2014 at 10:19 PM, Doug Anderson diand...@google.com wrote:
 Tushar,

 On Mon, Jun 16, 2014 at 4:19 AM, Tushar Behera trbli...@gmail.com wrote:
 On 06/13/2014 10:33 PM, Doug Anderson wrote:
 Tushar,

 On Tue, Jun 10, 2014 at 10:32 PM, Tushar Behera tusha...@samsung.com 
 wrote:
 Peach-pi board has MAX98090 audio codec connected on HSI2C-7 bus.

 If you want to be a stickler about it, peach-pi actually has a
 max98091.  That requires code changes to the i2c driver, though.
 ...and unfortunately listing two compatible strings for i2c devices is
 broken.  :(

 Hi Doug,

 You are right. I checked the boot logs, the detected codec type is
 MAX98091. Since both these CODECs are supported through a single driver
 and the detection of chip is done during runtime, I would suggest we go
 ahead with max98090 compatible string. I will update the commit
 message accordingly.

 Does that sound okay to you?

 As per my understanding you shouldn't do this.  You should have two patches:

 1. Add max98091.  You could simply post Wonjoon's patch from
 https://chromium-review.googlesource.com/184091

 2. Change the device tree to refer to max98091

 The argument that the current kernel driver has a single driver is
 an argument that you're not supposed to make for device tree.  The
 same device tree is supposed to work for U-Boot, BSD, or any other
 platform.  On those platforms it might not be a shared driver.


My argument is that the device type is getting detected during
runtime, hence there is no need to differentiate between these two.

But if you prefer that way, I will repost.


 If you so desire, I will submit a patch to sort peach-pi device-tree
 nodes (w.r.t. peach-pit dts file).

 Yes please.  I think there's supposed to be some official ordering of
 things.  If anyone reading this has a pointer to the official sort
 order of things in the device tree I'd love to see it!  ;)

 -Doug

-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3] ARM: dts: Enable audio support for Peach-pi board

2014-06-16 Thread Tushar Behera
On Mon, Jun 16, 2014 at 10:32 PM, Doug Anderson diand...@google.com wrote:
 Mark,

 On Mon, Jun 16, 2014 at 9:51 AM, Mark Brown broo...@kernel.org wrote:
 On Mon, Jun 16, 2014 at 09:49:26AM -0700, Doug Anderson wrote:

 Yes please.  I think there's supposed to be some official ordering of
 things.  If anyone reading this has a pointer to the official sort
 order of things in the device tree I'd love to see it!  ;)

 Most exact first I believe?

 More specifically I'm looking for the ordering between nodes and
 between properties in a node.  For instance:

 1. It appears to be convention to sort children of the pinctrl nodes
 by the first pin number in that group.  That is:

 ec_spi_cs: ec-spi-cs {
   samsung,pins = gpb1-2;
   ...
 };

 ...comes before:
 usb300_vbus_en: usb300-vbus-en {
   samsung,pins = gph0-0;
   ...
 };

 ...that's one really good and well-defined ordering.


 2. I have no idea how general properties should be sorted.  I tend to
 see compatible first but that's above the only rule I've seen.
 Sometimes I've seen status first, sometimes last, sometimes
 alphabetically sorted, and sometimes in a random place.  Examples:

 usb301_vbus_reg: regulator-usb301 {
   compatible = regulator-fixed;
   regulator-name = P5.0V_USB3CON1;
   regulator-min-microvolt = 500;
   regulator-max-microvolt = 500;
   gpio = gph0 1 0;
   pinctrl-names = default;
   pinctrl-0 = usb301_vbus_en;
   enable-active-high;
 };

 hdmi {
   status = okay;
   hpd-gpio = gpx3 7 GPIO_ACTIVE_HIGH;
   pinctrl-names = default;
   pinctrl-0 = hdmi_hpd_irq;
   ddc = i2c_2;
 };


 3. I have no idea how to sort nodes.  In theory you could say that
 they should be sorted by base address:

 i2s0: i2s@0383 {
   ...
 };

 hsi2c_7: i2c@12CD {
   ...
 };

 i2s1: i2s@12D6 {
   ...
 };

 ...that works until someone argues that all of the i2s nodes should
 be together.  It also doesn't work so well with the board convention
 of using aliases to refer to things in the SoC, like:

 i2s0 {
   status = okay;
 };

 hsi2c_7 {
   status = okay;
 };

 ...it's not at all obvious in the board file what the base address in
 the SoC was.


In case where we are using only aliases in board file, sorting them
alphabetically would be reasonable. This rule would be easy to
reinforce.

 ---

 Anyway, none of this is earth shattering and it doesn't matter all
 that much.  It's just nice to have an official order to make diffing
 easier and also to avoid merge conflicts (unlikely someone changing
 different properties will both add them in the same place in the
 ordering).


 -Doug



-- 
Tushar Behera
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-06-12 Thread Tushar Behera
On Wed, Jun 11, 2014 at 10:20 PM, Kevin Hilman  wrote:
> Tushar Behera  writes:
>
>> When the output clock of AUDSS mux is disabled, we are getting kernel
>> oops while doing a clk_get() on other clocks provided by AUDSS.
>>
>> Though user manual doesn't specify this dependency, we came across
>> this issue while disabling the parent of AUDSS mux clocks.
>>
>> Keeping the parents of AUDSS mux always enabled fixes this issue.
>
> While this patch works (and fixes the boot problem for me), it seems
> like it's papering over the real problem.
>

Thanks for testing.

> Seems like the right fix is actually modelling the clocks properly so
> that enabling a child clock ensures that the parent is also enabled.
>

Patch 2/3 was to ensure we have proper clock tree defined for
Exynos5420. While testing with audio disabled, that patch alone fixed
the issue. But when audio was enabled (and hence I2S0 was trying to
access the clocks), we got some kernel oops during late booting, hence
I came up this solution.

The solution might be a little half-baked because of the urgency to
push the fix, but will try to dig more into the issue on Monday when I
resume office.

> Kevin

Thanks,
--
Tushar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-06-12 Thread Tushar Behera
On Wed, Jun 11, 2014 at 10:58 PM, Tomasz Figa  wrote:
> Hi Tushar,
>
> On 11.06.2014 07:32, Tushar Behera wrote:
>> When the output clock of AUDSS mux is disabled, we are getting kernel
>> oops while doing a clk_get() on other clocks provided by AUDSS. Though
>> user manual doesn't specify this dependency, we came across this issue
>> while disabling the parent of AUDSS mux clocks.
>
> Could you provide more data about this oops? E.g. kernel log, platforms
> it affects (just peach-pit or also others), test case, extra patches
> applied on top of mainline (if any).
>
> I don't like this solution, because keeping a clock always enabled is
> usually not desirable and this driver is also used on other platforms
> than peach-pit, so this change will affect all of them.
>

I will update later after doing similar tests on other platforms.

> Best regards,
> Tomasz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-06-12 Thread Tushar Behera
On Wed, Jun 11, 2014 at 10:20 PM, Mike Turquette  wrote:
> Quoting Tushar Behera (2014-06-10 22:32:17)
>> When the output clock of AUDSS mux is disabled, we are getting kernel
>> oops while doing a clk_get() on other clocks provided by AUDSS. Though
>> user manual doesn't specify this dependency, we came across this issue
>> while disabling the parent of AUDSS mux clocks.
>
> Hi Tushar,
>
> Can you help me understand better what the actual problem is? What is
> the root cause of the kernel oops?

Currently AUDSS mux has two parents, XXTI crystal and MAU_EPLL clock.
As per observation, when the output of AUDSS mux is gated, we are not
able to do any operation on the clocks provided by MAU block (mostly
the clocks used by ADMA and audio blocks).

>
> You mention calling clk_get on child clocks of the AUDSS mux fails, but
> I cannot imagine why. How can the enable/disable state of a clock affect
> the ability to clk_get other clocks?
>

I might have a little vogue while updating the commit message
(mentioning about clk_get which surely is only a s/w operation), but
there is definitely some issue with handling those clocks under given
scenario.

I am on leave till end of this week, so I will update you more with
the logs on Monday.

Thanks,
--
Tushar
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-06-12 Thread Tushar Behera
On Wed, Jun 11, 2014 at 10:20 PM, Mike Turquette mturque...@linaro.org wrote:
 Quoting Tushar Behera (2014-06-10 22:32:17)
 When the output clock of AUDSS mux is disabled, we are getting kernel
 oops while doing a clk_get() on other clocks provided by AUDSS. Though
 user manual doesn't specify this dependency, we came across this issue
 while disabling the parent of AUDSS mux clocks.

 Hi Tushar,

 Can you help me understand better what the actual problem is? What is
 the root cause of the kernel oops?

Currently AUDSS mux has two parents, XXTI crystal and MAU_EPLL clock.
As per observation, when the output of AUDSS mux is gated, we are not
able to do any operation on the clocks provided by MAU block (mostly
the clocks used by ADMA and audio blocks).


 You mention calling clk_get on child clocks of the AUDSS mux fails, but
 I cannot imagine why. How can the enable/disable state of a clock affect
 the ability to clk_get other clocks?


I might have a little vogue while updating the commit message
(mentioning about clk_get which surely is only a s/w operation), but
there is definitely some issue with handling those clocks under given
scenario.

I am on leave till end of this week, so I will update you more with
the logs on Monday.

Thanks,
--
Tushar
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-06-12 Thread Tushar Behera
On Wed, Jun 11, 2014 at 10:58 PM, Tomasz Figa tomasz.f...@gmail.com wrote:
 Hi Tushar,

 On 11.06.2014 07:32, Tushar Behera wrote:
 When the output clock of AUDSS mux is disabled, we are getting kernel
 oops while doing a clk_get() on other clocks provided by AUDSS. Though
 user manual doesn't specify this dependency, we came across this issue
 while disabling the parent of AUDSS mux clocks.

 Could you provide more data about this oops? E.g. kernel log, platforms
 it affects (just peach-pit or also others), test case, extra patches
 applied on top of mainline (if any).

 I don't like this solution, because keeping a clock always enabled is
 usually not desirable and this driver is also used on other platforms
 than peach-pit, so this change will affect all of them.


I will update later after doing similar tests on other platforms.

 Best regards,
 Tomasz
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] clk: exynos-audss: Keep the parent of mout_audss always enabled

2014-06-12 Thread Tushar Behera
On Wed, Jun 11, 2014 at 10:20 PM, Kevin Hilman khil...@linaro.org wrote:
 Tushar Behera tusha...@samsung.com writes:

 When the output clock of AUDSS mux is disabled, we are getting kernel
 oops while doing a clk_get() on other clocks provided by AUDSS.

 Though user manual doesn't specify this dependency, we came across
 this issue while disabling the parent of AUDSS mux clocks.

 Keeping the parents of AUDSS mux always enabled fixes this issue.

 While this patch works (and fixes the boot problem for me), it seems
 like it's papering over the real problem.


Thanks for testing.

 Seems like the right fix is actually modelling the clocks properly so
 that enabling a child clock ensures that the parent is also enabled.


Patch 2/3 was to ensure we have proper clock tree defined for
Exynos5420. While testing with audio disabled, that patch alone fixed
the issue. But when audio was enabled (and hence I2S0 was trying to
access the clocks), we got some kernel oops during late booting, hence
I came up this solution.

The solution might be a little half-baked because of the urgency to
push the fix, but will try to dig more into the issue on Monday when I
resume office.

 Kevin

Thanks,
--
Tushar
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   4   5   6   7   8   >