All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-20 21:13 ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel, Andrew Bresticker

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 <abrestic@chromium.org>
---
 drivers/clk/samsung/clk-exynos-audss.c | 71 +++++++++++++++++++++++++++-------
 1 file changed, 58 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..7571e88 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,29 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
 	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
+		dev_err(&pdev->dev, "could not allocate clk lookup table\n");
+		return -ENOMEM;
 	}
 
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
+				&clk_data);
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -128,8 +135,46 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 #endif
 
 	pr_info("Exynos: Audss: clock setup completed\n");
+
+	return 0;
+}
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	of_clk_del_provider(pdev->dev.of_node);
+
+	return 0;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __init exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
+MODULE_DESCRIPTION("Exynos AudioSS Clock Controller");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4


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

* [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-20 21:13 ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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 <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 drivers/clk/samsung/clk-exynos-audss.c | 71 +++++++++++++++++++++++++++-------
 1 file changed, 58 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..7571e88 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,29 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
 	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
+		dev_err(&pdev->dev, "could not allocate clk lookup table\n");
+		return -ENOMEM;
 	}
 
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
+				&clk_data);
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -128,8 +135,46 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 #endif
 
 	pr_info("Exynos: Audss: clock setup completed\n");
+
+	return 0;
+}
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	of_clk_del_provider(pdev->dev.of_node);
+
+	return 0;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __init exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>");
+MODULE_DESCRIPTION("Exynos AudioSS Clock Controller");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-20 21:13 ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

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 <abrestic@chromium.org>
---
 drivers/clk/samsung/clk-exynos-audss.c | 71 +++++++++++++++++++++++++++-------
 1 file changed, 58 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..7571e88 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,29 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
 	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
+		dev_err(&pdev->dev, "could not allocate clk lookup table\n");
+		return -ENOMEM;
 	}
 
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
+				&clk_data);
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -128,8 +135,46 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 #endif
 
 	pr_info("Exynos: Audss: clock setup completed\n");
+
+	return 0;
+}
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	of_clk_del_provider(pdev->dev.of_node);
+
+	return 0;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __init exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
+MODULE_DESCRIPTION("Exynos AudioSS Clock Controller");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4

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

* [PATCH 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
  2013-09-20 21:13 ` Andrew Bresticker
  (?)
@ 2013-09-20 21:13   ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel, Andrew Bresticker

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 33 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 ++++++++++++----
 2 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..d51a2f9 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,23 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+Optional Properties:
+
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +52,27 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller@3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with audio bus input clock
+	   specified is listed below.
 
 clock_audss: audss-clock-controller@3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 138>;
+	clock-names = "sclk_audio";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 7571e88..aac5342 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -66,6 +62,10 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 /* register exynos_audss clocks */
 static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
+	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;
 	struct resource *res;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -88,11 +88,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
 				&clk_data);
 
+	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);
 	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,
@@ -126,8 +138,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 #ifdef CONFIG_PM_SLEEP
-- 
1.8.4


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

* [PATCH 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 33 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 ++++++++++++----
 2 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..d51a2f9 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,23 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+Optional Properties:
+
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +52,27 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller@3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with audio bus input clock
+	   specified is listed below.
 
 clock_audss: audss-clock-controller@3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 138>;
+	clock-names = "sclk_audio";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 7571e88..aac5342 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -66,6 +62,10 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 /* register exynos_audss clocks */
 static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
+	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;
 	struct resource *res;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -88,11 +88,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
 				&clk_data);
 
+	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);
 	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,
@@ -126,8 +138,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 #ifdef CONFIG_PM_SLEEP
-- 
1.8.4


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

* [PATCH 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 33 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 ++++++++++++----
 2 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..d51a2f9 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,23 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+Optional Properties:
+
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +52,27 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller at 3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with audio bus input clock
+	   specified is listed below.
 
 clock_audss: audss-clock-controller at 3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 138>;
+	clock-names = "sclk_audio";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 7571e88..aac5342 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -66,6 +62,10 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 /* register exynos_audss clocks */
 static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
+	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;
 	struct resource *res;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -88,11 +88,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
 				&clk_data);
 
+	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);
 	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,
@@ -126,8 +138,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 #ifdef CONFIG_PM_SLEEP
-- 
1.8.4

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

* [PATCH 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel, Andrew Bresticker

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4


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

* [PATCH 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4

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

* [PATCH 4/6] ARM: dts: exynos5250: add sclk_pcm_in to audss clock controller
  2013-09-20 21:13 ` Andrew Bresticker
  (?)
@ 2013-09-20 21:13   ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel, Andrew Bresticker

The parent of sclk_pcm in the AudioSS block is div_pcm0.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..bedc7a8 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 160>;
+		clock-names = "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4


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

* [PATCH 4/6] ARM: dts: exynos5250: add sclk_pcm_in to audss clock controller
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel

The parent of sclk_pcm in the AudioSS block is div_pcm0.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..bedc7a8 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 160>;
+		clock-names = "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4

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

* [PATCH 4/6] ARM: dts: exynos5250: add sclk_pcm_in to audss clock controller
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

The parent of sclk_pcm in the AudioSS block is div_pcm0.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..bedc7a8 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 160>;
+		clock-names = "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4

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

* [PATCH 5/6] clk: exynos-audss: add support for Exynos 5420
  2013-09-20 21:13 ` Andrew Bresticker
  (?)
@ 2013-09-20 21:13   ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel, Andrew Bresticker

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 Documentation/devicetree/bindings/clock/clk-exynos-audss.txt | 7 +++++--
 drivers/clk/samsung/clk-exynos-audss.c                       | 8 ++++++++
 include/dt-bindings/clk/exynos-audss-clk.h                   | 3 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index d51a2f9..a10c648 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -51,6 +53,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index aac5342..07c8dbd 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -145,6 +145,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (of_device_is_compatible(pdev->dev.of_node,
+					"samsung,exynos5420-audss-clock")) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
@@ -164,6 +171,7 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 static const struct of_device_id exynos_audss_clk_of_match[] = {
 	{ .compatible = "samsung,exynos4210-audss-clock", },
 	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{ .compatible = "samsung,exynos5420-audss-clock", },
 	{},
 };
 
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4


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

* [PATCH 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 Documentation/devicetree/bindings/clock/clk-exynos-audss.txt | 7 +++++--
 drivers/clk/samsung/clk-exynos-audss.c                       | 8 ++++++++
 include/dt-bindings/clk/exynos-audss-clk.h                   | 3 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index d51a2f9..a10c648 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -51,6 +53,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index aac5342..07c8dbd 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -145,6 +145,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (of_device_is_compatible(pdev->dev.of_node,
+					"samsung,exynos5420-audss-clock")) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
@@ -164,6 +171,7 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 static const struct of_device_id exynos_audss_clk_of_match[] = {
 	{ .compatible = "samsung,exynos4210-audss-clock", },
 	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{ .compatible = "samsung,exynos5420-audss-clock", },
 	{},
 };
 
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4

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

* [PATCH 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 Documentation/devicetree/bindings/clock/clk-exynos-audss.txt | 7 +++++--
 drivers/clk/samsung/clk-exynos-audss.c                       | 8 ++++++++
 include/dt-bindings/clk/exynos-audss-clk.h                   | 3 ++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index d51a2f9..a10c648 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -51,6 +53,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index aac5342..07c8dbd 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -145,6 +145,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (of_device_is_compatible(pdev->dev.of_node,
+					"samsung,exynos5420-audss-clock")) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
@@ -164,6 +171,7 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 static const struct of_device_id exynos_audss_clk_of_match[] = {
 	{ .compatible = "samsung,exynos4210-audss-clock", },
 	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{ .compatible = "samsung,exynos5420-audss-clock", },
 	{},
 };
 
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4

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

* [PATCH 6/6] ARM: dts: exynos5420: add sclk_pcm_in to audss clock controller
  2013-09-20 21:13 ` Andrew Bresticker
  (?)
@ 2013-09-20 21:13   ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel, Andrew Bresticker

The parent of sclk_pcm in the AudioSS block is sclk_maupcm0.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..339ab93 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 148>, <&clock 149>;
+		clock-names = "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec@11000000 {
-- 
1.8.4


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

* [PATCH 6/6] ARM: dts: exynos5420: add sclk_pcm_in to audss clock controller
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tomasz Figa,
	Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel

The parent of sclk_pcm in the AudioSS block is sclk_maupcm0.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..339ab93 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 148>, <&clock 149>;
+		clock-names = "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec@11000000 {
-- 
1.8.4


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

* [PATCH 6/6] ARM: dts: exynos5420: add sclk_pcm_in to audss clock controller
@ 2013-09-20 21:13   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-20 21:13 UTC (permalink / raw)
  To: linux-arm-kernel

The parent of sclk_pcm in the AudioSS block is sclk_maupcm0.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..339ab93 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 148>, <&clock 149>;
+		clock-names = "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec at 11000000 {
-- 
1.8.4

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

* Re: [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-21 12:50   ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 12:50 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Rob Herring, Pawel Moll, Mark Rutland,
	Stephen Warren, Ian Campbell, Rob Landley, Kukjin Kim,
	Russell King, Mike Turquette, Grant Likely, Sachin Kamat,
	Jiri Kosina, Rahul Sharma, Leela Krishna Amudala, Stephen Boyd,
	Tomasz Figa, Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel

Hi Andrew,

This patch looks good overall, but I have some minor comments inline.

On Friday 20 of September 2013 14:13:52 Andrew Bresticker wrote:
> 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 <abrestic@chromium.org>
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 71
> +++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 13
> deletions(-)
[snip]
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	return 0;
>  }

Don't we need to unregister all the registered clocks in remove? This also 
leads to another question: Do we even need removal support for this 
driver?

> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -		exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -		exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +	{ .compatible = "samsung,exynos4210-audss-clock", },
> +	{ .compatible = "samsung,exynos5250-audss-clock", },
> +	{},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +	.driver	= {
> +		.name = "exynos-audss-clk",
> +		.owner = THIS_MODULE,
> +		.of_match_table = exynos_audss_clk_of_match,
> +	},
> +	.probe = exynos_audss_clk_probe,
> +	.remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +	return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);

Does it need to be core_initcall? Drivers depending on clocks provided by 
this driver should be able to defer probing if they are probed before this 
driver.

Then you would be able to simply use module_platform_driver() below.

> +static void __init exynos_audss_clk_exit(void)
> +{
> +	platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
> +MODULE_DESCRIPTION("Exynos AudioSS Clock Controller");

nit: IMHO Audio Subsystem instead of AudioSS would be more meaningful.

> +MODULE_LICENSE("GPL");

This should be GPL v2.

Best regards,
Tomasz


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

* Re: [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-21 12:50   ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 12:50 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	Rob Landley, Kukjin Kim, Russell King, Mike Turquette,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Stephen Boyd, Tomasz Figa, Tushar Behera,
	Yadwinder Singh Brar, Doug Anderson, Padmavathi Venna,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA

Hi Andrew,

This patch looks good overall, but I have some minor comments inline.

On Friday 20 of September 2013 14:13:52 Andrew Bresticker wrote:
> 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 <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 71
> +++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 13
> deletions(-)
[snip]
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	return 0;
>  }

Don't we need to unregister all the registered clocks in remove? This also 
leads to another question: Do we even need removal support for this 
driver?

> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -		exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -		exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +	{ .compatible = "samsung,exynos4210-audss-clock", },
> +	{ .compatible = "samsung,exynos5250-audss-clock", },
> +	{},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +	.driver	= {
> +		.name = "exynos-audss-clk",
> +		.owner = THIS_MODULE,
> +		.of_match_table = exynos_audss_clk_of_match,
> +	},
> +	.probe = exynos_audss_clk_probe,
> +	.remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +	return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);

Does it need to be core_initcall? Drivers depending on clocks provided by 
this driver should be able to defer probing if they are probed before this 
driver.

Then you would be able to simply use module_platform_driver() below.

> +static void __init exynos_audss_clk_exit(void)
> +{
> +	platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>");
> +MODULE_DESCRIPTION("Exynos AudioSS Clock Controller");

nit: IMHO Audio Subsystem instead of AudioSS would be more meaningful.

> +MODULE_LICENSE("GPL");

This should be GPL v2.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-21 12:50   ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 12:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

This patch looks good overall, but I have some minor comments inline.

On Friday 20 of September 2013 14:13:52 Andrew Bresticker wrote:
> 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 <abrestic@chromium.org>
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 71
> +++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 13
> deletions(-)
[snip]
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	return 0;
>  }

Don't we need to unregister all the registered clocks in remove? This also 
leads to another question: Do we even need removal support for this 
driver?

> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -		exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -		exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +	{ .compatible = "samsung,exynos4210-audss-clock", },
> +	{ .compatible = "samsung,exynos5250-audss-clock", },
> +	{},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +	.driver	= {
> +		.name = "exynos-audss-clk",
> +		.owner = THIS_MODULE,
> +		.of_match_table = exynos_audss_clk_of_match,
> +	},
> +	.probe = exynos_audss_clk_probe,
> +	.remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +	return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);

Does it need to be core_initcall? Drivers depending on clocks provided by 
this driver should be able to defer probing if they are probed before this 
driver.

Then you would be able to simply use module_platform_driver() below.

> +static void __init exynos_audss_clk_exit(void)
> +{
> +	platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
> +MODULE_DESCRIPTION("Exynos AudioSS Clock Controller");

nit: IMHO Audio Subsystem instead of AudioSS would be more meaningful.

> +MODULE_LICENSE("GPL");

This should be GPL v2.

Best regards,
Tomasz

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

* Re: [PATCH 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-21 15:12     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrew Bresticker, linux-samsung-soc, Mark Rutland,
	Yadwinder Singh Brar, linux-doc, Tomasz Figa, linux-kernel,
	Tushar Behera, Kukjin Kim, Russell King, Sachin Kamat,
	Stephen Warren, Grant Likely, devicetree, Pawel Moll,
	Ian Campbell, Rob Herring, Mike Turquette, Rahul Sharma,
	Padmavathi Venna, Jiri Kosina, Stephen Boyd, Doug Anderson,
	Leela Krishna Amudala, Rob Landley

Hi Andrew,

On Friday 20 of September 2013 14:13:53 Andrew Bresticker wrote:
> This allows the input clocks to the Exynos AudioSS block to be
> specified via device-tree bindings.  Default names will be used
> when an input clock is not given.
[snip]
> +Optional Properties:
> +
> +- clocks:
> +  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss.
> "fin_pll" +    is used if not specified.
> +  - pll_in: Input PLL to the AudioSS block, parent of mout_audss.
> "fout_epll" +    is used if not specified.
> +  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if
> not +    specified.
> +  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is
> used if +    not specified.
> +  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if
> not +    specified.
> +
> +- clock-names: Aliases for the above clocks. They should be "pll_ref",
> +  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.

I'd say that it should be preferred to specify all the input clocks 
appropriate for particular SoCs to fully represent the hardware. So the 
properties above should be marked as required (depending on SoC probably).

The fallback to default names in the driver should stay, though, to 
support older device trees.

Best regards,
Tomasz


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

* Re: [PATCH 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-21 15:12     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:12 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Andrew Bresticker, linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	Mark Rutland, Yadwinder Singh Brar,
	linux-doc-u79uwXL29TY76Z2rM5mHXA, Tomasz Figa,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Tushar Behera, Kukjin Kim,
	Russell King, Sachin Kamat, Stephen Warren, Grant Likely,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Pawel Moll, Ian Campbell,
	Rob Herring, Mike Turquette, Rahul Sharma, Padmavathi Venna,
	Jiri Kosina, Stephen Boyd, Doug Anderson, Leela

Hi Andrew,

On Friday 20 of September 2013 14:13:53 Andrew Bresticker wrote:
> This allows the input clocks to the Exynos AudioSS block to be
> specified via device-tree bindings.  Default names will be used
> when an input clock is not given.
[snip]
> +Optional Properties:
> +
> +- clocks:
> +  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss.
> "fin_pll" +    is used if not specified.
> +  - pll_in: Input PLL to the AudioSS block, parent of mout_audss.
> "fout_epll" +    is used if not specified.
> +  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if
> not +    specified.
> +  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is
> used if +    not specified.
> +  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if
> not +    specified.
> +
> +- clock-names: Aliases for the above clocks. They should be "pll_ref",
> +  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.

I'd say that it should be preferred to specify all the input clocks 
appropriate for particular SoCs to fully represent the hardware. So the 
properties above should be marked as required (depending on SoC probably).

The fallback to default names in the driver should stay, though, to 
support older device trees.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-21 15:12     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:12 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

On Friday 20 of September 2013 14:13:53 Andrew Bresticker wrote:
> This allows the input clocks to the Exynos AudioSS block to be
> specified via device-tree bindings.  Default names will be used
> when an input clock is not given.
[snip]
> +Optional Properties:
> +
> +- clocks:
> +  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss.
> "fin_pll" +    is used if not specified.
> +  - pll_in: Input PLL to the AudioSS block, parent of mout_audss.
> "fout_epll" +    is used if not specified.
> +  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if
> not +    specified.
> +  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is
> used if +    not specified.
> +  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if
> not +    specified.
> +
> +- clock-names: Aliases for the above clocks. They should be "pll_ref",
> +  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.

I'd say that it should be preferred to specify all the input clocks 
appropriate for particular SoCs to fully represent the hardware. So the 
properties above should be marked as required (depending on SoC probably).

The fallback to default names in the driver should stay, though, to 
support older device trees.

Best regards,
Tomasz

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

* Re: [PATCH 4/6] ARM: dts: exynos5250: add sclk_pcm_in to audss clock controller
  2013-09-20 21:13   ` Andrew Bresticker
  (?)
@ 2013-09-21 15:13     ` Tomasz Figa
  -1 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:13 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Rob Herring, Pawel Moll, Mark Rutland,
	Stephen Warren, Ian Campbell, Rob Landley, Kukjin Kim,
	Russell King, Mike Turquette, Grant Likely, Sachin Kamat,
	Jiri Kosina, Rahul Sharma, Leela Krishna Amudala, Stephen Boyd,
	Tomasz Figa, Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel

Hi Andrew,

On Friday 20 of September 2013 14:13:55 Andrew Bresticker wrote:
> The parent of sclk_pcm in the AudioSS block is div_pcm0.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  arch/arm/boot/dts/exynos5250.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5250.dtsi
> b/arch/arm/boot/dts/exynos5250.dtsi index 7d7cc77..bedc7a8 100644
> --- a/arch/arm/boot/dts/exynos5250.dtsi
> +++ b/arch/arm/boot/dts/exynos5250.dtsi
> @@ -88,6 +88,8 @@
>  		compatible = "samsung,exynos5250-audss-clock";
>  		reg = <0x03810000 0x0C>;
>  		#clock-cells = <1>;
> +		clocks = <&clock 160>;
> +		clock-names = "sclk_pcm_in";

IMHO it would be reasonable to explicitly specify all the input clocks 
here.

Best regards,
Tomasz


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

* Re: [PATCH 4/6] ARM: dts: exynos5250: add sclk_pcm_in to audss clock controller
@ 2013-09-21 15:13     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:13 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Rob Herring, Pawel Moll, Mark Rutland,
	Stephen Warren, Ian Campbell, Rob Landley, Kukjin Kim,
	Russell King, Mike Turquette, Grant Likely, Sachin Kamat,
	Jiri Kosina, Rahul Sharma, Leela Krishna Amudala, Stephen Boyd,
	Tomasz Figa, Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc

Hi Andrew,

On Friday 20 of September 2013 14:13:55 Andrew Bresticker wrote:
> The parent of sclk_pcm in the AudioSS block is div_pcm0.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  arch/arm/boot/dts/exynos5250.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5250.dtsi
> b/arch/arm/boot/dts/exynos5250.dtsi index 7d7cc77..bedc7a8 100644
> --- a/arch/arm/boot/dts/exynos5250.dtsi
> +++ b/arch/arm/boot/dts/exynos5250.dtsi
> @@ -88,6 +88,8 @@
>  		compatible = "samsung,exynos5250-audss-clock";
>  		reg = <0x03810000 0x0C>;
>  		#clock-cells = <1>;
> +		clocks = <&clock 160>;
> +		clock-names = "sclk_pcm_in";

IMHO it would be reasonable to explicitly specify all the input clocks 
here.

Best regards,
Tomasz

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

* [PATCH 4/6] ARM: dts: exynos5250: add sclk_pcm_in to audss clock controller
@ 2013-09-21 15:13     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

On Friday 20 of September 2013 14:13:55 Andrew Bresticker wrote:
> The parent of sclk_pcm in the AudioSS block is div_pcm0.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  arch/arm/boot/dts/exynos5250.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/exynos5250.dtsi
> b/arch/arm/boot/dts/exynos5250.dtsi index 7d7cc77..bedc7a8 100644
> --- a/arch/arm/boot/dts/exynos5250.dtsi
> +++ b/arch/arm/boot/dts/exynos5250.dtsi
> @@ -88,6 +88,8 @@
>  		compatible = "samsung,exynos5250-audss-clock";
>  		reg = <0x03810000 0x0C>;
>  		#clock-cells = <1>;
> +		clocks = <&clock 160>;
> +		clock-names = "sclk_pcm_in";

IMHO it would be reasonable to explicitly specify all the input clocks 
here.

Best regards,
Tomasz

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

* Re: [PATCH 5/6] clk: exynos-audss: add support for Exynos 5420
  2013-09-20 21:13   ` Andrew Bresticker
  (?)
@ 2013-09-21 15:17     ` Tomasz Figa
  -1 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:17 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrew Bresticker, linux-samsung-soc, Mark Rutland,
	Yadwinder Singh Brar, linux-doc, Tomasz Figa, linux-kernel,
	Tushar Behera, Kukjin Kim, Russell King, Sachin Kamat,
	Stephen Warren, Grant Likely, devicetree, Pawel Moll,
	Ian Campbell, Rob Herring, Mike Turquette, Rahul Sharma,
	Padmavathi Venna, Jiri Kosina, Stephen Boyd, Doug Anderson,
	Leela Krishna Amudala, Rob Landley

Hi Andrew,

On Friday 20 of September 2013 14:13:56 Andrew Bresticker wrote:
> The AudioSS block on Exynos 5420 has an additional clock gate for the
> ADMA bus clock.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  Documentation/devicetree/bindings/clock/clk-exynos-audss.txt | 7
> +++++-- drivers/clk/samsung/clk-exynos-audss.c                       |
> 8 ++++++++ include/dt-bindings/clk/exynos-audss-clk.h                  
> | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-)
[snip]
> +	if (of_device_is_compatible(pdev->dev.of_node,
> +					"samsung,exynos5420-audss-clock")) 
{

I don't really like using such string based conditions in the code, but I 
guess it's just a matter of preference.

I'd introduce an enum to represent supported variants and put them into 
the OF match table or maybe even a struct that would have a bool named 
has_adma_clock, true for Exynos5420 variant.

Best regards,
Tomasz


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

* Re: [PATCH 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-21 15:17     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:17 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrew Bresticker, linux-samsung-soc, Mark Rutland,
	Yadwinder Singh Brar, linux-doc, Tomasz Figa, linux-kernel,
	Tushar Behera, Kukjin Kim, Russell King, Sachin Kamat,
	Stephen Warren, Grant Likely, devicetree, Pawel Moll,
	Ian Campbell, Rob Herring, Mike Turquette, Rahul Sharma,
	Padmavathi Venna, Jiri Kosina, Stephen Boyd, Doug Anderson,
	Leela

Hi Andrew,

On Friday 20 of September 2013 14:13:56 Andrew Bresticker wrote:
> The AudioSS block on Exynos 5420 has an additional clock gate for the
> ADMA bus clock.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  Documentation/devicetree/bindings/clock/clk-exynos-audss.txt | 7
> +++++-- drivers/clk/samsung/clk-exynos-audss.c                       |
> 8 ++++++++ include/dt-bindings/clk/exynos-audss-clk.h                  
> | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-)
[snip]
> +	if (of_device_is_compatible(pdev->dev.of_node,
> +					"samsung,exynos5420-audss-clock")) 
{

I don't really like using such string based conditions in the code, but I 
guess it's just a matter of preference.

I'd introduce an enum to represent supported variants and put them into 
the OF match table or maybe even a struct that would have a bool named 
has_adma_clock, true for Exynos5420 variant.

Best regards,
Tomasz


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

* [PATCH 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-21 15:17     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

On Friday 20 of September 2013 14:13:56 Andrew Bresticker wrote:
> The AudioSS block on Exynos 5420 has an additional clock gate for the
> ADMA bus clock.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  Documentation/devicetree/bindings/clock/clk-exynos-audss.txt | 7
> +++++-- drivers/clk/samsung/clk-exynos-audss.c                       |
> 8 ++++++++ include/dt-bindings/clk/exynos-audss-clk.h                  
> | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-)
[snip]
> +	if (of_device_is_compatible(pdev->dev.of_node,
> +					"samsung,exynos5420-audss-clock")) 
{

I don't really like using such string based conditions in the code, but I 
guess it's just a matter of preference.

I'd introduce an enum to represent supported variants and put them into 
the OF match table or maybe even a struct that would have a bool named 
has_adma_clock, true for Exynos5420 variant.

Best regards,
Tomasz

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

* Re: [PATCH 6/6] ARM: dts: exynos5420: add sclk_pcm_in to audss clock controller
@ 2013-09-21 15:18     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:18 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Rob Herring, Pawel Moll, Mark Rutland,
	Stephen Warren, Ian Campbell, Rob Landley, Kukjin Kim,
	Russell King, Mike Turquette, Grant Likely, Sachin Kamat,
	Jiri Kosina, Rahul Sharma, Leela Krishna Amudala, Stephen Boyd,
	Tomasz Figa, Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel

Hi Andrew,

On Friday 20 of September 2013 14:13:57 Andrew Bresticker wrote:
> The parent of sclk_pcm in the AudioSS block is sclk_maupcm0.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/exynos5420.dtsi
> b/arch/arm/boot/dts/exynos5420.dtsi index d537cd7..339ab93 100644
> --- a/arch/arm/boot/dts/exynos5420.dtsi
> +++ b/arch/arm/boot/dts/exynos5420.dtsi
> @@ -72,8 +72,8 @@
>  		compatible = "samsung,exynos5420-audss-clock";
>  		reg = <0x03810000 0x0C>;
>  		#clock-cells = <1>;
> -		clocks = <&clock 148>;
> -		clock-names = "sclk_audio";
> +		clocks = <&clock 148>, <&clock 149>;
> +		clock-names = "sclk_audio", "sclk_pcm_in";

Same note as for Exynos 5250. I think it would be more reasonable to 
specify all the input clocks here.

Best regards,
Tomasz


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

* Re: [PATCH 6/6] ARM: dts: exynos5420: add sclk_pcm_in to audss clock controller
@ 2013-09-21 15:18     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:18 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	Rob Landley, Kukjin Kim, Russell King, Mike Turquette,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Stephen Boyd, Tomasz Figa, Tushar Behera,
	Yadwinder Singh Brar, Doug Anderson, Padmavathi Venna,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA

Hi Andrew,

On Friday 20 of September 2013 14:13:57 Andrew Bresticker wrote:
> The parent of sclk_pcm in the AudioSS block is sclk_maupcm0.
> 
> Signed-off-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>  arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/exynos5420.dtsi
> b/arch/arm/boot/dts/exynos5420.dtsi index d537cd7..339ab93 100644
> --- a/arch/arm/boot/dts/exynos5420.dtsi
> +++ b/arch/arm/boot/dts/exynos5420.dtsi
> @@ -72,8 +72,8 @@
>  		compatible = "samsung,exynos5420-audss-clock";
>  		reg = <0x03810000 0x0C>;
>  		#clock-cells = <1>;
> -		clocks = <&clock 148>;
> -		clock-names = "sclk_audio";
> +		clocks = <&clock 148>, <&clock 149>;
> +		clock-names = "sclk_audio", "sclk_pcm_in";

Same note as for Exynos 5250. I think it would be more reasonable to 
specify all the input clocks here.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 6/6] ARM: dts: exynos5420: add sclk_pcm_in to audss clock controller
@ 2013-09-21 15:18     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:18 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

On Friday 20 of September 2013 14:13:57 Andrew Bresticker wrote:
> The parent of sclk_pcm in the AudioSS block is sclk_maupcm0.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/exynos5420.dtsi
> b/arch/arm/boot/dts/exynos5420.dtsi index d537cd7..339ab93 100644
> --- a/arch/arm/boot/dts/exynos5420.dtsi
> +++ b/arch/arm/boot/dts/exynos5420.dtsi
> @@ -72,8 +72,8 @@
>  		compatible = "samsung,exynos5420-audss-clock";
>  		reg = <0x03810000 0x0C>;
>  		#clock-cells = <1>;
> -		clocks = <&clock 148>;
> -		clock-names = "sclk_audio";
> +		clocks = <&clock 148>, <&clock 149>;
> +		clock-names = "sclk_audio", "sclk_pcm_in";

Same note as for Exynos 5250. I think it would be more reasonable to 
specify all the input clocks here.

Best regards,
Tomasz

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

* Re: [PATCH 3/6] clk: exynos5250: add clock ID for div_pcm0
  2013-09-20 21:13   ` Andrew Bresticker
  (?)
@ 2013-09-21 15:19     ` Tomasz Figa
  -1 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:19 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Rob Herring, Pawel Moll, Mark Rutland,
	Stephen Warren, Ian Campbell, Rob Landley, Kukjin Kim,
	Russell King, Mike Turquette, Grant Likely, Sachin Kamat,
	Jiri Kosina, Rahul Sharma, Leela Krishna Amudala, Stephen Boyd,
	Tomasz Figa, Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel

Hi Andrew,

On Friday 20 of September 2013 14:13:54 Andrew Bresticker wrote:
> There is no gate for the PCM clock input to the AudioSS block, so
> the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
> we can reference it in device trees.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
>  drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Tomasz Figa <t.figa@samsung.com>

Best regards,
Tomasz


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

* Re: [PATCH 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-21 15:19     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:19 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Rob Herring, Pawel Moll, Mark Rutland,
	Stephen Warren, Ian Campbell, Rob Landley, Kukjin Kim,
	Russell King, Mike Turquette, Grant Likely, Sachin Kamat,
	Jiri Kosina, Rahul Sharma, Leela Krishna Amudala, Stephen Boyd,
	Tomasz Figa, Tushar Behera, Yadwinder Singh Brar, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc

Hi Andrew,

On Friday 20 of September 2013 14:13:54 Andrew Bresticker wrote:
> There is no gate for the PCM clock input to the AudioSS block, so
> the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
> we can reference it in device trees.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
>  drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Tomasz Figa <t.figa@samsung.com>

Best regards,
Tomasz

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

* [PATCH 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-21 15:19     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-21 15:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

On Friday 20 of September 2013 14:13:54 Andrew Bresticker wrote:
> There is no gate for the PCM clock input to the AudioSS block, so
> the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
> we can reference it in device trees.
> 
> Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
> ---
>  Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
>  drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Tomasz Figa <t.figa@samsung.com>

Best regards,
Tomasz

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

* Re: [PATCH 1/6] clk: exynos-audss: convert to platform device
  2013-09-21 12:50   ` Tomasz Figa
@ 2013-09-23 21:25     ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-23 21:25 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Mark Rutland, Yadwinder Singh Brar, linux-doc, Padmavathi Venna,
	Tomasz Figa, linux-kernel, Tushar Behera, linux-samsung-soc,
	Russell King, Sachin Kamat, Stephen Warren, Grant Likely,
	devicetree, Pawel Moll, Ian Campbell, Rob Herring, Kukjin Kim,
	Mike Turquette, linux-arm-kernel, Rahul Sharma, Jiri Kosina

Hi Tomasz,

>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>> +{
>> +     of_clk_del_provider(pdev->dev.of_node);
>> +
>> +     return 0;
>>  }
>
> Don't we need to unregister all the registered clocks in remove? This also
> leads to another question: Do we even need removal support for this
> driver?

Agreed - I don't think we should support removal of this device, but
it looks like __device_release_driver() just ignores the lack of a
remove callback or the return value from remove.  I suppose we could
just yell that removal is not supported if it is ever attempted.

>> +static int __init exynos_audss_clk_init(void)
>> +{
>> +     return platform_driver_register(&exynos_audss_clk_driver);
>> +}
>> +core_initcall(exynos_audss_clk_init);
>
> Does it need to be core_initcall? Drivers depending on clocks provided by
> this driver should be able to defer probing if they are probed before this
> driver.

Unfortunately there are a couple of issues with making this a module_initcall:
    1. On the Exynos5420, the AudioSS block provides the apb_pclk gate
for the ADMA bus, which is probed at postcore_initcall time and does
not support deferred probing, and
    2. the common clock framework doesn't differentiate between the
clock not being specified at all and the clock being specified, but
the provider not being registered yet (i.e. the case where probe
deferral would be appropriate) - it just returns ENOENT in both cases.
Given that this driver has no dependencies other than the core clock
controller, it should be fine to initialize at core_initcall time.
Both of these issues could be fixed, though.

Thanks,
Andrew

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

* [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-23 21:25     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-23 21:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Tomasz,

>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>> +{
>> +     of_clk_del_provider(pdev->dev.of_node);
>> +
>> +     return 0;
>>  }
>
> Don't we need to unregister all the registered clocks in remove? This also
> leads to another question: Do we even need removal support for this
> driver?

Agreed - I don't think we should support removal of this device, but
it looks like __device_release_driver() just ignores the lack of a
remove callback or the return value from remove.  I suppose we could
just yell that removal is not supported if it is ever attempted.

>> +static int __init exynos_audss_clk_init(void)
>> +{
>> +     return platform_driver_register(&exynos_audss_clk_driver);
>> +}
>> +core_initcall(exynos_audss_clk_init);
>
> Does it need to be core_initcall? Drivers depending on clocks provided by
> this driver should be able to defer probing if they are probed before this
> driver.

Unfortunately there are a couple of issues with making this a module_initcall:
    1. On the Exynos5420, the AudioSS block provides the apb_pclk gate
for the ADMA bus, which is probed at postcore_initcall time and does
not support deferred probing, and
    2. the common clock framework doesn't differentiate between the
clock not being specified at all and the clock being specified, but
the provider not being registered yet (i.e. the case where probe
deferral would be appropriate) - it just returns ENOENT in both cases.
Given that this driver has no dependencies other than the core clock
controller, it should be fine to initialize at core_initcall time.
Both of these issues could be fixed, though.

Thanks,
Andrew

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

* Re: [PATCH 1/6] clk: exynos-audss: convert to platform device
  2013-09-23 21:25     ` Andrew Bresticker
@ 2013-09-23 21:30       ` Tomasz Figa
  -1 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-23 21:30 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: Mark Rutland, Yadwinder Singh Brar, linux-doc, Padmavathi Venna,
	Tomasz Figa, linux-kernel, Tushar Behera, linux-samsung-soc,
	Russell King, Sachin Kamat, Stephen Warren, Grant Likely,
	devicetree, Pawel Moll, Ian Campbell, Rob Herring, Kukjin Kim,
	Mike Turquette, linux-arm-kernel, Rahul Sharma, Jiri Kosina

On Monday 23 of September 2013 14:25:12 Andrew Bresticker wrote:
> >> +static int __init exynos_audss_clk_init(void)
> >> +{
> >> +     return platform_driver_register(&exynos_audss_clk_driver);
> >> +}
> >> +core_initcall(exynos_audss_clk_init);
> > 
> > Does it need to be core_initcall? Drivers depending on clocks provided
> > by this driver should be able to defer probing if they are probed
> > before this driver.
> 
> Unfortunately there are a couple of issues with making this a
> module_initcall: 1. On the Exynos5420, the AudioSS block provides the
> apb_pclk gate for the ADMA bus, which is probed at postcore_initcall
> time and does not support deferred probing, and

Just out of curiosity, what is this ADMA bus?

Anyway, I'm fine with this, just wanted to make sure that there is a 
reason behind it.

Best regards,
Tomasz

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

* [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-23 21:30       ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-23 21:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 23 of September 2013 14:25:12 Andrew Bresticker wrote:
> >> +static int __init exynos_audss_clk_init(void)
> >> +{
> >> +     return platform_driver_register(&exynos_audss_clk_driver);
> >> +}
> >> +core_initcall(exynos_audss_clk_init);
> > 
> > Does it need to be core_initcall? Drivers depending on clocks provided
> > by this driver should be able to defer probing if they are probed
> > before this driver.
> 
> Unfortunately there are a couple of issues with making this a
> module_initcall: 1. On the Exynos5420, the AudioSS block provides the
> apb_pclk gate for the ADMA bus, which is probed at postcore_initcall
> time and does not support deferred probing, and

Just out of curiosity, what is this ADMA bus?

Anyway, I'm fine with this, just wanted to make sure that there is a 
reason behind it.

Best regards,
Tomasz

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

* Re: [PATCH 1/6] clk: exynos-audss: convert to platform device
  2013-09-23 21:30       ` Tomasz Figa
@ 2013-09-23 21:36         ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-23 21:36 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Mark Rutland, Yadwinder Singh Brar, Padmavathi Venna,
	Tomasz Figa, Doug Anderson, Tushar Behera, linux-samsung-soc,
	Russell King, Sachin Kamat, linux-doc, Grant Likely, devicetree,
	Pawel Moll, Stephen Warren, Rob Herring, Kukjin Kim,
	Mike Turquette, linux-arm-kernel, Rahul Sharma, Ian Campbell,
	Jiri Kosina, Stephen Boyd

On Mon, Sep 23, 2013 at 2:30 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> On Monday 23 of September 2013 14:25:12 Andrew Bresticker wrote:
>> >> +static int __init exynos_audss_clk_init(void)
>> >> +{
>> >> +     return platform_driver_register(&exynos_audss_clk_driver);
>> >> +}
>> >> +core_initcall(exynos_audss_clk_init);
>> >
>> > Does it need to be core_initcall? Drivers depending on clocks provided
>> > by this driver should be able to defer probing if they are probed
>> > before this driver.
>>
>> Unfortunately there are a couple of issues with making this a
>> module_initcall: 1. On the Exynos5420, the AudioSS block provides the
>> apb_pclk gate for the ADMA bus, which is probed at postcore_initcall
>> time and does not support deferred probing, and
>
> Just out of curiosity, what is this ADMA bus?

It's the DMA controller used for PCM and I2S.  Looks like the DMA
nodes aren't in the 5420 device-tree yet...

-Andrew

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

* [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-23 21:36         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-23 21:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 23, 2013 at 2:30 PM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> On Monday 23 of September 2013 14:25:12 Andrew Bresticker wrote:
>> >> +static int __init exynos_audss_clk_init(void)
>> >> +{
>> >> +     return platform_driver_register(&exynos_audss_clk_driver);
>> >> +}
>> >> +core_initcall(exynos_audss_clk_init);
>> >
>> > Does it need to be core_initcall? Drivers depending on clocks provided
>> > by this driver should be able to defer probing if they are probed
>> > before this driver.
>>
>> Unfortunately there are a couple of issues with making this a
>> module_initcall: 1. On the Exynos5420, the AudioSS block provides the
>> apb_pclk gate for the ADMA bus, which is probed at postcore_initcall
>> time and does not support deferred probing, and
>
> Just out of curiosity, what is this ADMA bus?

It's the DMA controller used for PCM and I2S.  Looks like the DMA
nodes aren't in the 5420 device-tree yet...

-Andrew

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

* Re: [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-23 22:50       ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-23 22:50 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: Tomasz Figa, Mark Rutland, Yadwinder Singh Brar, linux-doc,
	Padmavathi Venna, Tomasz Figa, linux-kernel, Tushar Behera,
	linux-samsung-soc, Russell King, Sachin Kamat, Stephen Warren,
	Grant Likely, devicetree, Pawel Moll, Ian Campbell, Rob Herring,
	Kukjin Kim, Mike Turquette, linux-arm-kernel, Rahul Sharma,
	Jiri Kosina

Hi,

On 09/23/2013 11:25 PM, Andrew Bresticker wrote:
>>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>>> +{
>>> +     of_clk_del_provider(pdev->dev.of_node);
>>> +
>>> +     return 0;
>>>   }
>>
>> Don't we need to unregister all the registered clocks in remove? This also
>> leads to another question: Do we even need removal support for this
>> driver?
>
> Agreed - I don't think we should support removal of this device, but
> it looks like __device_release_driver() just ignores the lack of a
> remove callback or the return value from remove.  I suppose we could
> just yell that removal is not supported if it is ever attempted.

That might be a good idea, without proper remove() method deferred
probing will also not work. I'd assume there should be only, e.g.
WARN() in the remove() callback or it should be properly implemented,
with clk_unregister() call for each currently registered clock.

Note that clk_unregister() is currently not implemented and removal
of this driver cannot be properly supported at the moment anyway.

Not sure what's more appropriate, it's probably better to add
clk_unregister() calls. This would be effectively a dead code though,
as long as core_initcall is used.

>>> +static int __init exynos_audss_clk_init(void)
>>> +{
>>> +     return platform_driver_register(&exynos_audss_clk_driver);
>>> +}
>>> +core_initcall(exynos_audss_clk_init);
>>
>> Does it need to be core_initcall? Drivers depending on clocks provided by
>> this driver should be able to defer probing if they are probed before this
>> driver.
>
> Unfortunately there are a couple of issues with making this a module_initcall:
>      1. On the Exynos5420, the AudioSS block provides the apb_pclk gate
> for the ADMA bus, which is probed at postcore_initcall time and does
> not support deferred probing, and
>      2. the common clock framework doesn't differentiate between the
> clock not being specified at all and the clock being specified, but
> the provider not being registered yet (i.e. the case where probe
> deferral would be appropriate) - it just returns ENOENT in both cases.

AFAICS this shouldn't be difficult to improve. I guess it has not been
properly addressed so far because there is currently no properly working
modular clock provider drivers, using the common clock framework, yet.
Unless someone bits me to it, I might have a look at that, as I also found
it a bit it inconvenient.

--
Regards,
Sylwester

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

* Re: [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-23 22:50       ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-23 22:50 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: Tomasz Figa, Mark Rutland, Yadwinder Singh Brar,
	linux-doc-u79uwXL29TY76Z2rM5mHXA, Padmavathi Venna, Tomasz Figa,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Tushar Behera,
	linux-samsung-soc, Russell King, Sachin Kamat, Stephen Warren,
	Grant Likely, devicetree-u79uwXL29TY76Z2rM5mHXA, Pawel Moll,
	Ian Campbell, Rob Herring, Kukjin Kim, Mike Turquette,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rahul Sharma

Hi,

On 09/23/2013 11:25 PM, Andrew Bresticker wrote:
>>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>>> +{
>>> +     of_clk_del_provider(pdev->dev.of_node);
>>> +
>>> +     return 0;
>>>   }
>>
>> Don't we need to unregister all the registered clocks in remove? This also
>> leads to another question: Do we even need removal support for this
>> driver?
>
> Agreed - I don't think we should support removal of this device, but
> it looks like __device_release_driver() just ignores the lack of a
> remove callback or the return value from remove.  I suppose we could
> just yell that removal is not supported if it is ever attempted.

That might be a good idea, without proper remove() method deferred
probing will also not work. I'd assume there should be only, e.g.
WARN() in the remove() callback or it should be properly implemented,
with clk_unregister() call for each currently registered clock.

Note that clk_unregister() is currently not implemented and removal
of this driver cannot be properly supported at the moment anyway.

Not sure what's more appropriate, it's probably better to add
clk_unregister() calls. This would be effectively a dead code though,
as long as core_initcall is used.

>>> +static int __init exynos_audss_clk_init(void)
>>> +{
>>> +     return platform_driver_register(&exynos_audss_clk_driver);
>>> +}
>>> +core_initcall(exynos_audss_clk_init);
>>
>> Does it need to be core_initcall? Drivers depending on clocks provided by
>> this driver should be able to defer probing if they are probed before this
>> driver.
>
> Unfortunately there are a couple of issues with making this a module_initcall:
>      1. On the Exynos5420, the AudioSS block provides the apb_pclk gate
> for the ADMA bus, which is probed at postcore_initcall time and does
> not support deferred probing, and
>      2. the common clock framework doesn't differentiate between the
> clock not being specified at all and the clock being specified, but
> the provider not being registered yet (i.e. the case where probe
> deferral would be appropriate) - it just returns ENOENT in both cases.

AFAICS this shouldn't be difficult to improve. I guess it has not been
properly addressed so far because there is currently no properly working
modular clock provider drivers, using the common clock framework, yet.
Unless someone bits me to it, I might have a look at that, as I also found
it a bit it inconvenient.

--
Regards,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-23 22:50       ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-23 22:50 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 09/23/2013 11:25 PM, Andrew Bresticker wrote:
>>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>>> +{
>>> +     of_clk_del_provider(pdev->dev.of_node);
>>> +
>>> +     return 0;
>>>   }
>>
>> Don't we need to unregister all the registered clocks in remove? This also
>> leads to another question: Do we even need removal support for this
>> driver?
>
> Agreed - I don't think we should support removal of this device, but
> it looks like __device_release_driver() just ignores the lack of a
> remove callback or the return value from remove.  I suppose we could
> just yell that removal is not supported if it is ever attempted.

That might be a good idea, without proper remove() method deferred
probing will also not work. I'd assume there should be only, e.g.
WARN() in the remove() callback or it should be properly implemented,
with clk_unregister() call for each currently registered clock.

Note that clk_unregister() is currently not implemented and removal
of this driver cannot be properly supported at the moment anyway.

Not sure what's more appropriate, it's probably better to add
clk_unregister() calls. This would be effectively a dead code though,
as long as core_initcall is used.

>>> +static int __init exynos_audss_clk_init(void)
>>> +{
>>> +     return platform_driver_register(&exynos_audss_clk_driver);
>>> +}
>>> +core_initcall(exynos_audss_clk_init);
>>
>> Does it need to be core_initcall? Drivers depending on clocks provided by
>> this driver should be able to defer probing if they are probed before this
>> driver.
>
> Unfortunately there are a couple of issues with making this a module_initcall:
>      1. On the Exynos5420, the AudioSS block provides the apb_pclk gate
> for the ADMA bus, which is probed at postcore_initcall time and does
> not support deferred probing, and
>      2. the common clock framework doesn't differentiate between the
> clock not being specified at all and the clock being specified, but
> the provider not being registered yet (i.e. the case where probe
> deferral would be appropriate) - it just returns ENOENT in both cases.

AFAICS this shouldn't be difficult to improve. I guess it has not been
properly addressed so far because there is currently no properly working
modular clock provider drivers, using the common clock framework, yet.
Unless someone bits me to it, I might have a look at that, as I also found
it a bit it inconvenient.

--
Regards,
Sylwester

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

* [PATCH V2 1/6] clk: exynos-audss: convert to platform device
  2013-09-20 21:13 ` Andrew Bresticker
@ 2013-09-24  0:21   ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

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 <abrestic@chromium.org>
---
Changes since v1:
 - add clk_unregister() calls to remove callback
 - fixed minor nits from Tomasz
---
 drivers/clk/samsung/clk-exynos-audss.c | 78 ++++++++++++++++++++++++++++------
 1 file changed, 65 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..c512efd 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,29 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
 	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
+		dev_err(&pdev->dev, "could not allocate clk lookup table\n");
+		return -ENOMEM;
 	}
 
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
+				&clk_data);
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -128,8 +135,53 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 #endif
 
 	pr_info("Exynos: Audss: clock setup completed\n");
+
+	return 0;
+}
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	int i;
+
+	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
+		if (clk_table[i])
+			clk_unregister(clk_table[i]);
+	}
+
+	of_clk_del_provider(pdev->dev.of_node);
+
+	return 0;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __init exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
+MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4


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

* [PATCH V2 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24  0:21   ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-arm-kernel

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 <abrestic@chromium.org>
---
Changes since v1:
 - add clk_unregister() calls to remove callback
 - fixed minor nits from Tomasz
---
 drivers/clk/samsung/clk-exynos-audss.c | 78 ++++++++++++++++++++++++++++------
 1 file changed, 65 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..c512efd 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,29 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
 	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
+		dev_err(&pdev->dev, "could not allocate clk lookup table\n");
+		return -ENOMEM;
 	}
 
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
+				&clk_data);
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -128,8 +135,53 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 #endif
 
 	pr_info("Exynos: Audss: clock setup completed\n");
+
+	return 0;
+}
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	int i;
+
+	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
+		if (clk_table[i])
+			clk_unregister(clk_table[i]);
+	}
+
+	of_clk_del_provider(pdev->dev.of_node);
+
+	return 0;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __init exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
+MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4

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

* [PATCH V2 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
  2013-09-24  0:21   ` Andrew Bresticker
@ 2013-09-24  0:21     ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - listed input clocks as required properties
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 32 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 +++++++++++++----
 2 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..85b9e28 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,21 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +50,28 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller@3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with the input clocks
+           specified.
 
 clock_audss: audss-clock-controller@3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>,
+		<&ext_i2s_clk>;
+	clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in", "cdclk";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index c512efd..afb53de 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -66,6 +62,10 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 /* register exynos_audss clocks */
 static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
+	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;
 	struct resource *res;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -88,11 +88,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
 				&clk_data);
 
+	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);
 	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,
@@ -126,8 +138,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 #ifdef CONFIG_PM_SLEEP
-- 
1.8.4


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

* [PATCH V2 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-24  0:21     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-arm-kernel

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - listed input clocks as required properties
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 32 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 +++++++++++++----
 2 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..85b9e28 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,21 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +50,28 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller at 3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with the input clocks
+           specified.
 
 clock_audss: audss-clock-controller at 3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>,
+		<&ext_i2s_clk>;
+	clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in", "cdclk";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index c512efd..afb53de 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -66,6 +62,10 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 /* register exynos_audss clocks */
 static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
+	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;
 	struct resource *res;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -88,11 +88,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
 				&clk_data);
 
+	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);
 	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,
@@ -126,8 +138,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 #ifdef CONFIG_PM_SLEEP
-- 
1.8.4

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

* [PATCH V2 3/6] clk: exynos5250: add clock ID for div_pcm0
  2013-09-24  0:21   ` Andrew Bresticker
@ 2013-09-24  0:21     ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4


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

* [PATCH V2 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-24  0:21     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-arm-kernel

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4

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

* [PATCH V2 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller
  2013-09-24  0:21   ` Andrew Bresticker
@ 2013-09-24  0:21     ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

Specify pll_ref, pll_in, sclk_audio, and sclk_pcm_in for the AudioSS
clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..35e2838 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>;
+		clock-names = "pll_ref, "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4


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

* [PATCH V2 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller
@ 2013-09-24  0:21     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-arm-kernel

Specify pll_ref, pll_in, sclk_audio, and sclk_pcm_in for the AudioSS
clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..35e2838 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>;
+		clock-names = "pll_ref, "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4

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

* [PATCH V2 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-24  0:21     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - added type enum and made comparison against that instead of compatibility
   string
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt |  7 +++--
 drivers/clk/samsung/clk-exynos-audss.c             | 35 ++++++++++++++++++----
 include/dt-bindings/clk/exynos-audss-clk.h         |  3 +-
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 85b9e28..180e883 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -49,6 +51,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index afb53de..8ccf3788 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,6 +19,12 @@
 
 #include <dt-bindings/clk/exynos-audss-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;
@@ -59,6 +65,16 @@ 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)
 {
@@ -67,6 +83,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	const char *sclk_pcm_p = "sclk_pcm0";
 	struct clk *pll_ref, *pll_in, *cdclk, *sclk_audio, *sclk_pcm_in;
 	struct resource *res;
+	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);
@@ -145,6 +168,12 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (variant == TYPE_EXYNOS5420) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
@@ -168,12 +197,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-	{ .compatible = "samsung,exynos4210-audss-clock", },
-	{ .compatible = "samsung,exynos5250-audss-clock", },
-	{},
-};
-
 static struct platform_driver exynos_audss_clk_driver = {
 	.driver	= {
 		.name = "exynos-audss-clk",
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4


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

* [PATCH V2 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-24  0:21     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Tomasz Figa,
	Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andrew Bresticker

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Changes since v1:
 - added type enum and made comparison against that instead of compatibility
   string
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt |  7 +++--
 drivers/clk/samsung/clk-exynos-audss.c             | 35 ++++++++++++++++++----
 include/dt-bindings/clk/exynos-audss-clk.h         |  3 +-
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 85b9e28..180e883 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -49,6 +51,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index afb53de..8ccf3788 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,6 +19,12 @@
 
 #include <dt-bindings/clk/exynos-audss-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;
@@ -59,6 +65,16 @@ 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)
 {
@@ -67,6 +83,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	const char *sclk_pcm_p = "sclk_pcm0";
 	struct clk *pll_ref, *pll_in, *cdclk, *sclk_audio, *sclk_pcm_in;
 	struct resource *res;
+	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);
@@ -145,6 +168,12 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (variant == TYPE_EXYNOS5420) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
@@ -168,12 +197,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-	{ .compatible = "samsung,exynos4210-audss-clock", },
-	{ .compatible = "samsung,exynos5250-audss-clock", },
-	{},
-};
-
 static struct platform_driver exynos_audss_clk_driver = {
 	.driver	= {
 		.name = "exynos-audss-clk",
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH V2 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-24  0:21     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-arm-kernel

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - added type enum and made comparison against that instead of compatibility
   string
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt |  7 +++--
 drivers/clk/samsung/clk-exynos-audss.c             | 35 ++++++++++++++++++----
 include/dt-bindings/clk/exynos-audss-clk.h         |  3 +-
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 85b9e28..180e883 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -49,6 +51,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index afb53de..8ccf3788 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,6 +19,12 @@
 
 #include <dt-bindings/clk/exynos-audss-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;
@@ -59,6 +65,16 @@ 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)
 {
@@ -67,6 +83,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	const char *sclk_pcm_p = "sclk_pcm0";
 	struct clk *pll_ref, *pll_in, *cdclk, *sclk_audio, *sclk_pcm_in;
 	struct resource *res;
+	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);
@@ -145,6 +168,12 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (variant == TYPE_EXYNOS5420) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
@@ -168,12 +197,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-	{ .compatible = "samsung,exynos4210-audss-clock", },
-	{ .compatible = "samsung,exynos5250-audss-clock", },
-	{},
-};
-
 static struct platform_driver exynos_audss_clk_driver = {
 	.driver	= {
 		.name = "exynos-audss-clk",
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4

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

* [PATCH V2 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller
  2013-09-24  0:21   ` Andrew Bresticker
@ 2013-09-24  0:21     ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

Specify the remaining input clocks (pll_ref, pll_in, and sclk_pcm_in)
for the AudioSS clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..056b55e 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 1>, <&clock 5>, <&clock 148>, <&clock 149>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec@11000000 {
-- 
1.8.4


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

* [PATCH V2 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller
@ 2013-09-24  0:21     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24  0:21 UTC (permalink / raw)
  To: linux-arm-kernel

Specify the remaining input clocks (pll_ref, pll_in, and sclk_pcm_in)
for the AudioSS clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..056b55e 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 1>, <&clock 5>, <&clock 148>, <&clock 149>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec at 11000000 {
-- 
1.8.4

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

* Re: [PATCH V2 1/6] clk: exynos-audss: convert to platform device
  2013-09-24  0:21   ` Andrew Bresticker
  (?)
@ 2013-09-24  9:20     ` Tomasz Figa
  -1 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-24  9:20 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Sylwester Nawrocki, Rob Herring, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Rob Landley,
	Kukjin Kim, Russell King, Mike Turquette, Grant Likely,
	Sachin Kamat, Jiri Kosina, Rahul Sharma, Leela Krishna Amudala,
	Stephen Boyd, Tushar Behera, Doug Anderson, Padmavathi Venna,
	devicetree, linux-doc, linux-arm-kernel, linux-kernel

Hi Andrew,

I'd like to ack this series, but there is one more thing that I think
should be fixed. Please see my comment inline.

On Monday 23 of September 2013 17:21:13 Andrew Bresticker wrote:
> @@ -128,8 +135,53 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>  #endif
>  
>  	pr_info("Exynos: Audss: clock setup completed\n");

nit (not the thing I mentioned above): This (and possibly other uses of
pr_*() could be replaced with dev_*().

> +
> +	return 0;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (clk_table[i])

I believe clk_register_* functions return ERR_PTR() in case of failure,
not NULL, so this should be accounted for either here or at probe time.
Possibly checking for registration error in probe() would be the best
solution, although bloating the code a bit (but what error path isn't?).

Best regards,
Tomasz


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

* Re: [PATCH V2 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24  9:20     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-24  9:20 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Sylwester Nawrocki, Rob Herring, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Rob Landley,
	Kukjin Kim, Russell King, Mike Turquette, Grant Likely,
	Sachin Kamat, Jiri Kosina, Rahul Sharma, Leela Krishna Amudala,
	Stephen Boyd, Tushar Behera, Doug Anderson, Padmavathi Venna,
	devicetree, linux-doc, linux-arm-kernel

Hi Andrew,

I'd like to ack this series, but there is one more thing that I think
should be fixed. Please see my comment inline.

On Monday 23 of September 2013 17:21:13 Andrew Bresticker wrote:
> @@ -128,8 +135,53 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>  #endif
>  
>  	pr_info("Exynos: Audss: clock setup completed\n");

nit (not the thing I mentioned above): This (and possibly other uses of
pr_*() could be replaced with dev_*().

> +
> +	return 0;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (clk_table[i])

I believe clk_register_* functions return ERR_PTR() in case of failure,
not NULL, so this should be accounted for either here or at probe time.
Possibly checking for registration error in probe() would be the best
solution, although bloating the code a bit (but what error path isn't?).

Best regards,
Tomasz

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

* [PATCH V2 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24  9:20     ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-24  9:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

I'd like to ack this series, but there is one more thing that I think
should be fixed. Please see my comment inline.

On Monday 23 of September 2013 17:21:13 Andrew Bresticker wrote:
> @@ -128,8 +135,53 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>  #endif
>  
>  	pr_info("Exynos: Audss: clock setup completed\n");

nit (not the thing I mentioned above): This (and possibly other uses of
pr_*() could be replaced with dev_*().

> +
> +	return 0;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (clk_table[i])

I believe clk_register_* functions return ERR_PTR() in case of failure,
not NULL, so this should be accounted for either here or at probe time.
Possibly checking for registration error in probe() would be the best
solution, although bloating the code a bit (but what error path isn't?).

Best regards,
Tomasz

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

* Re: [PATCH V2 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24  9:35     ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24  9:35 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Tomasz Figa, Rob Herring, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Rob Landley,
	Kukjin Kim, Russell King, Mike Turquette, Grant Likely,
	Sachin Kamat, Jiri Kosina, Rahul Sharma, Leela Krishna Amudala,
	Stephen Boyd, Tushar Behera, Doug Anderson, Padmavathi Venna,
	devicetree, linux-doc, linux-arm-kernel, linux-kernel

Hi,

On 24/09/13 02:21, Andrew Bresticker wrote:
> @@ -62,24 +64,29 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>  
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -	reg_base = of_iomap(np, 0);
> -	if (!reg_base) {
> -		pr_err("%s: failed to map audss registers\n", __func__);
> -		return;
> +	struct resource *res;
> +
> +	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +	clk_table = devm_kzalloc(&pdev->dev,
> +				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>  				GFP_KERNEL);
>  	if (!clk_table) {
> -		pr_err("%s: could not allocate clk lookup table\n", __func__);
> -		return;
> +		dev_err(&pdev->dev, "could not allocate clk lookup table\n");

You could drop this error log, k*alloc() functions already log any errors.

> +		return -ENOMEM;
>  	}
>  
>  	clk_data.clks = clk_table;
>  	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
> +	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
> +				&clk_data);

>  	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>  				mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -128,8 +135,53 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>  #endif
>  
>  	pr_info("Exynos: Audss: clock setup completed\n");
> +
> +	return 0;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (clk_table[i])

This would need to be:
		if (!IS_ERR(clk_table[i]))

Note the clock provider should be unregistered first, to avoid potential
race condition, where the clock provider returns an invalid pointer to
a clock, which has already been unregistered and freed.

I just noticed the sequence in probe needs to be fixed as well. i.e.
clocks should be created with clk_register() before the clock provider
is actually registered. It might warrant a separate patch but it's
probably also fine to make such change part of this patch.

> +			clk_unregister(clk_table[i]);
> +	}
> +
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	return 0;
>  }

--
Thanks,
Sylwester

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

* Re: [PATCH V2 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24  9:35     ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24  9:35 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Tomasz Figa,
	Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel

Hi,

On 24/09/13 02:21, Andrew Bresticker wrote:
> @@ -62,24 +64,29 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>  
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -	reg_base = of_iomap(np, 0);
> -	if (!reg_base) {
> -		pr_err("%s: failed to map audss registers\n", __func__);
> -		return;
> +	struct resource *res;
> +
> +	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +	clk_table = devm_kzalloc(&pdev->dev,
> +				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>  				GFP_KERNEL);
>  	if (!clk_table) {
> -		pr_err("%s: could not allocate clk lookup table\n", __func__);
> -		return;
> +		dev_err(&pdev->dev, "could not allocate clk lookup table\n");

You could drop this error log, k*alloc() functions already log any errors.

> +		return -ENOMEM;
>  	}
>  
>  	clk_data.clks = clk_table;
>  	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
> +	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
> +				&clk_data);

>  	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>  				mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -128,8 +135,53 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>  #endif
>  
>  	pr_info("Exynos: Audss: clock setup completed\n");
> +
> +	return 0;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (clk_table[i])

This would need to be:
		if (!IS_ERR(clk_table[i]))

Note the clock provider should be unregistered first, to avoid potential
race condition, where the clock provider returns an invalid pointer to
a clock, which has already been unregistered and freed.

I just noticed the sequence in probe needs to be fixed as well. i.e.
clocks should be created with clk_register() before the clock provider
is actually registered. It might warrant a separate patch but it's
probably also fine to make such change part of this patch.

> +			clk_unregister(clk_table[i]);
> +	}
> +
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	return 0;
>  }

--
Thanks,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH V2 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24  9:35     ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 24/09/13 02:21, Andrew Bresticker wrote:
> @@ -62,24 +64,29 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>  
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -	reg_base = of_iomap(np, 0);
> -	if (!reg_base) {
> -		pr_err("%s: failed to map audss registers\n", __func__);
> -		return;
> +	struct resource *res;
> +
> +	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +	clk_table = devm_kzalloc(&pdev->dev,
> +				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>  				GFP_KERNEL);
>  	if (!clk_table) {
> -		pr_err("%s: could not allocate clk lookup table\n", __func__);
> -		return;
> +		dev_err(&pdev->dev, "could not allocate clk lookup table\n");

You could drop this error log, k*alloc() functions already log any errors.

> +		return -ENOMEM;
>  	}
>  
>  	clk_data.clks = clk_table;
>  	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
> +	of_clk_add_provider(pdev->dev.of_node, of_clk_src_onecell_get,
> +				&clk_data);

>  	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>  				mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -128,8 +135,53 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>  #endif
>  
>  	pr_info("Exynos: Audss: clock setup completed\n");
> +
> +	return 0;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (clk_table[i])

This would need to be:
		if (!IS_ERR(clk_table[i]))

Note the clock provider should be unregistered first, to avoid potential
race condition, where the clock provider returns an invalid pointer to
a clock, which has already been unregistered and freed.

I just noticed the sequence in probe needs to be fixed as well. i.e.
clocks should be created with clk_register() before the clock provider
is actually registered. It might warrant a separate patch but it's
probably also fine to make such change part of this patch.

> +			clk_unregister(clk_table[i]);
> +	}
> +
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	return 0;
>  }

--
Thanks,
Sylwester

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

* Re: [PATCH V2 1/6] clk: exynos-audss: convert to platform device
  2013-09-24  9:20     ` Tomasz Figa
@ 2013-09-24  9:47       ` Sylwester Nawrocki
  -1 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24  9:47 UTC (permalink / raw)
  To: Tomasz Figa
  Cc: Mark Rutland, linux-doc, Padmavathi Venna, Andrew Bresticker,
	Tushar Behera, linux-samsung-soc, Russell King,
	Leela Krishna Amudala, Ian Campbell, Grant Likely, devicetree,
	Pawel Moll, Stephen Warren, Rob Herring, Kukjin Kim,
	Mike Turquette, Sylwester Nawrocki, linux-arm-kernel,
	Rahul Sharma, Jiri Kosina, Stephen Boyd, Doug Anderson,
	Sachin Kamat

On 24/09/13 11:20, Tomasz Figa wrote:
>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>> +{
>> +	int i;
>> +
>> +	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
>> +		if (clk_table[i])
> 
> I believe clk_register_* functions return ERR_PTR() in case of failure,
> not NULL, so this should be accounted for either here or at probe time.
> Possibly checking for registration error in probe() would be the best
> solution, although bloating the code a bit (but what error path isn't?).

After registering all clocks a loop iterating over all entries of the
clk_table[] array could be added and if any of the entries is ERR_PTR()
either an error could be just logged or the successfully registered
clocks could be freed and probe() could fail. It doesn't really seems
much additional code.

--
Thanks,
Sylwester

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

* [PATCH V2 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24  9:47       ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24  9:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 24/09/13 11:20, Tomasz Figa wrote:
>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>> +{
>> +	int i;
>> +
>> +	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
>> +		if (clk_table[i])
> 
> I believe clk_register_* functions return ERR_PTR() in case of failure,
> not NULL, so this should be accounted for either here or at probe time.
> Possibly checking for registration error in probe() would be the best
> solution, although bloating the code a bit (but what error path isn't?).

After registering all clocks a loop iterating over all entries of the
clk_table[] array could be added and if any of the entries is ERR_PTR()
either an error could be just logged or the successfully registered
clocks could be freed and probe() could fail. It doesn't really seems
much additional code.

--
Thanks,
Sylwester

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

* [PATCH V3 1/6] clk: exynos-audss: convert to platform device
  2013-09-24  0:21   ` Andrew Bresticker
@ 2013-09-24 18:06     ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

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 <abrestic@chromium.org>
---
Changes since v2:
 - add error handling to probe callback
 - fixed ordering of of_clk_{add,del}_provider
 - fixed nits from Tomasz and Sylwester
Changes since v1:
 - add clk_unregister() calls to remove callback
 - fixed minor nits from Tomasz
---
 drivers/clk/samsung/clk-exynos-audss.c | 109 +++++++++++++++++++++++++++------
 1 file changed, 90 insertions(+), 19 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..319c6e4 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,23 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	int i, ret = 0;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
-	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
-	}
-
-	clk_data.clks = clk_table;
-	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+	if (!clk_table)
+		return -ENOMEM;
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -123,13 +124,83 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 				"div_pcm0", CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
+		if (IS_ERR(clk_table[i])) {
+			dev_err(&pdev->dev, "failed to regsiter clock %d\n", i);
+			ret = PTR_ERR(clk_table[i]);
+			goto unregister;
+		}
+	}
+
+	clk_data.clks = clk_table;
+	clk_data.clk_num = EXYNOS_AUDSS_MAX_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;
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
 
-	pr_info("Exynos: Audss: clock setup completed\n");
+	dev_info(&pdev->dev, "setup completed\n");
+
+	return 0;
+
+unregister:
+	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
+		if (!IS_ERR_OR_NULL(clk_table[i]))
+			clk_unregister(clk_table[i]);
+	}
+
+	return ret;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	int i;
+
+	of_clk_del_provider(pdev->dev.of_node);
+
+	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
+		if (!IS_ERR_OR_NULL(clk_table[i]))
+			clk_unregister(clk_table[i]);
+	}
+
+	return 0;
+}
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __init exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
+MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4


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

* [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 18:06     ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-arm-kernel

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 <abrestic@chromium.org>
---
Changes since v2:
 - add error handling to probe callback
 - fixed ordering of of_clk_{add,del}_provider
 - fixed nits from Tomasz and Sylwester
Changes since v1:
 - add clk_unregister() calls to remove callback
 - fixed minor nits from Tomasz
---
 drivers/clk/samsung/clk-exynos-audss.c | 109 +++++++++++++++++++++++++++------
 1 file changed, 90 insertions(+), 19 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..319c6e4 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,23 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	int i, ret = 0;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
-	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
-	}
-
-	clk_data.clks = clk_table;
-	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
+	if (!clk_table)
+		return -ENOMEM;
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -123,13 +124,83 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 				"div_pcm0", CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
+		if (IS_ERR(clk_table[i])) {
+			dev_err(&pdev->dev, "failed to regsiter clock %d\n", i);
+			ret = PTR_ERR(clk_table[i]);
+			goto unregister;
+		}
+	}
+
+	clk_data.clks = clk_table;
+	clk_data.clk_num = EXYNOS_AUDSS_MAX_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;
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
 
-	pr_info("Exynos: Audss: clock setup completed\n");
+	dev_info(&pdev->dev, "setup completed\n");
+
+	return 0;
+
+unregister:
+	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
+		if (!IS_ERR_OR_NULL(clk_table[i]))
+			clk_unregister(clk_table[i]);
+	}
+
+	return ret;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	int i;
+
+	of_clk_del_provider(pdev->dev.of_node);
+
+	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
+		if (!IS_ERR_OR_NULL(clk_table[i]))
+			clk_unregister(clk_table[i]);
+	}
+
+	return 0;
+}
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __init exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
+MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4

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

* [PATCH V3 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
  2013-09-24 18:06     ` Andrew Bresticker
  (?)
@ 2013-09-24 18:06       ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - listed input clocks as required properties
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 32 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 +++++++++++++----
 2 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..85b9e28 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,21 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +50,28 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller@3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with the input clocks
+           specified.
 
 clock_audss: audss-clock-controller@3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>,
+		<&ext_i2s_clk>;
+	clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in", "cdclk";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 319c6e4..e7e800a 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -68,6 +64,10 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
 	int i, ret = 0;
 	struct resource *res;
+	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;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg_base = devm_ioremap_resource(&pdev->dev, res);
@@ -82,11 +82,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	if (!clk_table)
 		return -ENOMEM;
 
+	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);
 	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,
@@ -120,8 +132,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
-- 
1.8.4


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

* [PATCH V3 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Mark Rutland, linux-doc, Andrew Bresticker, linux-kernel,
	Tushar Behera, Kukjin Kim, Russell King, Sachin Kamat,
	Stephen Warren, Grant Likely, devicetree, Pawel Moll,
	Ian Campbell, Rob Herring, Mike Turquette, linux-arm-kernel,
	Rahul Sharma, Padmavathi Venna, Jiri Kosina, Stephen Boyd,
	Doug Anderson, Leela Krishna Amudala, Rob Landley

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - listed input clocks as required properties
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 32 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 +++++++++++++----
 2 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..85b9e28 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,21 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +50,28 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller@3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with the input clocks
+           specified.
 
 clock_audss: audss-clock-controller@3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>,
+		<&ext_i2s_clk>;
+	clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in", "cdclk";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 319c6e4..e7e800a 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -68,6 +64,10 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
 	int i, ret = 0;
 	struct resource *res;
+	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;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg_base = devm_ioremap_resource(&pdev->dev, res);
@@ -82,11 +82,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	if (!clk_table)
 		return -ENOMEM;
 
+	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);
 	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,
@@ -120,8 +132,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
-- 
1.8.4

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

* [PATCH V3 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-arm-kernel

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - listed input clocks as required properties
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 32 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 +++++++++++++----
 2 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..85b9e28 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,21 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +50,28 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller at 3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with the input clocks
+           specified.
 
 clock_audss: audss-clock-controller at 3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>,
+		<&ext_i2s_clk>;
+	clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in", "cdclk";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 319c6e4..e7e800a 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -68,6 +64,10 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
 	int i, ret = 0;
 	struct resource *res;
+	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;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg_base = devm_ioremap_resource(&pdev->dev, res);
@@ -82,11 +82,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	if (!clk_table)
 		return -ENOMEM;
 
+	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);
 	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,
@@ -120,8 +132,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
-- 
1.8.4

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

* [PATCH V3 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4


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

* [PATCH V3 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Tomasz Figa,
	Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andrew Bresticker

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Reviewed-by: Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH V3 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-arm-kernel

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4

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

* [PATCH V3 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller
  2013-09-24 18:06     ` Andrew Bresticker
@ 2013-09-24 18:06       ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

Specify pll_ref, pll_in, sclk_audio, and sclk_pcm_in for the AudioSS
clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..2d6a93d 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4


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

* [PATCH V3 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-arm-kernel

Specify pll_ref, pll_in, sclk_audio, and sclk_pcm_in for the AudioSS
clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..2d6a93d 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4

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

* [PATCH V3 5/6] clk: exynos-audss: add support for Exynos 5420
  2013-09-24 18:06     ` Andrew Bresticker
@ 2013-09-24 18:06       ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - added type enum and made comparison against that instead of compatibility
   string
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt |  7 +++--
 drivers/clk/samsung/clk-exynos-audss.c             | 35 ++++++++++++++++++----
 include/dt-bindings/clk/exynos-audss-clk.h         |  3 +-
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 85b9e28..180e883 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -49,6 +51,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index e7e800a..35cae41 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,6 +19,12 @@
 
 #include <dt-bindings/clk/exynos-audss-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;
@@ -59,6 +65,16 @@ 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)
 {
@@ -68,6 +84,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	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;
+
+	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);
@@ -139,6 +162,12 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (variant == TYPE_EXYNOS5420) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
 		if (IS_ERR(clk_table[i])) {
 			dev_err(&pdev->dev, "failed to regsiter clock %d\n", i);
@@ -187,12 +216,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-	{ .compatible = "samsung,exynos4210-audss-clock", },
-	{ .compatible = "samsung,exynos5250-audss-clock", },
-	{},
-};
-
 static struct platform_driver exynos_audss_clk_driver = {
 	.driver	= {
 		.name = "exynos-audss-clk",
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4


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

* [PATCH V3 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-arm-kernel

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - added type enum and made comparison against that instead of compatibility
   string
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt |  7 +++--
 drivers/clk/samsung/clk-exynos-audss.c             | 35 ++++++++++++++++++----
 include/dt-bindings/clk/exynos-audss-clk.h         |  3 +-
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 85b9e28..180e883 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -49,6 +51,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index e7e800a..35cae41 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,6 +19,12 @@
 
 #include <dt-bindings/clk/exynos-audss-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;
@@ -59,6 +65,16 @@ 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)
 {
@@ -68,6 +84,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	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;
+
+	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);
@@ -139,6 +162,12 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (variant == TYPE_EXYNOS5420) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++) {
 		if (IS_ERR(clk_table[i])) {
 			dev_err(&pdev->dev, "failed to regsiter clock %d\n", i);
@@ -187,12 +216,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-	{ .compatible = "samsung,exynos4210-audss-clock", },
-	{ .compatible = "samsung,exynos5250-audss-clock", },
-	{},
-};
-
 static struct platform_driver exynos_audss_clk_driver = {
 	.driver	= {
 		.name = "exynos-audss-clk",
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4

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

* [PATCH V3 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

Specify the remaining input clocks (pll_ref, pll_in, and sclk_pcm_in)
for the AudioSS clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..056b55e 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 1>, <&clock 5>, <&clock 148>, <&clock 149>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec@11000000 {
-- 
1.8.4


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

* [PATCH V3 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA, Tomasz Figa,
	Sylwester Nawrocki
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Andrew Bresticker

Specify the remaining input clocks (pll_ref, pll_in, and sclk_pcm_in)
for the AudioSS clock controller.

Signed-off-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..056b55e 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 1>, <&clock 5>, <&clock 148>, <&clock 149>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec@11000000 {
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH V3 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller
@ 2013-09-24 18:06       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 18:06 UTC (permalink / raw)
  To: linux-arm-kernel

Specify the remaining input clocks (pll_ref, pll_in, and sclk_pcm_in)
for the AudioSS clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..056b55e 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 1>, <&clock 5>, <&clock 148>, <&clock 149>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec at 11000000 {
-- 
1.8.4

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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
  2013-09-24 18:06     ` Andrew Bresticker
  (?)
@ 2013-09-24 19:17       ` Tomasz Figa
  -1 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-24 19:17 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrew Bresticker, linux-samsung-soc, Tomasz Figa,
	Sylwester Nawrocki, Mark Rutland, linux-doc, linux-kernel,
	Tushar Behera, Kukjin Kim, Russell King, Sachin Kamat,
	Stephen Warren, Grant Likely, devicetree, Pawel Moll,
	Ian Campbell, Rob Herring, Mike Turquette, Rahul Sharma,
	Padmavathi Venna, Jiri Kosina, Stephen Boyd, Doug Anderson,
	Leela Krishna Amudala, Rob Landley

Hi Andrew,

On Tuesday 24 of September 2013 11:06:51 Andrew Bresticker wrote:
> 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 <abrestic@chromium.org>
> ---
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 109
> +++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 19
> deletions(-)

For the whole series:

Acked-by: Tomasz Figa <t.figa@samsung.com>

Thanks for addressing all the comments.

Best regards,
Tomasz


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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 19:17       ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-24 19:17 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Andrew Bresticker, linux-samsung-soc, Tomasz Figa,
	Sylwester Nawrocki, Mark Rutland, linux-doc, linux-kernel,
	Tushar Behera, Kukjin Kim, Russell King, Sachin Kamat,
	Stephen Warren, Grant Likely, devicetree, Pawel Moll,
	Ian Campbell, Rob Herring, Mike Turquette, Rahul Sharma,
	Padmavathi Venna, Jiri Kosina, Stephen Boyd, Doug Anderson,
	Leela

Hi Andrew,

On Tuesday 24 of September 2013 11:06:51 Andrew Bresticker wrote:
> 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 <abrestic@chromium.org>
> ---
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 109
> +++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 19
> deletions(-)

For the whole series:

Acked-by: Tomasz Figa <t.figa@samsung.com>

Thanks for addressing all the comments.

Best regards,
Tomasz

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

* [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 19:17       ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2013-09-24 19:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Andrew,

On Tuesday 24 of September 2013 11:06:51 Andrew Bresticker wrote:
> 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 <abrestic@chromium.org>
> ---
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 109
> +++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 19
> deletions(-)

For the whole series:

Acked-by: Tomasz Figa <t.figa@samsung.com>

Thanks for addressing all the comments.

Best regards,
Tomasz

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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
  2013-09-24 18:06     ` Andrew Bresticker
  (?)
@ 2013-09-24 21:15       ` Sylwester Nawrocki
  -1 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24 21:15 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	Rob Landley, Kukjin Kim, Russell King, Mike Turquette,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel

On 09/24/2013 08:06 PM, Andrew Bresticker wrote:
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>   {
[...]
>   	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>   				mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +124,83 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>   				"div_pcm0", CLK_SET_RATE_PARENT,
>   				reg_base + ASS_CLK_GATE, 5, 0,&lock);
>
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (IS_ERR(clk_table[i])) {
> +			dev_err(&pdev->dev, "failed to regsiter clock %d\n", i);

typo: regsiter -> register

> +			ret = PTR_ERR(clk_table[i]);
> +			goto unregister;
> +		}
> +	}
> +
> +	clk_data.clks = clk_table;
> +	clk_data.clk_num = EXYNOS_AUDSS_MAX_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;
> +	}
> +
[...]
> +	return 0;
> +
> +unregister:
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (!IS_ERR_OR_NULL(clk_table[i]))
> +			clk_unregister(clk_table[i]);
> +	}

Couldn't this instead be:

	while (--i >= 0)
		clk_unregister(clk_table[i]);

?
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (!IS_ERR_OR_NULL(clk_table[i]))
> +			clk_unregister(clk_table[i]);
> +	}

Since we only get here if all the clocks are registered properly and we
always register EXYNOS_AUDSS_MAX_CLKS clocks, couldn't this simply be:

	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++)
		clk_unregister(clk_table[i]);

?
> +	return 0;
> +}

Otherwise the whole series looks good to me. Feel free to add:

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>


--
Thanks,
Sylwester

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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 21:15       ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24 21:15 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	Rob Landley, Kukjin Kim, Russell King, Mike Turquette,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc

On 09/24/2013 08:06 PM, Andrew Bresticker wrote:
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>   {
[...]
>   	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>   				mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +124,83 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>   				"div_pcm0", CLK_SET_RATE_PARENT,
>   				reg_base + ASS_CLK_GATE, 5, 0,&lock);
>
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (IS_ERR(clk_table[i])) {
> +			dev_err(&pdev->dev, "failed to regsiter clock %d\n", i);

typo: regsiter -> register

> +			ret = PTR_ERR(clk_table[i]);
> +			goto unregister;
> +		}
> +	}
> +
> +	clk_data.clks = clk_table;
> +	clk_data.clk_num = EXYNOS_AUDSS_MAX_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;
> +	}
> +
[...]
> +	return 0;
> +
> +unregister:
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (!IS_ERR_OR_NULL(clk_table[i]))
> +			clk_unregister(clk_table[i]);
> +	}

Couldn't this instead be:

	while (--i >= 0)
		clk_unregister(clk_table[i]);

?
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (!IS_ERR_OR_NULL(clk_table[i]))
> +			clk_unregister(clk_table[i]);
> +	}

Since we only get here if all the clocks are registered properly and we
always register EXYNOS_AUDSS_MAX_CLKS clocks, couldn't this simply be:

	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++)
		clk_unregister(clk_table[i]);

?
> +	return 0;
> +}

Otherwise the whole series looks good to me. Feel free to add:

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>


--
Thanks,
Sylwester

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

* [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 21:15       ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24 21:15 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/24/2013 08:06 PM, Andrew Bresticker wrote:
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>   {
[...]
>   	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>   				mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +124,83 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>   				"div_pcm0", CLK_SET_RATE_PARENT,
>   				reg_base + ASS_CLK_GATE, 5, 0,&lock);
>
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (IS_ERR(clk_table[i])) {
> +			dev_err(&pdev->dev, "failed to regsiter clock %d\n", i);

typo: regsiter -> register

> +			ret = PTR_ERR(clk_table[i]);
> +			goto unregister;
> +		}
> +	}
> +
> +	clk_data.clks = clk_table;
> +	clk_data.clk_num = EXYNOS_AUDSS_MAX_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;
> +	}
> +
[...]
> +	return 0;
> +
> +unregister:
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (!IS_ERR_OR_NULL(clk_table[i]))
> +			clk_unregister(clk_table[i]);
> +	}

Couldn't this instead be:

	while (--i >= 0)
		clk_unregister(clk_table[i]);

?
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +	int i;
> +
> +	of_clk_del_provider(pdev->dev.of_node);
> +
> +	for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
> +		if (!IS_ERR_OR_NULL(clk_table[i]))
> +			clk_unregister(clk_table[i]);
> +	}

Since we only get here if all the clocks are registered properly and we
always register EXYNOS_AUDSS_MAX_CLKS clocks, couldn't this simply be:

	for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++)
		clk_unregister(clk_table[i]);

?
> +	return 0;
> +}

Otherwise the whole series looks good to me. Feel free to add:

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>


--
Thanks,
Sylwester

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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
  2013-09-24 21:15       ` Sylwester Nawrocki
  (?)
@ 2013-09-24 22:12         ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 22:12 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, Tomasz Figa, Rob Herring, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Rob Landley,
	Kukjin Kim, Russell King, Mike Turquette, Grant Likely,
	Sachin Kamat, Jiri Kosina, Rahul Sharma, Leela Krishna Amudala,
	Stephen Boyd, Tushar Behera, Doug Anderson, Padmavathi Venna,
	devicetree, linux-doc, linux-arm-kernel, linux-kernel

>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>> +{
>> +       int i;
>> +
>> +       of_clk_del_provider(pdev->dev.of_node);
>> +
>> +       for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
>> +               if (!IS_ERR_OR_NULL(clk_table[i]))
>> +                       clk_unregister(clk_table[i]);
>> +       }
>
>
> Since we only get here if all the clocks are registered properly and we
> always register EXYNOS_AUDSS_MAX_CLKS clocks, couldn't this simply be:
>
>
>         for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++)
>                 clk_unregister(clk_table[i]);
>
> ?

Once support is added for Exynos5420, we won't always register
EXYNOS_AUDSS_MAX_CLKS clocks, so we'd still need the NULL check.

Thanks,
Andrew

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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 22:12         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 22:12 UTC (permalink / raw)
  To: Sylwester Nawrocki
  Cc: linux-samsung-soc, Tomasz Figa, Rob Herring, Pawel Moll,
	Mark Rutland, Stephen Warren, Ian Campbell, Rob Landley,
	Kukjin Kim, Russell King, Mike Turquette, Grant Likely,
	Sachin Kamat, Jiri Kosina, Rahul Sharma, Leela Krishna Amudala,
	Stephen Boyd, Tushar Behera, Doug Anderson, Padmavathi Venna,
	devicetree, linux-doc, linux-arm-kernel

>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>> +{
>> +       int i;
>> +
>> +       of_clk_del_provider(pdev->dev.of_node);
>> +
>> +       for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
>> +               if (!IS_ERR_OR_NULL(clk_table[i]))
>> +                       clk_unregister(clk_table[i]);
>> +       }
>
>
> Since we only get here if all the clocks are registered properly and we
> always register EXYNOS_AUDSS_MAX_CLKS clocks, couldn't this simply be:
>
>
>         for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++)
>                 clk_unregister(clk_table[i]);
>
> ?

Once support is added for Exynos5420, we won't always register
EXYNOS_AUDSS_MAX_CLKS clocks, so we'd still need the NULL check.

Thanks,
Andrew

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

* [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 22:12         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-24 22:12 UTC (permalink / raw)
  To: linux-arm-kernel

>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>> +{
>> +       int i;
>> +
>> +       of_clk_del_provider(pdev->dev.of_node);
>> +
>> +       for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++) {
>> +               if (!IS_ERR_OR_NULL(clk_table[i]))
>> +                       clk_unregister(clk_table[i]);
>> +       }
>
>
> Since we only get here if all the clocks are registered properly and we
> always register EXYNOS_AUDSS_MAX_CLKS clocks, couldn't this simply be:
>
>
>         for (i = 0; i < EXYNOS_AUDSS_MAX_CLKS; i++)
>                 clk_unregister(clk_table[i]);
>
> ?

Once support is added for Exynos5420, we won't always register
EXYNOS_AUDSS_MAX_CLKS clocks, so we'd still need the NULL check.

Thanks,
Andrew

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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
  2013-09-24 18:06     ` Andrew Bresticker
  (?)
@ 2013-09-24 22:16       ` Stephen Boyd
  -1 siblings, 0 replies; 122+ messages in thread
From: Stephen Boyd @ 2013-09-24 22:16 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	Rob Landley, Kukjin Kim, Russell King, Mike Turquette,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Tushar Behera, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel

On 09/24/13 11:06, Andrew Bresticker wrote:
> +static int __init exynos_audss_clk_init(void)
> +{
> +	return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __init exynos_audss_clk_exit(void)

__exit?

> +{
> +	platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 22:16       ` Stephen Boyd
  0 siblings, 0 replies; 122+ messages in thread
From: Stephen Boyd @ 2013-09-24 22:16 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: linux-samsung-soc, Tomasz Figa, Sylwester Nawrocki, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	Rob Landley, Kukjin Kim, Russell King, Mike Turquette,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Tushar Behera, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel

On 09/24/13 11:06, Andrew Bresticker wrote:
> +static int __init exynos_audss_clk_init(void)
> +{
> +	return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __init exynos_audss_clk_exit(void)

__exit?

> +{
> +	platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* [PATCH V3 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-24 22:16       ` Stephen Boyd
  0 siblings, 0 replies; 122+ messages in thread
From: Stephen Boyd @ 2013-09-24 22:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 09/24/13 11:06, Andrew Bresticker wrote:
> +static int __init exynos_audss_clk_init(void)
> +{
> +	return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __init exynos_audss_clk_exit(void)

__exit?

> +{
> +	platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

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

* Re: [PATCH V3 1/6] clk: exynos-audss: convert to platform device
       [not found]         ` <CAL1qeaEpu=YRasZpSvrCTNwC6OGWZgECjwDSFgkAN07eWObmrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-09-24 22:31           ` Sylwester Nawrocki
  0 siblings, 0 replies; 122+ messages in thread
From: Sylwester Nawrocki @ 2013-09-24 22:31 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: Sylwester Nawrocki, linux-samsung-soc, Tomasz Figa, Rob Herring,
	Pawel Moll, Mark Rutland, Stephen Warren, Ian Campbell,
	Rob Landley, Kukjin Kim, Russell King, Mike Turquette,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Stephen Boyd, Tushar Behera,
	Doug Anderson, Padmavathi Venna,
	devicetree-u79uwXL29TY76Z2rM5mHXA, linux-doc

On 09/25/2013 12:12 AM, Andrew Bresticker wrote:
>>> +static int exynos_audss_clk_remove(struct platform_device *pdev)
>>> +{
>>> +       int i;
>>> +
>>> +       of_clk_del_provider(pdev->dev.of_node);
>>> +
>>> +       for (i = 0; i<   EXYNOS_AUDSS_MAX_CLKS; i++) {
>>> +               if (!IS_ERR_OR_NULL(clk_table[i]))
>>> +                       clk_unregister(clk_table[i]);
>>> +       }
>>
>>
>> Since we only get here if all the clocks are registered properly and we
>> always register EXYNOS_AUDSS_MAX_CLKS clocks, couldn't this simply be:
>>
>>
>>          for (i = 0; i<  EXYNOS_AUDSS_MAX_CLKS; i++)
>>                  clk_unregister(clk_table[i]);
>>
>> ?
>
> Once support is added for Exynos5420, we won't always register
> EXYNOS_AUDSS_MAX_CLKS clocks, so we'd still need the NULL check.

Then couldn't you use clk_data.clk_num in this loop instead of
EXYNOS_AUDSS_MAX_CLKS ? What I'm trying to avoid is assuming NULL as
an invalid clock. It's not correct, clock pointers should be only tested
with ERR_PTR(). Alternatively you could set the whole clk_table array to,
e.g. ERR_PTR(-EINVAL) beforehand, but that shouldn't be necessary when
clk_data.clk_num is used, unless there are holes in the array.

--
Regards,
Sylwester

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
  2013-09-24 18:06     ` Andrew Bresticker
@ 2013-09-25 21:12       ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

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 <abrestic@chromium.org>
Acked-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
Changes since v3:
 - __init -> __exit for module exit function
 - fixed nits from Sylwester
Changes since v2:
 - add error handling to probe callback
 - fixed ordering of of_clk_{add,del}_provider
 - fixed nits from Tomasz and Sylwester
Changes since v1:
 - add clk_unregister() calls to remove callback
 - fixed minor nits from Tomasz
---
 drivers/clk/samsung/clk-exynos-audss.c | 104 ++++++++++++++++++++++++++++-----
 1 file changed, 88 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..742dabc 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,26 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	int i, ret = 0;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
-	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
-	}
+	if (!clk_table)
+		return -ENOMEM;
 
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -123,13 +127,81 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 				"div_pcm0", CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	for (i = 0; i < clk_data.clk_num; i++) {
+		if (IS_ERR(clk_table[i])) {
+			dev_err(&pdev->dev, "failed to register clock %d\n", i);
+			ret = PTR_ERR(clk_table[i]);
+			goto unregister;
+		}
+	}
+
+	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;
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
 
-	pr_info("Exynos: Audss: clock setup completed\n");
+	dev_info(&pdev->dev, "setup completed\n");
+
+	return 0;
+
+unregister:
+	for (i = 0; i < clk_data.clk_num; i++) {
+		if (!IS_ERR(clk_table[i]))
+			clk_unregister(clk_table[i]);
+	}
+
+	return ret;
+}
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	int i;
+
+	of_clk_del_provider(pdev->dev.of_node);
+
+	for (i = 0; i < clk_data.clk_num; i++) {
+		if (!IS_ERR(clk_table[i]))
+			clk_unregister(clk_table[i]);
+	}
+
+	return 0;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __exit exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
+MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4


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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2013-09-25 21:12       ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

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 <abrestic@chromium.org>
Acked-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
Changes since v3:
 - __init -> __exit for module exit function
 - fixed nits from Sylwester
Changes since v2:
 - add error handling to probe callback
 - fixed ordering of of_clk_{add,del}_provider
 - fixed nits from Tomasz and Sylwester
Changes since v1:
 - add clk_unregister() calls to remove callback
 - fixed minor nits from Tomasz
---
 drivers/clk/samsung/clk-exynos-audss.c | 104 ++++++++++++++++++++++++++++-----
 1 file changed, 88 insertions(+), 16 deletions(-)

diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 39b40aa..742dabc 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -14,6 +14,8 @@
 #include <linux/clk-provider.h>
 #include <linux/of_address.h>
 #include <linux/syscore_ops.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 
 #include <dt-bindings/clk/exynos-audss-clk.h>
 
@@ -62,24 +64,26 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
 #endif /* CONFIG_PM_SLEEP */
 
 /* register exynos_audss clocks */
-static void __init exynos_audss_clk_init(struct device_node *np)
+static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
-	reg_base = of_iomap(np, 0);
-	if (!reg_base) {
-		pr_err("%s: failed to map audss registers\n", __func__);
-		return;
+	int i, ret = 0;
+	struct resource *res;
+
+	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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
+	clk_table = devm_kzalloc(&pdev->dev,
+				sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
 				GFP_KERNEL);
-	if (!clk_table) {
-		pr_err("%s: could not allocate clk lookup table\n", __func__);
-		return;
-	}
+	if (!clk_table)
+		return -ENOMEM;
 
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
-	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
 
 	clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
 				mout_audss_p, ARRAY_SIZE(mout_audss_p),
@@ -123,13 +127,81 @@ static void __init exynos_audss_clk_init(struct device_node *np)
 				"div_pcm0", CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	for (i = 0; i < clk_data.clk_num; i++) {
+		if (IS_ERR(clk_table[i])) {
+			dev_err(&pdev->dev, "failed to register clock %d\n", i);
+			ret = PTR_ERR(clk_table[i]);
+			goto unregister;
+		}
+	}
+
+	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;
+	}
+
 #ifdef CONFIG_PM_SLEEP
 	register_syscore_ops(&exynos_audss_clk_syscore_ops);
 #endif
 
-	pr_info("Exynos: Audss: clock setup completed\n");
+	dev_info(&pdev->dev, "setup completed\n");
+
+	return 0;
+
+unregister:
+	for (i = 0; i < clk_data.clk_num; i++) {
+		if (!IS_ERR(clk_table[i]))
+			clk_unregister(clk_table[i]);
+	}
+
+	return ret;
+}
+
+static int exynos_audss_clk_remove(struct platform_device *pdev)
+{
+	int i;
+
+	of_clk_del_provider(pdev->dev.of_node);
+
+	for (i = 0; i < clk_data.clk_num; i++) {
+		if (!IS_ERR(clk_table[i]))
+			clk_unregister(clk_table[i]);
+	}
+
+	return 0;
 }
-CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
-		exynos_audss_clk_init);
-CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
-		exynos_audss_clk_init);
+
+static const struct of_device_id exynos_audss_clk_of_match[] = {
+	{ .compatible = "samsung,exynos4210-audss-clock", },
+	{ .compatible = "samsung,exynos5250-audss-clock", },
+	{},
+};
+
+static struct platform_driver exynos_audss_clk_driver = {
+	.driver	= {
+		.name = "exynos-audss-clk",
+		.owner = THIS_MODULE,
+		.of_match_table = exynos_audss_clk_of_match,
+	},
+	.probe = exynos_audss_clk_probe,
+	.remove = exynos_audss_clk_remove,
+};
+
+static int __init exynos_audss_clk_init(void)
+{
+	return platform_driver_register(&exynos_audss_clk_driver);
+}
+core_initcall(exynos_audss_clk_init);
+
+static void __exit exynos_audss_clk_exit(void)
+{
+	platform_driver_unregister(&exynos_audss_clk_driver);
+}
+module_exit(exynos_audss_clk_exit);
+
+MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
+MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:exynos-audss-clk");
-- 
1.8.4

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

* [PATCH V4 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
  2013-09-25 21:12       ` Andrew Bresticker
@ 2013-09-25 21:12         ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - listed input clocks as required properties
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 32 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 +++++++++++++----
 2 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..85b9e28 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,21 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +50,28 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller@3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with the input clocks
+           specified.
 
 clock_audss: audss-clock-controller@3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>,
+		<&ext_i2s_clk>;
+	clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in", "cdclk";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 742dabc..7cb10f2 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -68,6 +64,10 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
 	int i, ret = 0;
 	struct resource *res;
+	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;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg_base = devm_ioremap_resource(&pdev->dev, res);
@@ -85,11 +85,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
 
+	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);
 	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,
@@ -123,8 +135,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 	for (i = 0; i < clk_data.clk_num; i++) {
-- 
1.8.4


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

* [PATCH V4 2/6] clk: exynos-audss: allow input clocks to be specified in device tree
@ 2013-09-25 21:12         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

This allows the input clocks to the Exynos AudioSS block to be
specified via device-tree bindings.  Default names will be used
when an input clock is not given.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - listed input clocks as required properties
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt | 32 ++++++++++++++++++++--
 drivers/clk/samsung/clk-exynos-audss.c             | 25 +++++++++++++----
 2 files changed, 50 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 75e2e19..85b9e28 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -14,6 +14,21 @@ Required Properties:
 
 - #clock-cells: should be 1.
 
+- clocks:
+  - pll_ref: Fixed rate PLL reference clock, parent of mout_audss. "fin_pll"
+    is used if not specified.
+  - pll_in: Input PLL to the AudioSS block, parent of mout_audss. "fout_epll"
+    is used if not specified.
+  - cdclk: External i2s clock, parent of mout_i2s. "cdclk0" is used if not
+    specified.
+  - sclk_audio: Audio bus clock, parent of mout_i2s. "sclk_audio0" is used if
+    not specified.
+  - sclk_pcm_in: PCM clock, parent of sclk_pcm.  "sclk_pcm0" is used if not
+    specified.
+
+- clock-names: Aliases for the above clocks. They should be "pll_ref",
+  "pll_in", "cdclk", "sclk_audio", and "sclk_pcm_in" respectively.
+
 The following is the list of clocks generated by the controller. Each clock is
 assigned an identifier and client nodes use this identifier to specify the
 clock which they consume. Some of the clocks are available only on a particular
@@ -35,15 +50,28 @@ sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
 
-Example 1: An example of a clock controller node is listed below.
+Example 1: An example of a clock controller node using the default input
+	   clock names is listed below.
+
+clock_audss: audss-clock-controller at 3810000 {
+	compatible = "samsung,exynos5250-audss-clock";
+	reg = <0x03810000 0x0C>;
+	#clock-cells = <1>;
+};
+
+Example 2: An example of a clock controller node with the input clocks
+           specified.
 
 clock_audss: audss-clock-controller at 3810000 {
 	compatible = "samsung,exynos5250-audss-clock";
 	reg = <0x03810000 0x0C>;
 	#clock-cells = <1>;
+	clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>,
+		<&ext_i2s_clk>;
+	clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in", "cdclk";
 };
 
-Example 2: I2S controller node that consumes the clock generated by the clock
+Example 3: I2S controller node that consumes the clock generated by the clock
            controller. Refer to the standard clock bindings for information
            about 'clocks' and 'clock-names' property.
 
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 742dabc..7cb10f2 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -34,10 +34,6 @@ static unsigned long reg_save[][2] = {
 	{ASS_CLK_GATE, 0},
 };
 
-/* list of all parent clock list */
-static const char *mout_audss_p[] = { "fin_pll", "fout_epll" };
-static const char *mout_i2s_p[] = { "mout_audss", "cdclk0", "sclk_audio0" };
-
 #ifdef CONFIG_PM_SLEEP
 static int exynos_audss_clk_suspend(void)
 {
@@ -68,6 +64,10 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 {
 	int i, ret = 0;
 	struct resource *res;
+	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;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	reg_base = devm_ioremap_resource(&pdev->dev, res);
@@ -85,11 +85,23 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	clk_data.clks = clk_table;
 	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
 
+	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);
 	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,
@@ -123,8 +135,11 @@ 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",
-				"div_pcm0", CLK_SET_RATE_PARENT,
+				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
 	for (i = 0; i < clk_data.clk_num; i++) {
-- 
1.8.4

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

* [PATCH V4 3/6] clk: exynos5250: add clock ID for div_pcm0
  2013-09-25 21:12       ` Andrew Bresticker
@ 2013-09-25 21:12         ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4


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

* [PATCH V4 3/6] clk: exynos5250: add clock ID for div_pcm0
@ 2013-09-25 21:12         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

There is no gate for the PCM clock input to the AudioSS block, so
the parent of sclk_pcm is div_pcm0.  Add a clock ID for it so that
we can reference it in device trees.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
---
 Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 1 +
 drivers/clk/samsung/clk-exynos5250.c                         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
index 24765c1..67e9a47 100644
--- a/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
+++ b/Documentation/devicetree/bindings/clock/exynos5250-clock.txt
@@ -62,6 +62,7 @@ clock which they consume.
   div_i2s1		157
   div_i2s2		158
   sclk_hdmiphy		159
+  div_pcm0		160
 
 
    [Peripheral Clock Gates]
diff --git a/drivers/clk/samsung/clk-exynos5250.c b/drivers/clk/samsung/clk-exynos5250.c
index adf3234..dec5376 100644
--- a/drivers/clk/samsung/clk-exynos5250.c
+++ b/drivers/clk/samsung/clk-exynos5250.c
@@ -108,7 +108,7 @@ enum exynos5250_clks {
 	sclk_mmc0, sclk_mmc1, sclk_mmc2, sclk_mmc3, sclk_sata, sclk_usb3,
 	sclk_jpeg, sclk_uart0, sclk_uart1, sclk_uart2, sclk_uart3, sclk_pwm,
 	sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2,
-	div_i2s1, div_i2s2, sclk_hdmiphy,
+	div_i2s1, div_i2s2, sclk_hdmiphy, div_pcm0,
 
 	/* gate clocks */
 	gscl0 = 256, gscl1, gscl2, gscl3, gscl_wa, gscl_wb, smmu_gscl0,
@@ -301,7 +301,7 @@ static struct samsung_div_clock exynos5250_div_clks[] __initdata = {
 	DIV(none, "div_dp", "mout_dp", DIV_DISP1_0, 24, 4),
 	DIV(none, "div_jpeg", "mout_jpeg", DIV_GEN, 4, 4),
 	DIV(none, "div_audio0", "mout_audio0", DIV_MAU, 0, 4),
-	DIV(none, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
+	DIV(div_pcm0, "div_pcm0", "sclk_audio0", DIV_MAU, 4, 8),
 	DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4),
 	DIV(none, "div_usb3", "mout_usb3", DIV_FSYS0, 24, 4),
 	DIV(none, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
-- 
1.8.4

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

* [PATCH V4 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller
  2013-09-25 21:12       ` Andrew Bresticker
@ 2013-09-25 21:12         ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

Specify pll_ref, pll_in, sclk_audio, and sclk_pcm_in for the AudioSS
clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..2d6a93d 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4


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

* [PATCH V4 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller
@ 2013-09-25 21:12         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

Specify pll_ref, pll_in, sclk_audio, and sclk_pcm_in for the AudioSS
clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5250.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 7d7cc77..2d6a93d 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -88,6 +88,8 @@
 		compatible = "samsung,exynos5250-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
+		clocks = <&clock 1>, <&clock 7>, <&clock 138>, <&clock 160>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	timer {
-- 
1.8.4

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

* [PATCH V4 5/6] clk: exynos-audss: add support for Exynos 5420
  2013-09-25 21:12       ` Andrew Bresticker
@ 2013-09-25 21:12         ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v3:
 - set clk_data.clk_num to correct value in non-5420 case
Changes since v1:
 - added type enum and made comparison against that instead of compatibility
   string
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt |  7 ++--
 drivers/clk/samsung/clk-exynos-audss.c             | 40 ++++++++++++++++++----
 include/dt-bindings/clk/exynos-audss-clk.h         |  3 +-
 3 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 85b9e28..180e883 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -49,6 +51,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 7cb10f2..e607176 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,6 +19,12 @@
 
 #include <dt-bindings/clk/exynos-audss-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;
@@ -59,6 +65,16 @@ 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)
 {
@@ -68,6 +84,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	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;
+
+	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);
@@ -83,7 +106,10 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	clk_data.clks = clk_table;
-	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
+	if (variant == TYPE_EXYNOS5420)
+		clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
+	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");
@@ -142,6 +168,12 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (variant == TYPE_EXYNOS5420) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 	for (i = 0; i < clk_data.clk_num; i++) {
 		if (IS_ERR(clk_table[i])) {
 			dev_err(&pdev->dev, "failed to register clock %d\n", i);
@@ -188,12 +220,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-	{ .compatible = "samsung,exynos4210-audss-clock", },
-	{ .compatible = "samsung,exynos5250-audss-clock", },
-	{},
-};
-
 static struct platform_driver exynos_audss_clk_driver = {
 	.driver	= {
 		.name = "exynos-audss-clk",
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4


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

* [PATCH V4 5/6] clk: exynos-audss: add support for Exynos 5420
@ 2013-09-25 21:12         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

The AudioSS block on Exynos 5420 has an additional clock gate for the
ADMA bus clock.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v3:
 - set clk_data.clk_num to correct value in non-5420 case
Changes since v1:
 - added type enum and made comparison against that instead of compatibility
   string
---
 .../devicetree/bindings/clock/clk-exynos-audss.txt |  7 ++--
 drivers/clk/samsung/clk-exynos-audss.c             | 40 ++++++++++++++++++----
 include/dt-bindings/clk/exynos-audss-clk.h         |  3 +-
 3 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
index 85b9e28..180e883 100644
--- a/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
+++ b/Documentation/devicetree/bindings/clock/clk-exynos-audss.txt
@@ -8,8 +8,10 @@ Required Properties:
 
 - compatible: should be one of the following:
   - "samsung,exynos4210-audss-clock" - controller compatible with all Exynos4 SoCs.
-  - "samsung,exynos5250-audss-clock" - controller compatible with all Exynos5 SoCs.
-
+  - "samsung,exynos5250-audss-clock" - controller compatible with Exynos5250
+    SoCs.
+  - "samsung,exynos5420-audss-clock" - controller compatible with Exynos5420
+    SoCs.
 - reg: physical base address and length of the controller's register set.
 
 - #clock-cells: should be 1.
@@ -49,6 +51,7 @@ i2s_bus         6
 sclk_i2s        7
 pcm_bus         8
 sclk_pcm        9
+adma            10      Exynos5420
 
 Example 1: An example of a clock controller node using the default input
 	   clock names is listed below.
diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
index 7cb10f2..e607176 100644
--- a/drivers/clk/samsung/clk-exynos-audss.c
+++ b/drivers/clk/samsung/clk-exynos-audss.c
@@ -19,6 +19,12 @@
 
 #include <dt-bindings/clk/exynos-audss-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;
@@ -59,6 +65,16 @@ 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)
 {
@@ -68,6 +84,13 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 	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;
+
+	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);
@@ -83,7 +106,10 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	clk_data.clks = clk_table;
-	clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
+	if (variant == TYPE_EXYNOS5420)
+		clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
+	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");
@@ -142,6 +168,12 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
 				sclk_pcm_p, CLK_SET_RATE_PARENT,
 				reg_base + ASS_CLK_GATE, 5, 0, &lock);
 
+	if (variant == TYPE_EXYNOS5420) {
+		clk_table[EXYNOS_ADMA] = clk_register_gate(NULL, "adma",
+				"dout_srp", CLK_SET_RATE_PARENT,
+				reg_base + ASS_CLK_GATE, 9, 0, &lock);
+	}
+
 	for (i = 0; i < clk_data.clk_num; i++) {
 		if (IS_ERR(clk_table[i])) {
 			dev_err(&pdev->dev, "failed to register clock %d\n", i);
@@ -188,12 +220,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static const struct of_device_id exynos_audss_clk_of_match[] = {
-	{ .compatible = "samsung,exynos4210-audss-clock", },
-	{ .compatible = "samsung,exynos5250-audss-clock", },
-	{},
-};
-
 static struct platform_driver exynos_audss_clk_driver = {
 	.driver	= {
 		.name = "exynos-audss-clk",
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f42..0ae6f5a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
 #define EXYNOS_SCLK_I2S	7
 #define EXYNOS_PCM_BUS		8
 #define EXYNOS_SCLK_PCM	9
+#define EXYNOS_ADMA		10
 
-#define EXYNOS_AUDSS_MAX_CLKS	10
+#define EXYNOS_AUDSS_MAX_CLKS	11
 
 #endif
-- 
1.8.4

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

* [PATCH V4 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller
  2013-09-25 21:12       ` Andrew Bresticker
@ 2013-09-25 21:12         ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Mike Turquette, Grant Likely, Sachin Kamat, Jiri Kosina,
	Rahul Sharma, Leela Krishna Amudala, Tushar Behera,
	Doug Anderson, Padmavathi Venna, devicetree, linux-doc,
	linux-arm-kernel, linux-kernel, Andrew Bresticker

Specify the remaining input clocks (pll_ref, pll_in, and sclk_pcm_in)
for the AudioSS clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..056b55e 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 1>, <&clock 5>, <&clock 148>, <&clock 149>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec@11000000 {
-- 
1.8.4


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

* [PATCH V4 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller
@ 2013-09-25 21:12         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-09-25 21:12 UTC (permalink / raw)
  To: linux-arm-kernel

Specify the remaining input clocks (pll_ref, pll_in, and sclk_pcm_in)
for the AudioSS clock controller.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
Changes since v1:
 - specified additional input clocks
---
 arch/arm/boot/dts/exynos5420.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index d537cd7..056b55e 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -72,8 +72,8 @@
 		compatible = "samsung,exynos5420-audss-clock";
 		reg = <0x03810000 0x0C>;
 		#clock-cells = <1>;
-		clocks = <&clock 148>;
-		clock-names = "sclk_audio";
+		clocks = <&clock 1>, <&clock 5>, <&clock 148>, <&clock 149>;
+		clock-names = "pll_ref", "pll_in", "sclk_audio", "sclk_pcm_in";
 	};
 
 	codec at 11000000 {
-- 
1.8.4

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

* Re: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
  2013-09-25 21:12       ` Andrew Bresticker
  (?)
@ 2013-10-08 16:53         ` Andrew Bresticker
  -1 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-10-08 16:53 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd,
	Mike Turquette, Kukjin Kim
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Russell King, Grant Likely,
	Sachin Kamat, Jiri Kosina, Rahul Sharma, Leela Krishna Amudala,
	Tushar Behera, Doug Anderson, Padmavathi Venna, devicetree,
	linux-doc, linux-arm-kernel, linux-kernel, Andrew Bresticker

Hi Mike and Kukjin,

Any decisions regarding this patchset?  I believe all comments have
been addressed.

Thanks,
Andrew

On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
<abrestic@chromium.org> wrote:
> 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 <abrestic@chromium.org>
> Acked-by: Tomasz Figa <t.figa@samsung.com>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
> Changes since v3:
>  - __init -> __exit for module exit function
>  - fixed nits from Sylwester
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 104 ++++++++++++++++++++++++++++-----
>  1 file changed, 88 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
> index 39b40aa..742dabc 100644
> --- a/drivers/clk/samsung/clk-exynos-audss.c
> +++ b/drivers/clk/samsung/clk-exynos-audss.c
> @@ -14,6 +14,8 @@
>  #include <linux/clk-provider.h>
>  #include <linux/of_address.h>
>  #include <linux/syscore_ops.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
>
>  #include <dt-bindings/clk/exynos-audss-clk.h>
>
> @@ -62,24 +64,26 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -       reg_base = of_iomap(np, 0);
> -       if (!reg_base) {
> -               pr_err("%s: failed to map audss registers\n", __func__);
> -               return;
> +       int i, ret = 0;
> +       struct resource *res;
> +
> +       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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +       clk_table = devm_kzalloc(&pdev->dev,
> +                               sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>                                 GFP_KERNEL);
> -       if (!clk_table) {
> -               pr_err("%s: could not allocate clk lookup table\n", __func__);
> -               return;
> -       }
> +       if (!clk_table)
> +               return -ENOMEM;
>
>         clk_data.clks = clk_table;
>         clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
>
>         clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>                                 mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +127,81 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>                                 "div_pcm0", CLK_SET_RATE_PARENT,
>                                 reg_base + ASS_CLK_GATE, 5, 0, &lock);
>
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (IS_ERR(clk_table[i])) {
> +                       dev_err(&pdev->dev, "failed to register clock %d\n", i);
> +                       ret = PTR_ERR(clk_table[i]);
> +                       goto unregister;
> +               }
> +       }
> +
> +       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;
> +       }
> +
>  #ifdef CONFIG_PM_SLEEP
>         register_syscore_ops(&exynos_audss_clk_syscore_ops);
>  #endif
>
> -       pr_info("Exynos: Audss: clock setup completed\n");
> +       dev_info(&pdev->dev, "setup completed\n");
> +
> +       return 0;
> +
> +unregister:
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return ret;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +       int i;
> +
> +       of_clk_del_provider(pdev->dev.of_node);
> +
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return 0;
>  }
> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -               exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -               exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +       { .compatible = "samsung,exynos4210-audss-clock", },
> +       { .compatible = "samsung,exynos5250-audss-clock", },
> +       {},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +       .driver = {
> +               .name = "exynos-audss-clk",
> +               .owner = THIS_MODULE,
> +               .of_match_table = exynos_audss_clk_of_match,
> +       },
> +       .probe = exynos_audss_clk_probe,
> +       .remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +       return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __exit exynos_audss_clk_exit(void)
> +{
> +       platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
> +MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:exynos-audss-clk");
> --
> 1.8.4
>

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

* Re: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2013-10-08 16:53         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-10-08 16:53 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd,
	Mike Turquette, Kukjin Kim
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Russell King, Grant Likely,
	Sachin Kamat, Jiri Kosina, Rahul Sharma, Leela Krishna Amudala,
	Tushar Behera, Doug Anderson, Padmavathi Venna, devicetree,
	linux-doc, linux-arm-kernel, linux-kernel, Andrew Bresticker

Hi Mike and Kukjin,

Any decisions regarding this patchset?  I believe all comments have
been addressed.

Thanks,
Andrew

On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
<abrestic@chromium.org> wrote:
> 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 <abrestic@chromium.org>
> Acked-by: Tomasz Figa <t.figa@samsung.com>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
> Changes since v3:
>  - __init -> __exit for module exit function
>  - fixed nits from Sylwester
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 104 ++++++++++++++++++++++++++++-----
>  1 file changed, 88 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
> index 39b40aa..742dabc 100644
> --- a/drivers/clk/samsung/clk-exynos-audss.c
> +++ b/drivers/clk/samsung/clk-exynos-audss.c
> @@ -14,6 +14,8 @@
>  #include <linux/clk-provider.h>
>  #include <linux/of_address.h>
>  #include <linux/syscore_ops.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
>
>  #include <dt-bindings/clk/exynos-audss-clk.h>
>
> @@ -62,24 +64,26 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -       reg_base = of_iomap(np, 0);
> -       if (!reg_base) {
> -               pr_err("%s: failed to map audss registers\n", __func__);
> -               return;
> +       int i, ret = 0;
> +       struct resource *res;
> +
> +       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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +       clk_table = devm_kzalloc(&pdev->dev,
> +                               sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>                                 GFP_KERNEL);
> -       if (!clk_table) {
> -               pr_err("%s: could not allocate clk lookup table\n", __func__);
> -               return;
> -       }
> +       if (!clk_table)
> +               return -ENOMEM;
>
>         clk_data.clks = clk_table;
>         clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
>
>         clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>                                 mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +127,81 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>                                 "div_pcm0", CLK_SET_RATE_PARENT,
>                                 reg_base + ASS_CLK_GATE, 5, 0, &lock);
>
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (IS_ERR(clk_table[i])) {
> +                       dev_err(&pdev->dev, "failed to register clock %d\n", i);
> +                       ret = PTR_ERR(clk_table[i]);
> +                       goto unregister;
> +               }
> +       }
> +
> +       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;
> +       }
> +
>  #ifdef CONFIG_PM_SLEEP
>         register_syscore_ops(&exynos_audss_clk_syscore_ops);
>  #endif
>
> -       pr_info("Exynos: Audss: clock setup completed\n");
> +       dev_info(&pdev->dev, "setup completed\n");
> +
> +       return 0;
> +
> +unregister:
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return ret;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +       int i;
> +
> +       of_clk_del_provider(pdev->dev.of_node);
> +
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return 0;
>  }
> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -               exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -               exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +       { .compatible = "samsung,exynos4210-audss-clock", },
> +       { .compatible = "samsung,exynos5250-audss-clock", },
> +       {},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +       .driver = {
> +               .name = "exynos-audss-clk",
> +               .owner = THIS_MODULE,
> +               .of_match_table = exynos_audss_clk_of_match,
> +       },
> +       .probe = exynos_audss_clk_probe,
> +       .remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +       return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __exit exynos_audss_clk_exit(void)
> +{
> +       platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
> +MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:exynos-audss-clk");
> --
> 1.8.4
>

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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2013-10-08 16:53         ` Andrew Bresticker
  0 siblings, 0 replies; 122+ messages in thread
From: Andrew Bresticker @ 2013-10-08 16:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mike and Kukjin,

Any decisions regarding this patchset?  I believe all comments have
been addressed.

Thanks,
Andrew

On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
<abrestic@chromium.org> wrote:
> 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 <abrestic@chromium.org>
> Acked-by: Tomasz Figa <t.figa@samsung.com>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
> Changes since v3:
>  - __init -> __exit for module exit function
>  - fixed nits from Sylwester
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 104 ++++++++++++++++++++++++++++-----
>  1 file changed, 88 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
> index 39b40aa..742dabc 100644
> --- a/drivers/clk/samsung/clk-exynos-audss.c
> +++ b/drivers/clk/samsung/clk-exynos-audss.c
> @@ -14,6 +14,8 @@
>  #include <linux/clk-provider.h>
>  #include <linux/of_address.h>
>  #include <linux/syscore_ops.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
>
>  #include <dt-bindings/clk/exynos-audss-clk.h>
>
> @@ -62,24 +64,26 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -       reg_base = of_iomap(np, 0);
> -       if (!reg_base) {
> -               pr_err("%s: failed to map audss registers\n", __func__);
> -               return;
> +       int i, ret = 0;
> +       struct resource *res;
> +
> +       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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +       clk_table = devm_kzalloc(&pdev->dev,
> +                               sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>                                 GFP_KERNEL);
> -       if (!clk_table) {
> -               pr_err("%s: could not allocate clk lookup table\n", __func__);
> -               return;
> -       }
> +       if (!clk_table)
> +               return -ENOMEM;
>
>         clk_data.clks = clk_table;
>         clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
>
>         clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>                                 mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +127,81 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>                                 "div_pcm0", CLK_SET_RATE_PARENT,
>                                 reg_base + ASS_CLK_GATE, 5, 0, &lock);
>
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (IS_ERR(clk_table[i])) {
> +                       dev_err(&pdev->dev, "failed to register clock %d\n", i);
> +                       ret = PTR_ERR(clk_table[i]);
> +                       goto unregister;
> +               }
> +       }
> +
> +       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;
> +       }
> +
>  #ifdef CONFIG_PM_SLEEP
>         register_syscore_ops(&exynos_audss_clk_syscore_ops);
>  #endif
>
> -       pr_info("Exynos: Audss: clock setup completed\n");
> +       dev_info(&pdev->dev, "setup completed\n");
> +
> +       return 0;
> +
> +unregister:
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return ret;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +       int i;
> +
> +       of_clk_del_provider(pdev->dev.of_node);
> +
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return 0;
>  }
> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -               exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -               exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +       { .compatible = "samsung,exynos4210-audss-clock", },
> +       { .compatible = "samsung,exynos5250-audss-clock", },
> +       {},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +       .driver = {
> +               .name = "exynos-audss-clk",
> +               .owner = THIS_MODULE,
> +               .of_match_table = exynos_audss_clk_of_match,
> +       },
> +       .probe = exynos_audss_clk_probe,
> +       .remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +       return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __exit exynos_audss_clk_exit(void)
> +{
> +       platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
> +MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:exynos-audss-clk");
> --
> 1.8.4
>

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

* Re: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
  2013-10-08 16:53         ` Andrew Bresticker
@ 2013-11-26  6:29           ` Padma Venkat
  -1 siblings, 0 replies; 122+ messages in thread
From: Padma Venkat @ 2013-11-26  6:29 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: Mark Rutland, linux-doc, Padmavathi Venna, Tomasz Figa,
	linux-kernel, Tushar Behera, Kukjin Kim, Mike Turquette,
	Sachin Kamat, Ian Campbell, Grant Likely, devicetree, Pawel Moll,
	Stephen Warren, Rob Herring, linux-samsung-soc, Russell King,
	Sylwester Nawrocki, linux-arm-kernel, Rahul Sharma, Jiri Kosina

Hi Mike and Kukjin,

On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
<abrestic@chromium.org> wrote:
> Hi Mike and Kukjin,
>
> Any decisions regarding this patchset?  I believe all comments have
> been addressed.
>
> Thanks,
> Andrew

Any decisions on this patchset. These can be applied directly on
linux-samsung tree.

>
> On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
> <abrestic@chromium.org> wrote:
>> 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 <abrestic@chromium.org>
>> Acked-by: Tomasz Figa <t.figa@samsung.com>
>> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> ---
>> Changes since v3:
>>  - __init -> __exit for module exit function
>>  - fixed nits from Sylwester
>> Changes since v2:
>>  - add error handling to probe callback
>>  - fixed ordering of of_clk_{add,del}_provider
>>  - fixed nits from Tomasz and Sylwester
>> Changes since v1:
>>  - add clk_unregister() calls to remove callback
>>  - fixed minor nits from Tomasz
>> ---

Thanks
Padma

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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2013-11-26  6:29           ` Padma Venkat
  0 siblings, 0 replies; 122+ messages in thread
From: Padma Venkat @ 2013-11-26  6:29 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Mike and Kukjin,

On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
<abrestic@chromium.org> wrote:
> Hi Mike and Kukjin,
>
> Any decisions regarding this patchset?  I believe all comments have
> been addressed.
>
> Thanks,
> Andrew

Any decisions on this patchset. These can be applied directly on
linux-samsung tree.

>
> On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
> <abrestic@chromium.org> wrote:
>> 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 <abrestic@chromium.org>
>> Acked-by: Tomasz Figa <t.figa@samsung.com>
>> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> ---
>> Changes since v3:
>>  - __init -> __exit for module exit function
>>  - fixed nits from Sylwester
>> Changes since v2:
>>  - add error handling to probe callback
>>  - fixed ordering of of_clk_{add,del}_provider
>>  - fixed nits from Tomasz and Sylwester
>> Changes since v1:
>>  - add clk_unregister() calls to remove callback
>>  - fixed minor nits from Tomasz
>> ---

Thanks
Padma

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

* Re: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
  2013-09-25 21:12       ` Andrew Bresticker
  (?)
@ 2013-11-27 18:40         ` Mike Turquette
  -1 siblings, 0 replies; 122+ messages in thread
From: Mike Turquette @ 2013-11-27 18:40 UTC (permalink / raw)
  To: Andrew Bresticker, Tomasz Figa, Sylwester Nawrocki,
	linux-samsung-soc, Stephen Boyd
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Tushar Behera, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel, Andrew Bresticker

Quoting Andrew Bresticker (2013-09-25 14:12:47)
> 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 <abrestic@chromium.org>
> Acked-by: Tomasz Figa <t.figa@samsung.com>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Acked-by: Mike Turquette <mturquette@linaro.org>

> ---
> Changes since v3:
>  - __init -> __exit for module exit function
>  - fixed nits from Sylwester
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 104 ++++++++++++++++++++++++++++-----
>  1 file changed, 88 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
> index 39b40aa..742dabc 100644
> --- a/drivers/clk/samsung/clk-exynos-audss.c
> +++ b/drivers/clk/samsung/clk-exynos-audss.c
> @@ -14,6 +14,8 @@
>  #include <linux/clk-provider.h>
>  #include <linux/of_address.h>
>  #include <linux/syscore_ops.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
>  
>  #include <dt-bindings/clk/exynos-audss-clk.h>
>  
> @@ -62,24 +64,26 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>  
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -       reg_base = of_iomap(np, 0);
> -       if (!reg_base) {
> -               pr_err("%s: failed to map audss registers\n", __func__);
> -               return;
> +       int i, ret = 0;
> +       struct resource *res;
> +
> +       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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +       clk_table = devm_kzalloc(&pdev->dev,
> +                               sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>                                 GFP_KERNEL);
> -       if (!clk_table) {
> -               pr_err("%s: could not allocate clk lookup table\n", __func__);
> -               return;
> -       }
> +       if (!clk_table)
> +               return -ENOMEM;
>  
>         clk_data.clks = clk_table;
>         clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
>  
>         clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>                                 mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +127,81 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>                                 "div_pcm0", CLK_SET_RATE_PARENT,
>                                 reg_base + ASS_CLK_GATE, 5, 0, &lock);
>  
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (IS_ERR(clk_table[i])) {
> +                       dev_err(&pdev->dev, "failed to register clock %d\n", i);
> +                       ret = PTR_ERR(clk_table[i]);
> +                       goto unregister;
> +               }
> +       }
> +
> +       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;
> +       }
> +
>  #ifdef CONFIG_PM_SLEEP
>         register_syscore_ops(&exynos_audss_clk_syscore_ops);
>  #endif
>  
> -       pr_info("Exynos: Audss: clock setup completed\n");
> +       dev_info(&pdev->dev, "setup completed\n");
> +
> +       return 0;
> +
> +unregister:
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return ret;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +       int i;
> +
> +       of_clk_del_provider(pdev->dev.of_node);
> +
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return 0;
>  }
> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -               exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -               exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +       { .compatible = "samsung,exynos4210-audss-clock", },
> +       { .compatible = "samsung,exynos5250-audss-clock", },
> +       {},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +       .driver = {
> +               .name = "exynos-audss-clk",
> +               .owner = THIS_MODULE,
> +               .of_match_table = exynos_audss_clk_of_match,
> +       },
> +       .probe = exynos_audss_clk_probe,
> +       .remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +       return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __exit exynos_audss_clk_exit(void)
> +{
> +       platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
> +MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:exynos-audss-clk");
> -- 
> 1.8.4

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

* Re: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2013-11-27 18:40         ` Mike Turquette
  0 siblings, 0 replies; 122+ messages in thread
From: Mike Turquette @ 2013-11-27 18:40 UTC (permalink / raw)
  To: Tomasz Figa, Sylwester Nawrocki, linux-samsung-soc, Stephen Boyd
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
	Ian Campbell, Rob Landley, Kukjin Kim, Russell King,
	Grant Likely, Sachin Kamat, Jiri Kosina, Rahul Sharma,
	Leela Krishna Amudala, Tushar Behera, Doug Anderson,
	Padmavathi Venna, devicetree, linux-doc, linux-arm-kernel,
	linux-kernel, Andrew Bresticker

Quoting Andrew Bresticker (2013-09-25 14:12:47)
> 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 <abrestic@chromium.org>
> Acked-by: Tomasz Figa <t.figa@samsung.com>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Acked-by: Mike Turquette <mturquette@linaro.org>

> ---
> Changes since v3:
>  - __init -> __exit for module exit function
>  - fixed nits from Sylwester
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 104 ++++++++++++++++++++++++++++-----
>  1 file changed, 88 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
> index 39b40aa..742dabc 100644
> --- a/drivers/clk/samsung/clk-exynos-audss.c
> +++ b/drivers/clk/samsung/clk-exynos-audss.c
> @@ -14,6 +14,8 @@
>  #include <linux/clk-provider.h>
>  #include <linux/of_address.h>
>  #include <linux/syscore_ops.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
>  
>  #include <dt-bindings/clk/exynos-audss-clk.h>
>  
> @@ -62,24 +64,26 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>  
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -       reg_base = of_iomap(np, 0);
> -       if (!reg_base) {
> -               pr_err("%s: failed to map audss registers\n", __func__);
> -               return;
> +       int i, ret = 0;
> +       struct resource *res;
> +
> +       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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +       clk_table = devm_kzalloc(&pdev->dev,
> +                               sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>                                 GFP_KERNEL);
> -       if (!clk_table) {
> -               pr_err("%s: could not allocate clk lookup table\n", __func__);
> -               return;
> -       }
> +       if (!clk_table)
> +               return -ENOMEM;
>  
>         clk_data.clks = clk_table;
>         clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
>  
>         clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>                                 mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +127,81 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>                                 "div_pcm0", CLK_SET_RATE_PARENT,
>                                 reg_base + ASS_CLK_GATE, 5, 0, &lock);
>  
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (IS_ERR(clk_table[i])) {
> +                       dev_err(&pdev->dev, "failed to register clock %d\n", i);
> +                       ret = PTR_ERR(clk_table[i]);
> +                       goto unregister;
> +               }
> +       }
> +
> +       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;
> +       }
> +
>  #ifdef CONFIG_PM_SLEEP
>         register_syscore_ops(&exynos_audss_clk_syscore_ops);
>  #endif
>  
> -       pr_info("Exynos: Audss: clock setup completed\n");
> +       dev_info(&pdev->dev, "setup completed\n");
> +
> +       return 0;
> +
> +unregister:
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return ret;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +       int i;
> +
> +       of_clk_del_provider(pdev->dev.of_node);
> +
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return 0;
>  }
> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -               exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -               exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +       { .compatible = "samsung,exynos4210-audss-clock", },
> +       { .compatible = "samsung,exynos5250-audss-clock", },
> +       {},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +       .driver = {
> +               .name = "exynos-audss-clk",
> +               .owner = THIS_MODULE,
> +               .of_match_table = exynos_audss_clk_of_match,
> +       },
> +       .probe = exynos_audss_clk_probe,
> +       .remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +       return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __exit exynos_audss_clk_exit(void)
> +{
> +       platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
> +MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:exynos-audss-clk");
> -- 
> 1.8.4

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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2013-11-27 18:40         ` Mike Turquette
  0 siblings, 0 replies; 122+ messages in thread
From: Mike Turquette @ 2013-11-27 18:40 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Andrew Bresticker (2013-09-25 14:12:47)
> 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 <abrestic@chromium.org>
> Acked-by: Tomasz Figa <t.figa@samsung.com>
> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

Acked-by: Mike Turquette <mturquette@linaro.org>

> ---
> Changes since v3:
>  - __init -> __exit for module exit function
>  - fixed nits from Sylwester
> Changes since v2:
>  - add error handling to probe callback
>  - fixed ordering of of_clk_{add,del}_provider
>  - fixed nits from Tomasz and Sylwester
> Changes since v1:
>  - add clk_unregister() calls to remove callback
>  - fixed minor nits from Tomasz
> ---
>  drivers/clk/samsung/clk-exynos-audss.c | 104 ++++++++++++++++++++++++++++-----
>  1 file changed, 88 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-exynos-audss.c b/drivers/clk/samsung/clk-exynos-audss.c
> index 39b40aa..742dabc 100644
> --- a/drivers/clk/samsung/clk-exynos-audss.c
> +++ b/drivers/clk/samsung/clk-exynos-audss.c
> @@ -14,6 +14,8 @@
>  #include <linux/clk-provider.h>
>  #include <linux/of_address.h>
>  #include <linux/syscore_ops.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
>  
>  #include <dt-bindings/clk/exynos-audss-clk.h>
>  
> @@ -62,24 +64,26 @@ static struct syscore_ops exynos_audss_clk_syscore_ops = {
>  #endif /* CONFIG_PM_SLEEP */
>  
>  /* register exynos_audss clocks */
> -static void __init exynos_audss_clk_init(struct device_node *np)
> +static int exynos_audss_clk_probe(struct platform_device *pdev)
>  {
> -       reg_base = of_iomap(np, 0);
> -       if (!reg_base) {
> -               pr_err("%s: failed to map audss registers\n", __func__);
> -               return;
> +       int i, ret = 0;
> +       struct resource *res;
> +
> +       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 = kzalloc(sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
> +       clk_table = devm_kzalloc(&pdev->dev,
> +                               sizeof(struct clk *) * EXYNOS_AUDSS_MAX_CLKS,
>                                 GFP_KERNEL);
> -       if (!clk_table) {
> -               pr_err("%s: could not allocate clk lookup table\n", __func__);
> -               return;
> -       }
> +       if (!clk_table)
> +               return -ENOMEM;
>  
>         clk_data.clks = clk_table;
>         clk_data.clk_num = EXYNOS_AUDSS_MAX_CLKS;
> -       of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
>  
>         clk_table[EXYNOS_MOUT_AUDSS] = clk_register_mux(NULL, "mout_audss",
>                                 mout_audss_p, ARRAY_SIZE(mout_audss_p),
> @@ -123,13 +127,81 @@ static void __init exynos_audss_clk_init(struct device_node *np)
>                                 "div_pcm0", CLK_SET_RATE_PARENT,
>                                 reg_base + ASS_CLK_GATE, 5, 0, &lock);
>  
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (IS_ERR(clk_table[i])) {
> +                       dev_err(&pdev->dev, "failed to register clock %d\n", i);
> +                       ret = PTR_ERR(clk_table[i]);
> +                       goto unregister;
> +               }
> +       }
> +
> +       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;
> +       }
> +
>  #ifdef CONFIG_PM_SLEEP
>         register_syscore_ops(&exynos_audss_clk_syscore_ops);
>  #endif
>  
> -       pr_info("Exynos: Audss: clock setup completed\n");
> +       dev_info(&pdev->dev, "setup completed\n");
> +
> +       return 0;
> +
> +unregister:
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return ret;
> +}
> +
> +static int exynos_audss_clk_remove(struct platform_device *pdev)
> +{
> +       int i;
> +
> +       of_clk_del_provider(pdev->dev.of_node);
> +
> +       for (i = 0; i < clk_data.clk_num; i++) {
> +               if (!IS_ERR(clk_table[i]))
> +                       clk_unregister(clk_table[i]);
> +       }
> +
> +       return 0;
>  }
> -CLK_OF_DECLARE(exynos4210_audss_clk, "samsung,exynos4210-audss-clock",
> -               exynos_audss_clk_init);
> -CLK_OF_DECLARE(exynos5250_audss_clk, "samsung,exynos5250-audss-clock",
> -               exynos_audss_clk_init);
> +
> +static const struct of_device_id exynos_audss_clk_of_match[] = {
> +       { .compatible = "samsung,exynos4210-audss-clock", },
> +       { .compatible = "samsung,exynos5250-audss-clock", },
> +       {},
> +};
> +
> +static struct platform_driver exynos_audss_clk_driver = {
> +       .driver = {
> +               .name = "exynos-audss-clk",
> +               .owner = THIS_MODULE,
> +               .of_match_table = exynos_audss_clk_of_match,
> +       },
> +       .probe = exynos_audss_clk_probe,
> +       .remove = exynos_audss_clk_remove,
> +};
> +
> +static int __init exynos_audss_clk_init(void)
> +{
> +       return platform_driver_register(&exynos_audss_clk_driver);
> +}
> +core_initcall(exynos_audss_clk_init);
> +
> +static void __exit exynos_audss_clk_exit(void)
> +{
> +       platform_driver_unregister(&exynos_audss_clk_driver);
> +}
> +module_exit(exynos_audss_clk_exit);
> +
> +MODULE_AUTHOR("Padmavathi Venna <padma.v@samsung.com>");
> +MODULE_DESCRIPTION("Exynos Audio Subsystem Clock Controller");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:exynos-audss-clk");
> -- 
> 1.8.4

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

* Re: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
  2013-11-26  6:29           ` Padma Venkat
@ 2013-11-27 18:41             ` Mike Turquette
  -1 siblings, 0 replies; 122+ messages in thread
From: Mike Turquette @ 2013-11-27 18:41 UTC (permalink / raw)
  To: Padma Venkat, Andrew Bresticker
  Cc: Mark Rutland, linux-doc, Tomasz Figa, linux-kernel,
	Tushar Behera, Kukjin Kim, Russell King, Sachin Kamat,
	Ian Campbell, Grant Likely, devicetree, Pawel Moll,
	Stephen Warren, Rob Herring, linux-samsung-soc,
	Sylwester Nawrocki, linux-arm-kernel, Rahul Sharma,
	Padmavathi Venna, Jiri Kosina, Stephen Boyd, Doug

Quoting Padma Venkat (2013-11-25 22:29:44)
> Hi Mike and Kukjin,
> 
> On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
> <abrestic@chromium.org> wrote:
> > Hi Mike and Kukjin,
> >
> > Any decisions regarding this patchset?  I believe all comments have
> > been addressed.
> >
> > Thanks,
> > Andrew
> 
> Any decisions on this patchset. These can be applied directly on
> linux-samsung tree.

For all of the clk parts:

Acked-by: Mike Turquette <mturquette@linaro.org>

I'm happy to take them in as part of a pull request.

Regards,
Mike

> 
> >
> > On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
> > <abrestic@chromium.org> wrote:
> >> 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 <abrestic@chromium.org>
> >> Acked-by: Tomasz Figa <t.figa@samsung.com>
> >> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> >> ---
> >> Changes since v3:
> >>  - __init -> __exit for module exit function
> >>  - fixed nits from Sylwester
> >> Changes since v2:
> >>  - add error handling to probe callback
> >>  - fixed ordering of of_clk_{add,del}_provider
> >>  - fixed nits from Tomasz and Sylwester
> >> Changes since v1:
> >>  - add clk_unregister() calls to remove callback
> >>  - fixed minor nits from Tomasz
> >> ---
> 
> Thanks
> Padma

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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2013-11-27 18:41             ` Mike Turquette
  0 siblings, 0 replies; 122+ messages in thread
From: Mike Turquette @ 2013-11-27 18:41 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Padma Venkat (2013-11-25 22:29:44)
> Hi Mike and Kukjin,
> 
> On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
> <abrestic@chromium.org> wrote:
> > Hi Mike and Kukjin,
> >
> > Any decisions regarding this patchset?  I believe all comments have
> > been addressed.
> >
> > Thanks,
> > Andrew
> 
> Any decisions on this patchset. These can be applied directly on
> linux-samsung tree.

For all of the clk parts:

Acked-by: Mike Turquette <mturquette@linaro.org>

I'm happy to take them in as part of a pull request.

Regards,
Mike

> 
> >
> > On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
> > <abrestic@chromium.org> wrote:
> >> 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 <abrestic@chromium.org>
> >> Acked-by: Tomasz Figa <t.figa@samsung.com>
> >> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> >> ---
> >> Changes since v3:
> >>  - __init -> __exit for module exit function
> >>  - fixed nits from Sylwester
> >> Changes since v2:
> >>  - add error handling to probe callback
> >>  - fixed ordering of of_clk_{add,del}_provider
> >>  - fixed nits from Tomasz and Sylwester
> >> Changes since v1:
> >>  - add clk_unregister() calls to remove callback
> >>  - fixed minor nits from Tomasz
> >> ---
> 
> Thanks
> Padma

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

* Re: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
  2013-11-27 18:41             ` Mike Turquette
@ 2013-12-01 22:43               ` Kukjin Kim
  -1 siblings, 0 replies; 122+ messages in thread
From: Kukjin Kim @ 2013-12-01 22:43 UTC (permalink / raw)
  To: Mike Turquette
  Cc: Mark Rutland, linux-doc, Andrew Bresticker, Tomasz Figa,
	Doug Anderson, Padma Venkat, Tushar Behera, Kukjin Kim,
	Russell King, Sachin Kamat, Stephen Warren, Grant Likely,
	devicetree, Pawel Moll, Ian Campbell, Rob Herring,
	linux-samsung-soc, Sylwester Nawrocki, linux-arm-kernel,
	Rahul Sharma, Padmavathi Venna, Jiri Kosina

On 11/28/13 03:41, Mike Turquette wrote:
> Quoting Padma Venkat (2013-11-25 22:29:44)
>> Hi Mike and Kukjin,
>>
>> On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
>> <abrestic@chromium.org>  wrote:
>>> Hi Mike and Kukjin,
>>>
>>> Any decisions regarding this patchset?  I believe all comments have
>>> been addressed.
>>>
>>> Thanks,
>>> Andrew
>>
>> Any decisions on this patchset. These can be applied directly on
>> linux-samsung tree.
>
> For all of the clk parts:
>
> Acked-by: Mike Turquette<mturquette@linaro.org>
>
> I'm happy to take them in as part of a pull request.
>
OK, Mike, I will take this series into samsung tree and let me send a 
pull request for your clk tree to avoid useless merge conflicts.

Thanks,
Kukjin

> Regards,
> Mike
>
>>
>>>
>>> On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
>>> <abrestic@chromium.org>  wrote:
>>>> 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<abrestic@chromium.org>
>>>> Acked-by: Tomasz Figa<t.figa@samsung.com>
>>>> Reviewed-by: Sylwester Nawrocki<s.nawrocki@samsung.com>
>>>> ---
>>>> Changes since v3:
>>>>   - __init ->  __exit for module exit function
>>>>   - fixed nits from Sylwester
>>>> Changes since v2:
>>>>   - add error handling to probe callback
>>>>   - fixed ordering of of_clk_{add,del}_provider
>>>>   - fixed nits from Tomasz and Sylwester
>>>> Changes since v1:
>>>>   - add clk_unregister() calls to remove callback
>>>>   - fixed minor nits from Tomasz
>>>> ---
>>
>> Thanks
>> Padma

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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2013-12-01 22:43               ` Kukjin Kim
  0 siblings, 0 replies; 122+ messages in thread
From: Kukjin Kim @ 2013-12-01 22:43 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/28/13 03:41, Mike Turquette wrote:
> Quoting Padma Venkat (2013-11-25 22:29:44)
>> Hi Mike and Kukjin,
>>
>> On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
>> <abrestic@chromium.org>  wrote:
>>> Hi Mike and Kukjin,
>>>
>>> Any decisions regarding this patchset?  I believe all comments have
>>> been addressed.
>>>
>>> Thanks,
>>> Andrew
>>
>> Any decisions on this patchset. These can be applied directly on
>> linux-samsung tree.
>
> For all of the clk parts:
>
> Acked-by: Mike Turquette<mturquette@linaro.org>
>
> I'm happy to take them in as part of a pull request.
>
OK, Mike, I will take this series into samsung tree and let me send a 
pull request for your clk tree to avoid useless merge conflicts.

Thanks,
Kukjin

> Regards,
> Mike
>
>>
>>>
>>> On Wed, Sep 25, 2013 at 2:12 PM, Andrew Bresticker
>>> <abrestic@chromium.org>  wrote:
>>>> 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<abrestic@chromium.org>
>>>> Acked-by: Tomasz Figa<t.figa@samsung.com>
>>>> Reviewed-by: Sylwester Nawrocki<s.nawrocki@samsung.com>
>>>> ---
>>>> Changes since v3:
>>>>   - __init ->  __exit for module exit function
>>>>   - fixed nits from Sylwester
>>>> Changes since v2:
>>>>   - add error handling to probe callback
>>>>   - fixed ordering of of_clk_{add,del}_provider
>>>>   - fixed nits from Tomasz and Sylwester
>>>> Changes since v1:
>>>>   - add clk_unregister() calls to remove callback
>>>>   - fixed minor nits from Tomasz
>>>> ---
>>
>> Thanks
>> Padma

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

* Re: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
  2013-12-01 22:43               ` Kukjin Kim
@ 2014-01-02 15:20                 ` Tomasz Figa
  -1 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2014-01-02 15:20 UTC (permalink / raw)
  To: Kukjin Kim, Mike Turquette
  Cc: Mark Rutland, linux-doc, Andrew Bresticker, Doug Anderson,
	Padma Venkat, Tushar Behera, linux-samsung-soc, Russell King,
	Sachin Kamat, Stephen Warren, Grant Likely, devicetree,
	Pawel Moll, Ian Campbell, Rob Herring, Sylwester Nawrocki,
	linux-arm-kernel, Rahul Sharma, Padmavathi Venna, Jiri Kosina,
	Stephen Boyd, linux-kernel

Hi Kukjin, Mike,

On Monday 02 of December 2013 07:43:42 Kukjin Kim wrote:
> On 11/28/13 03:41, Mike Turquette wrote:
> > Quoting Padma Venkat (2013-11-25 22:29:44)
> >> Hi Mike and Kukjin,
> >>
> >> On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
> >> <abrestic@chromium.org>  wrote:
> >>> Hi Mike and Kukjin,
> >>>
> >>> Any decisions regarding this patchset?  I believe all comments have
> >>> been addressed.
> >>>
> >>> Thanks,
> >>> Andrew
> >>
> >> Any decisions on this patchset. These can be applied directly on
> >> linux-samsung tree.
> >
> > For all of the clk parts:
> >
> > Acked-by: Mike Turquette<mturquette@linaro.org>
> >
> > I'm happy to take them in as part of a pull request.
> >
> OK, Mike, I will take this series into samsung tree and let me send a 
> pull request for your clk tree to avoid useless merge conflicts.

Hmm, I can't find this series in any tree, so I guess it has been lost
in action.

Should I take it through samsung-clk tree with your acks?

Best regards,
Tomasz

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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2014-01-02 15:20                 ` Tomasz Figa
  0 siblings, 0 replies; 122+ messages in thread
From: Tomasz Figa @ 2014-01-02 15:20 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Kukjin, Mike,

On Monday 02 of December 2013 07:43:42 Kukjin Kim wrote:
> On 11/28/13 03:41, Mike Turquette wrote:
> > Quoting Padma Venkat (2013-11-25 22:29:44)
> >> Hi Mike and Kukjin,
> >>
> >> On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
> >> <abrestic@chromium.org>  wrote:
> >>> Hi Mike and Kukjin,
> >>>
> >>> Any decisions regarding this patchset?  I believe all comments have
> >>> been addressed.
> >>>
> >>> Thanks,
> >>> Andrew
> >>
> >> Any decisions on this patchset. These can be applied directly on
> >> linux-samsung tree.
> >
> > For all of the clk parts:
> >
> > Acked-by: Mike Turquette<mturquette@linaro.org>
> >
> > I'm happy to take them in as part of a pull request.
> >
> OK, Mike, I will take this series into samsung tree and let me send a 
> pull request for your clk tree to avoid useless merge conflicts.

Hmm, I can't find this series in any tree, so I guess it has been lost
in action.

Should I take it through samsung-clk tree with your acks?

Best regards,
Tomasz

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

* RE: [PATCH V4 1/6] clk: exynos-audss: convert to platform device
  2014-01-02 15:20                 ` Tomasz Figa
@ 2014-01-04  2:47                   ` kgene at kernel.org
  -1 siblings, 0 replies; 122+ messages in thread
From: kgene @ 2014-01-04  2:47 UTC (permalink / raw)
  To: 'Tomasz Figa', 'Mike Turquette'
  Cc: 'Andrew Bresticker',
	linux-doc, linux-kernel, devicetree, 'linux-samsung-soc',
	'Sylwester Nawrocki',
	linux-arm-kernel, 'Padmavathi Venna'

Tomasz Figa wrote:
> 
> Hi Kukjin, Mike,
> 
> On Monday 02 of December 2013 07:43:42 Kukjin Kim wrote:
> > On 11/28/13 03:41, Mike Turquette wrote:
> > > Quoting Padma Venkat (2013-11-25 22:29:44)
> > >> Hi Mike and Kukjin,
> > >>
> > >> On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
> > >> <abrestic@chromium.org>  wrote:
> > >>> Hi Mike and Kukjin,
> > >>>
> > >>> Any decisions regarding this patchset?  I believe all comments have
> > >>> been addressed.
> > >>>
> > >>> Thanks,
> > >>> Andrew
> > >>
> > >> Any decisions on this patchset. These can be applied directly on
> > >> linux-samsung tree.
> > >
> > > For all of the clk parts:
> > >
> > > Acked-by: Mike Turquette<mturquette@linaro.org>
> > >
> > > I'm happy to take them in as part of a pull request.
> > >
> > OK, Mike, I will take this series into samsung tree and let me send a
> > pull request for your clk tree to avoid useless merge conflicts.
> 
- some persons in Cc

> Hmm, I can't find this series in any tree, so I guess it has been lost
> in action.
> 
Oops, sorry about that :-(

> Should I take it through samsung-clk tree with your acks?
> 
Tomasz, yes please take this series with my ack.

Thanks,
Kukjin


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

* [PATCH V4 1/6] clk: exynos-audss: convert to platform device
@ 2014-01-04  2:47                   ` kgene at kernel.org
  0 siblings, 0 replies; 122+ messages in thread
From: kgene at kernel.org @ 2014-01-04  2:47 UTC (permalink / raw)
  To: linux-arm-kernel

Tomasz Figa wrote:
> 
> Hi Kukjin, Mike,
> 
> On Monday 02 of December 2013 07:43:42 Kukjin Kim wrote:
> > On 11/28/13 03:41, Mike Turquette wrote:
> > > Quoting Padma Venkat (2013-11-25 22:29:44)
> > >> Hi Mike and Kukjin,
> > >>
> > >> On Tue, Oct 8, 2013 at 10:23 PM, Andrew Bresticker
> > >> <abrestic@chromium.org>  wrote:
> > >>> Hi Mike and Kukjin,
> > >>>
> > >>> Any decisions regarding this patchset?  I believe all comments have
> > >>> been addressed.
> > >>>
> > >>> Thanks,
> > >>> Andrew
> > >>
> > >> Any decisions on this patchset. These can be applied directly on
> > >> linux-samsung tree.
> > >
> > > For all of the clk parts:
> > >
> > > Acked-by: Mike Turquette<mturquette@linaro.org>
> > >
> > > I'm happy to take them in as part of a pull request.
> > >
> > OK, Mike, I will take this series into samsung tree and let me send a
> > pull request for your clk tree to avoid useless merge conflicts.
> 
- some persons in Cc

> Hmm, I can't find this series in any tree, so I guess it has been lost
> in action.
> 
Oops, sorry about that :-(

> Should I take it through samsung-clk tree with your acks?
> 
Tomasz, yes please take this series with my ack.

Thanks,
Kukjin

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

end of thread, other threads:[~2014-01-04  2:47 UTC | newest]

Thread overview: 122+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-20 21:13 [PATCH 1/6] clk: exynos-audss: convert to platform device Andrew Bresticker
2013-09-20 21:13 ` Andrew Bresticker
2013-09-20 21:13 ` Andrew Bresticker
2013-09-20 21:13 ` [PATCH 2/6] clk: exynos-audss: allow input clocks to be specified in device tree Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-21 15:12   ` Tomasz Figa
2013-09-21 15:12     ` Tomasz Figa
2013-09-21 15:12     ` Tomasz Figa
2013-09-20 21:13 ` [PATCH 3/6] clk: exynos5250: add clock ID for div_pcm0 Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-21 15:19   ` Tomasz Figa
2013-09-21 15:19     ` Tomasz Figa
2013-09-21 15:19     ` Tomasz Figa
2013-09-20 21:13 ` [PATCH 4/6] ARM: dts: exynos5250: add sclk_pcm_in to audss clock controller Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-21 15:13   ` Tomasz Figa
2013-09-21 15:13     ` Tomasz Figa
2013-09-21 15:13     ` Tomasz Figa
2013-09-20 21:13 ` [PATCH 5/6] clk: exynos-audss: add support for Exynos 5420 Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-21 15:17   ` Tomasz Figa
2013-09-21 15:17     ` Tomasz Figa
2013-09-21 15:17     ` Tomasz Figa
2013-09-20 21:13 ` [PATCH 6/6] ARM: dts: exynos5420: add sclk_pcm_in to audss clock controller Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-20 21:13   ` Andrew Bresticker
2013-09-21 15:18   ` Tomasz Figa
2013-09-21 15:18     ` Tomasz Figa
2013-09-21 15:18     ` Tomasz Figa
2013-09-21 12:50 ` [PATCH 1/6] clk: exynos-audss: convert to platform device Tomasz Figa
2013-09-21 12:50   ` Tomasz Figa
2013-09-21 12:50   ` Tomasz Figa
2013-09-23 21:25   ` Andrew Bresticker
2013-09-23 21:25     ` Andrew Bresticker
2013-09-23 21:30     ` Tomasz Figa
2013-09-23 21:30       ` Tomasz Figa
2013-09-23 21:36       ` Andrew Bresticker
2013-09-23 21:36         ` Andrew Bresticker
2013-09-23 22:50     ` Sylwester Nawrocki
2013-09-23 22:50       ` Sylwester Nawrocki
2013-09-23 22:50       ` Sylwester Nawrocki
2013-09-24  0:21 ` [PATCH V2 " Andrew Bresticker
2013-09-24  0:21   ` Andrew Bresticker
2013-09-24  0:21   ` [PATCH V2 2/6] clk: exynos-audss: allow input clocks to be specified in device tree Andrew Bresticker
2013-09-24  0:21     ` Andrew Bresticker
2013-09-24  0:21   ` [PATCH V2 3/6] clk: exynos5250: add clock ID for div_pcm0 Andrew Bresticker
2013-09-24  0:21     ` Andrew Bresticker
2013-09-24  0:21   ` [PATCH V2 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller Andrew Bresticker
2013-09-24  0:21     ` Andrew Bresticker
2013-09-24  0:21   ` [PATCH V2 5/6] clk: exynos-audss: add support for Exynos 5420 Andrew Bresticker
2013-09-24  0:21     ` Andrew Bresticker
2013-09-24  0:21     ` Andrew Bresticker
2013-09-24  0:21   ` [PATCH V2 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller Andrew Bresticker
2013-09-24  0:21     ` Andrew Bresticker
2013-09-24  9:20   ` [PATCH V2 1/6] clk: exynos-audss: convert to platform device Tomasz Figa
2013-09-24  9:20     ` Tomasz Figa
2013-09-24  9:20     ` Tomasz Figa
2013-09-24  9:47     ` Sylwester Nawrocki
2013-09-24  9:47       ` Sylwester Nawrocki
2013-09-24  9:35   ` Sylwester Nawrocki
2013-09-24  9:35     ` Sylwester Nawrocki
2013-09-24  9:35     ` Sylwester Nawrocki
2013-09-24 18:06   ` [PATCH V3 " Andrew Bresticker
2013-09-24 18:06     ` Andrew Bresticker
2013-09-24 18:06     ` [PATCH V3 2/6] clk: exynos-audss: allow input clocks to be specified in device tree Andrew Bresticker
2013-09-24 18:06       ` Andrew Bresticker
2013-09-24 18:06       ` Andrew Bresticker
2013-09-24 18:06     ` [PATCH V3 3/6] clk: exynos5250: add clock ID for div_pcm0 Andrew Bresticker
2013-09-24 18:06       ` Andrew Bresticker
2013-09-24 18:06       ` Andrew Bresticker
2013-09-24 18:06     ` [PATCH V3 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller Andrew Bresticker
2013-09-24 18:06       ` Andrew Bresticker
2013-09-24 18:06     ` [PATCH V3 5/6] clk: exynos-audss: add support for Exynos 5420 Andrew Bresticker
2013-09-24 18:06       ` Andrew Bresticker
2013-09-24 18:06     ` [PATCH V3 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller Andrew Bresticker
2013-09-24 18:06       ` Andrew Bresticker
2013-09-24 18:06       ` Andrew Bresticker
2013-09-24 19:17     ` [PATCH V3 1/6] clk: exynos-audss: convert to platform device Tomasz Figa
2013-09-24 19:17       ` Tomasz Figa
2013-09-24 19:17       ` Tomasz Figa
2013-09-24 21:15     ` Sylwester Nawrocki
2013-09-24 21:15       ` Sylwester Nawrocki
2013-09-24 21:15       ` Sylwester Nawrocki
2013-09-24 22:12       ` Andrew Bresticker
2013-09-24 22:12         ` Andrew Bresticker
2013-09-24 22:12         ` Andrew Bresticker
     [not found]         ` <CAL1qeaEpu=YRasZpSvrCTNwC6OGWZgECjwDSFgkAN07eWObmrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-24 22:31           ` Sylwester Nawrocki
2013-09-24 22:16     ` Stephen Boyd
2013-09-24 22:16       ` Stephen Boyd
2013-09-24 22:16       ` Stephen Boyd
2013-09-25 21:12     ` [PATCH V4 " Andrew Bresticker
2013-09-25 21:12       ` Andrew Bresticker
2013-09-25 21:12       ` [PATCH V4 2/6] clk: exynos-audss: allow input clocks to be specified in device tree Andrew Bresticker
2013-09-25 21:12         ` Andrew Bresticker
2013-09-25 21:12       ` [PATCH V4 3/6] clk: exynos5250: add clock ID for div_pcm0 Andrew Bresticker
2013-09-25 21:12         ` Andrew Bresticker
2013-09-25 21:12       ` [PATCH V4 4/6] ARM: dts: exynos5250: add input clocks to audss clock controller Andrew Bresticker
2013-09-25 21:12         ` Andrew Bresticker
2013-09-25 21:12       ` [PATCH V4 5/6] clk: exynos-audss: add support for Exynos 5420 Andrew Bresticker
2013-09-25 21:12         ` Andrew Bresticker
2013-09-25 21:12       ` [PATCH V4 6/6] ARM: dts: exynos5420: add input clocks to audss clock controller Andrew Bresticker
2013-09-25 21:12         ` Andrew Bresticker
2013-10-08 16:53       ` [PATCH V4 1/6] clk: exynos-audss: convert to platform device Andrew Bresticker
2013-10-08 16:53         ` Andrew Bresticker
2013-10-08 16:53         ` Andrew Bresticker
2013-11-26  6:29         ` Padma Venkat
2013-11-26  6:29           ` Padma Venkat
2013-11-27 18:41           ` Mike Turquette
2013-11-27 18:41             ` Mike Turquette
2013-12-01 22:43             ` Kukjin Kim
2013-12-01 22:43               ` Kukjin Kim
2014-01-02 15:20               ` Tomasz Figa
2014-01-02 15:20                 ` Tomasz Figa
2014-01-04  2:47                 ` kgene
2014-01-04  2:47                   ` kgene at kernel.org
2013-11-27 18:40       ` Mike Turquette
2013-11-27 18:40         ` Mike Turquette
2013-11-27 18:40         ` Mike Turquette

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.