linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V6 0/4] clk: new APIs to handle all available clocks
@ 2018-08-31  4:45 Dong Aisheng
  2018-08-31  4:45 ` [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get() Dong Aisheng
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Dong Aisheng @ 2018-08-31  4:45 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	thor.thayer, linux-imx, hdegoede, Dong Aisheng

This patch series is a continue of discussion from here,
https://patchwork.kernel.org/patch/9986293/
that some users may want to handle all available clocks from device
tree without need to know the detailed clock information likes clock
numbers and names. This is useful in writing some generic drivers to
handle clock part.

Note:
This patch series is tested on MX6Q SDB cpufreq driver with a minor change
to switch to use clk_bulk_get_all.
But patch 4 only test compiling. Hopefully someone could help test
the function.

v3->v4:
 * improve 'devres->clks = *clks' according to Stephen's suggestion
v2->v3:
 * address all comments from Stephen
 * fix build warnings on other architectures.
v1->v2:
 * add clk_bulk_{get|put}_all() which only supports DT platform currently
 * remove _all variants and the wrapper struct clk_bulk
 * make of_clk_bulk_get and of_clk_bulk_get_all private until someone
   proves they need it because they don't have a struct device pointer.

Dong Aisheng (4):
  clk: bulk: add of_clk_bulk_get()
  clk: add new APIs to operate on all available clocks
  clk: add managed version of clk_bulk_get_all
  video: simplefb: switch to use clk_bulk API to simplify clock
    operations

 drivers/clk/clk-bulk.c         | 80 ++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/clk-devres.c       | 24 +++++++++++++
 drivers/video/fbdev/simplefb.c | 72 ++++++++++---------------------------
 include/linux/clk.h            | 65 +++++++++++++++++++++++++++++++++-
 4 files changed, 186 insertions(+), 55 deletions(-)

-- 
2.7.4

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

* [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get()
  2018-08-31  4:45 [PATCH V6 0/4] clk: new APIs to handle all available clocks Dong Aisheng
@ 2018-08-31  4:45 ` Dong Aisheng
  2018-10-16 22:44   ` Stephen Boyd
  2018-08-31  4:45 ` [PATCH V6 2/4] clk: add new APIs to operate on all available clocks Dong Aisheng
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Dong Aisheng @ 2018-08-31  4:45 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	thor.thayer, linux-imx, hdegoede, Dong Aisheng, Stephen Boyd,
	Russell King

'clock-names' property is optional in DT, so of_clk_bulk_get() is
introduced here to handle this for DT users without 'clock-names'
specified. Later clk_bulk_get_all() will be implemented on top of
it and this API will be kept private until someone proves they need
it because they don't have a struct device pointer.

Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Russell King <linux@arm.linux.org.uk>
Reported-by: Shawn Guo <shawnguo@kernel.org>
Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
v3->v4:
 * no changes
v2->v3:
 * remove #if define condition
 * remove EXPORT_SYMBOL
---
 drivers/clk/clk-bulk.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
index 6904ed6..4460ac5 100644
--- a/drivers/clk/clk-bulk.c
+++ b/drivers/clk/clk-bulk.c
@@ -19,6 +19,35 @@
 #include <linux/clk.h>
 #include <linux/device.h>
 #include <linux/export.h>
+#include <linux/of.h>
+
+static int __must_check of_clk_bulk_get(struct device_node *np, int num_clks,
+					struct clk_bulk_data *clks)
+{
+	int ret;
+	int i;
+
+	for (i = 0; i < num_clks; i++)
+		clks[i].clk = NULL;
+
+	for (i = 0; i < num_clks; i++) {
+		clks[i].clk = of_clk_get(np, i);
+		if (IS_ERR(clks[i].clk)) {
+			ret = PTR_ERR(clks[i].clk);
+			pr_err("%pOF: Failed to get clk index: %d ret: %d\n",
+			       np, i, ret);
+			clks[i].clk = NULL;
+			goto err;
+		}
+	}
+
+	return 0;
+
+err:
+	clk_bulk_put(i, clks);
+
+	return ret;
+}
 
 void clk_bulk_put(int num_clks, struct clk_bulk_data *clks)
 {
-- 
2.7.4

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

* [PATCH V6 2/4] clk: add new APIs to operate on all available clocks
  2018-08-31  4:45 [PATCH V6 0/4] clk: new APIs to handle all available clocks Dong Aisheng
  2018-08-31  4:45 ` [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get() Dong Aisheng
@ 2018-08-31  4:45 ` Dong Aisheng
  2018-10-16 22:44   ` Stephen Boyd
  2018-08-31  4:45 ` [PATCH V6 3/4] clk: add managed version of clk_bulk_get_all Dong Aisheng
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Dong Aisheng @ 2018-08-31  4:45 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	thor.thayer, linux-imx, hdegoede, Dong Aisheng, Stephen Boyd,
	Masahiro Yamada

This patch introduces of_clk_bulk_get_all and clk_bulk_x_all APIs
to users who just want to handle all available clocks from device tree
without need to know the detailed clock information likes clock numbers
and names. This is useful in writing some generic drivers to handle clock
part.

Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
v3->v4:
 * no changes
v2->v3:
 * remove #if define condition
 * use kmalloc_array
v1->v2:
 * make of_clk_bulk_get_all private
 * add clk_bulk_get/put_all
---
 drivers/clk/clk-bulk.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/clk.h    | 42 ++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk-bulk.c b/drivers/clk/clk-bulk.c
index 4460ac5..6a7118d 100644
--- a/drivers/clk/clk-bulk.c
+++ b/drivers/clk/clk-bulk.c
@@ -17,9 +17,11 @@
  */
 
 #include <linux/clk.h>
+#include <linux/clk-provider.h>
 #include <linux/device.h>
 #include <linux/export.h>
 #include <linux/of.h>
+#include <linux/slab.h>
 
 static int __must_check of_clk_bulk_get(struct device_node *np, int num_clks,
 					struct clk_bulk_data *clks)
@@ -49,6 +51,32 @@ static int __must_check of_clk_bulk_get(struct device_node *np, int num_clks,
 	return ret;
 }
 
+static int __must_check of_clk_bulk_get_all(struct device_node *np,
+					    struct clk_bulk_data **clks)
+{
+	struct clk_bulk_data *clk_bulk;
+	int num_clks;
+	int ret;
+
+	num_clks = of_clk_get_parent_count(np);
+	if (!num_clks)
+		return 0;
+
+	clk_bulk = kmalloc_array(num_clks, sizeof(*clk_bulk), GFP_KERNEL);
+	if (!clk_bulk)
+		return -ENOMEM;
+
+	ret = of_clk_bulk_get(np, num_clks, clk_bulk);
+	if (ret) {
+		kfree(clk_bulk);
+		return ret;
+	}
+
+	*clks = clk_bulk;
+
+	return num_clks;
+}
+
 void clk_bulk_put(int num_clks, struct clk_bulk_data *clks)
 {
 	while (--num_clks >= 0) {
@@ -88,6 +116,29 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
 }
 EXPORT_SYMBOL(clk_bulk_get);
 
+void clk_bulk_put_all(int num_clks, struct clk_bulk_data *clks)
+{
+	if (IS_ERR_OR_NULL(clks))
+		return;
+
+	clk_bulk_put(num_clks, clks);
+
+	kfree(clks);
+}
+EXPORT_SYMBOL(clk_bulk_put_all);
+
+int __must_check clk_bulk_get_all(struct device *dev,
+				  struct clk_bulk_data **clks)
+{
+	struct device_node *np = dev_of_node(dev);
+
+	if (!np)
+		return 0;
+
+	return of_clk_bulk_get_all(np, clks);
+}
+EXPORT_SYMBOL(clk_bulk_get_all);
+
 #ifdef CONFIG_HAVE_CLK_PREPARE
 
 /**
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 4f750c4..e9433c7 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -312,7 +312,26 @@ struct clk *clk_get(struct device *dev, const char *id);
  */
 int __must_check clk_bulk_get(struct device *dev, int num_clks,
 			      struct clk_bulk_data *clks);
-
+/**
+ * clk_bulk_get_all - lookup and obtain all available references to clock
+ *		      producer.
+ * @dev: device for clock "consumer"
+ * @clks: pointer to the clk_bulk_data table of consumer
+ *
+ * This helper function allows drivers to get all clk consumers in one
+ * operation. If any of the clk cannot be acquired then any clks
+ * that were obtained will be freed before returning to the caller.
+ *
+ * Returns a positive value for the number of clocks obtained while the
+ * clock references are stored in the clk_bulk_data table in @clks field.
+ * Returns 0 if there're none and a negative value if something failed.
+ *
+ * Drivers must assume that the clock source is not enabled.
+ *
+ * clk_bulk_get should not be called from within interrupt context.
+ */
+int __must_check clk_bulk_get_all(struct device *dev,
+				  struct clk_bulk_data **clks);
 /**
  * devm_clk_bulk_get - managed get multiple clk consumers
  * @dev: device for clock "consumer"
@@ -488,6 +507,19 @@ void clk_put(struct clk *clk);
 void clk_bulk_put(int num_clks, struct clk_bulk_data *clks);
 
 /**
+ * clk_bulk_put_all - "free" all the clock source
+ * @num_clks: the number of clk_bulk_data
+ * @clks: the clk_bulk_data table of consumer
+ *
+ * Note: drivers must ensure that all clk_bulk_enable calls made on this
+ * clock source are balanced by clk_bulk_disable calls prior to calling
+ * this function.
+ *
+ * clk_bulk_put_all should not be called from within interrupt context.
+ */
+void clk_bulk_put_all(int num_clks, struct clk_bulk_data *clks);
+
+/**
  * devm_clk_put	- "free" a managed clock source
  * @dev: device used to acquire the clock
  * @clk: clock source acquired with devm_clk_get()
@@ -642,6 +674,12 @@ static inline int __must_check clk_bulk_get(struct device *dev, int num_clks,
 	return 0;
 }
 
+static inline int __must_check clk_bulk_get_all(struct device *dev,
+					 struct clk_bulk_data **clks)
+{
+	return 0;
+}
+
 static inline struct clk *devm_clk_get(struct device *dev, const char *id)
 {
 	return NULL;
@@ -663,6 +701,8 @@ static inline void clk_put(struct clk *clk) {}
 
 static inline void clk_bulk_put(int num_clks, struct clk_bulk_data *clks) {}
 
+static inline void clk_bulk_put_all(int num_clks, struct clk_bulk_data *clks) {}
+
 static inline void devm_clk_put(struct device *dev, struct clk *clk) {}
 
 
-- 
2.7.4

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

* [PATCH V6 3/4] clk: add managed version of clk_bulk_get_all
  2018-08-31  4:45 [PATCH V6 0/4] clk: new APIs to handle all available clocks Dong Aisheng
  2018-08-31  4:45 ` [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get() Dong Aisheng
  2018-08-31  4:45 ` [PATCH V6 2/4] clk: add new APIs to operate on all available clocks Dong Aisheng
@ 2018-08-31  4:45 ` Dong Aisheng
  2018-10-16 22:44   ` Stephen Boyd
  2018-08-31  4:45 ` [PATCH V6 4/4] video: simplefb: switch to use clk_bulk API to simplify clock operations Dong Aisheng
  2018-09-06  3:22 ` [PATCH V6 0/4] clk: new APIs to handle all available clocks A.s. Dong
  4 siblings, 1 reply; 15+ messages in thread
From: Dong Aisheng @ 2018-08-31  4:45 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	thor.thayer, linux-imx, hdegoede, Dong Aisheng, Stephen Boyd

This patch introduces the managed version of clk_bulk_get_all.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
v3->v4:
 * improve 'devres->clks = *clks' according to Stephen's suggestion
v2->v3:
 * a minor fix of build warning on PowerPC platform.
v1->v2:
 * new patch
---
 drivers/clk/clk-devres.c | 24 ++++++++++++++++++++++++
 include/linux/clk.h      | 23 +++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/drivers/clk/clk-devres.c b/drivers/clk/clk-devres.c
index d854e26..12c8745 100644
--- a/drivers/clk/clk-devres.c
+++ b/drivers/clk/clk-devres.c
@@ -70,6 +70,30 @@ int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
 }
 EXPORT_SYMBOL_GPL(devm_clk_bulk_get);
 
+int __must_check devm_clk_bulk_get_all(struct device *dev,
+				       struct clk_bulk_data **clks)
+{
+	struct clk_bulk_devres *devres;
+	int ret;
+
+	devres = devres_alloc(devm_clk_bulk_release,
+			      sizeof(*devres), GFP_KERNEL);
+	if (!devres)
+		return -ENOMEM;
+
+	ret = clk_bulk_get_all(dev, &devres->clks);
+	if (ret > 0) {
+		*clks = devres->clks;
+		devres->num_clks = ret;
+		devres_add(dev, devres);
+	} else {
+		devres_free(devres);
+	}
+
+	return ret;
+}
+EXPORT_SYMBOL_GPL(devm_clk_bulk_get_all);
+
 static int devm_clk_match(struct device *dev, void *res, void *data)
 {
 	struct clk **c = res;
diff --git a/include/linux/clk.h b/include/linux/clk.h
index e9433c7..c705271 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -346,6 +346,22 @@ int __must_check clk_bulk_get_all(struct device *dev,
  */
 int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
 				   struct clk_bulk_data *clks);
+/**
+ * devm_clk_bulk_get_all - managed get multiple clk consumers
+ * @dev: device for clock "consumer"
+ * @clks: pointer to the clk_bulk_data table of consumer
+ *
+ * Returns a positive value for the number of clocks obtained while the
+ * clock references are stored in the clk_bulk_data table in @clks field.
+ * Returns 0 if there're none and a negative value if something failed.
+ *
+ * This helper function allows drivers to get several clk
+ * consumers in one operation with management, the clks will
+ * automatically be freed when the device is unbound.
+ */
+
+int __must_check devm_clk_bulk_get_all(struct device *dev,
+				       struct clk_bulk_data **clks);
 
 /**
  * devm_clk_get - lookup and obtain a managed reference to a clock producer.
@@ -691,6 +707,13 @@ static inline int __must_check devm_clk_bulk_get(struct device *dev, int num_clk
 	return 0;
 }
 
+static inline int __must_check devm_clk_bulk_get_all(struct device *dev,
+						     struct clk_bulk_data **clks)
+{
+
+	return 0;
+}
+
 static inline struct clk *devm_get_clk_from_child(struct device *dev,
 				struct device_node *np, const char *con_id)
 {
-- 
2.7.4

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

* [PATCH V6 4/4] video: simplefb: switch to use clk_bulk API to simplify clock operations
  2018-08-31  4:45 [PATCH V6 0/4] clk: new APIs to handle all available clocks Dong Aisheng
                   ` (2 preceding siblings ...)
  2018-08-31  4:45 ` [PATCH V6 3/4] clk: add managed version of clk_bulk_get_all Dong Aisheng
@ 2018-08-31  4:45 ` Dong Aisheng
  2018-08-31 10:09   ` Hans de Goede
  2018-09-06  3:22 ` [PATCH V6 0/4] clk: new APIs to handle all available clocks A.s. Dong
  4 siblings, 1 reply; 15+ messages in thread
From: Dong Aisheng @ 2018-08-31  4:45 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	thor.thayer, linux-imx, hdegoede, Dong Aisheng,
	Bartlomiej Zolnierkiewicz, linux-fbdev, Masahiro Yamada,
	Stephen Boyd

Switching to use clk_bulk API to simplify clock operations.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-fbdev@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
v5->v6:
 * address Hans's comments
v4->v5:
 * fix wrong setting of par->clks_enabled
v3->v4:
 * no changes
v2->v3:
 * fix a build warning on x86 platform due to a wrong
   of the prototype of simplefb_clocks_enable
v1->v2:
 * switch to clk_bulk_get_all from of_clk_bulk_get_all
---
 drivers/video/fbdev/simplefb.c | 72 +++++++++++-------------------------------
 1 file changed, 18 insertions(+), 54 deletions(-)

diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index 9a9d748..89fb1e7 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -181,8 +181,8 @@ struct simplefb_par {
 	u32 palette[PSEUDO_PALETTE_SIZE];
 #if defined CONFIG_OF && defined CONFIG_COMMON_CLK
 	bool clks_enabled;
-	unsigned int clk_count;
-	struct clk **clks;
+	int clk_count;
+	struct clk_bulk_data *clks;
 #endif
 #if defined CONFIG_OF && defined CONFIG_REGULATOR
 	bool regulators_enabled;
@@ -214,37 +214,13 @@ static int simplefb_clocks_get(struct simplefb_par *par,
 			       struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	struct clk *clock;
-	int i;
 
 	if (dev_get_platdata(&pdev->dev) || !np)
 		return 0;
 
-	par->clk_count = of_clk_get_parent_count(np);
-	if (!par->clk_count)
-		return 0;
-
-	par->clks = kcalloc(par->clk_count, sizeof(struct clk *), GFP_KERNEL);
-	if (!par->clks)
-		return -ENOMEM;
-
-	for (i = 0; i < par->clk_count; i++) {
-		clock = of_clk_get(np, i);
-		if (IS_ERR(clock)) {
-			if (PTR_ERR(clock) == -EPROBE_DEFER) {
-				while (--i >= 0) {
-					if (par->clks[i])
-						clk_put(par->clks[i]);
-				}
-				kfree(par->clks);
-				return -EPROBE_DEFER;
-			}
-			dev_err(&pdev->dev, "%s: clock %d not found: %ld\n",
-				__func__, i, PTR_ERR(clock));
-			continue;
-		}
-		par->clks[i] = clock;
-	}
+	par->clk_count = clk_bulk_get_all(&pdev->dev, &par->clks);
+	if (par->clk_count == -EPROBE_DEFER)
+		return -EPROBE_DEFER;
 
 	return 0;
 }
@@ -252,39 +228,27 @@ static int simplefb_clocks_get(struct simplefb_par *par,
 static void simplefb_clocks_enable(struct simplefb_par *par,
 				   struct platform_device *pdev)
 {
-	int i, ret;
+	int ret;
 
-	for (i = 0; i < par->clk_count; i++) {
-		if (par->clks[i]) {
-			ret = clk_prepare_enable(par->clks[i]);
-			if (ret) {
-				dev_err(&pdev->dev,
-					"%s: failed to enable clock %d: %d\n",
-					__func__, i, ret);
-				clk_put(par->clks[i]);
-				par->clks[i] = NULL;
-			}
-		}
-	}
-	par->clks_enabled = true;
+	if (par->clk_count <= 0)
+		return;
+
+	ret = clk_bulk_prepare_enable(par->clk_count, par->clks);
+	if (ret)
+		dev_warn(&pdev->dev, "failed to enable clocks\n");
+	else
+		par->clks_enabled = true;
 }
 
 static void simplefb_clocks_destroy(struct simplefb_par *par)
 {
-	int i;
-
-	if (!par->clks)
+	if (par->clk_count <= 0)
 		return;
 
-	for (i = 0; i < par->clk_count; i++) {
-		if (par->clks[i]) {
-			if (par->clks_enabled)
-				clk_disable_unprepare(par->clks[i]);
-			clk_put(par->clks[i]);
-		}
-	}
+	if (par->clks_enabled)
+		clk_bulk_disable_unprepare(par->clk_count, par->clks);
 
-	kfree(par->clks);
+	clk_bulk_put_all(par->clk_count, par->clks);
 }
 #else
 static int simplefb_clocks_get(struct simplefb_par *par,
-- 
2.7.4

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

* Re: [PATCH V6 4/4] video: simplefb: switch to use clk_bulk API to simplify clock operations
  2018-08-31  4:45 ` [PATCH V6 4/4] video: simplefb: switch to use clk_bulk API to simplify clock operations Dong Aisheng
@ 2018-08-31 10:09   ` Hans de Goede
  0 siblings, 0 replies; 15+ messages in thread
From: Hans de Goede @ 2018-08-31 10:09 UTC (permalink / raw)
  To: Dong Aisheng, linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	thor.thayer, linux-imx, Bartlomiej Zolnierkiewicz, linux-fbdev,
	Masahiro Yamada, Stephen Boyd

Hi,

On 31-08-18 06:45, Dong Aisheng wrote:
> Switching to use clk_bulk API to simplify clock operations.
> 
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: linux-fbdev@vger.kernel.org
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---
> v5->v6:
>   * address Hans's comments

v6 looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> v4->v5:
>   * fix wrong setting of par->clks_enabled
> v3->v4:
>   * no changes
> v2->v3:
>   * fix a build warning on x86 platform due to a wrong
>     of the prototype of simplefb_clocks_enable
> v1->v2:
>   * switch to clk_bulk_get_all from of_clk_bulk_get_all
> ---
>   drivers/video/fbdev/simplefb.c | 72 +++++++++++-------------------------------
>   1 file changed, 18 insertions(+), 54 deletions(-)
> 
> diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
> index 9a9d748..89fb1e7 100644
> --- a/drivers/video/fbdev/simplefb.c
> +++ b/drivers/video/fbdev/simplefb.c
> @@ -181,8 +181,8 @@ struct simplefb_par {
>   	u32 palette[PSEUDO_PALETTE_SIZE];
>   #if defined CONFIG_OF && defined CONFIG_COMMON_CLK
>   	bool clks_enabled;
> -	unsigned int clk_count;
> -	struct clk **clks;
> +	int clk_count;
> +	struct clk_bulk_data *clks;
>   #endif
>   #if defined CONFIG_OF && defined CONFIG_REGULATOR
>   	bool regulators_enabled;
> @@ -214,37 +214,13 @@ static int simplefb_clocks_get(struct simplefb_par *par,
>   			       struct platform_device *pdev)
>   {
>   	struct device_node *np = pdev->dev.of_node;
> -	struct clk *clock;
> -	int i;
>   
>   	if (dev_get_platdata(&pdev->dev) || !np)
>   		return 0;
>   
> -	par->clk_count = of_clk_get_parent_count(np);
> -	if (!par->clk_count)
> -		return 0;
> -
> -	par->clks = kcalloc(par->clk_count, sizeof(struct clk *), GFP_KERNEL);
> -	if (!par->clks)
> -		return -ENOMEM;
> -
> -	for (i = 0; i < par->clk_count; i++) {
> -		clock = of_clk_get(np, i);
> -		if (IS_ERR(clock)) {
> -			if (PTR_ERR(clock) == -EPROBE_DEFER) {
> -				while (--i >= 0) {
> -					if (par->clks[i])
> -						clk_put(par->clks[i]);
> -				}
> -				kfree(par->clks);
> -				return -EPROBE_DEFER;
> -			}
> -			dev_err(&pdev->dev, "%s: clock %d not found: %ld\n",
> -				__func__, i, PTR_ERR(clock));
> -			continue;
> -		}
> -		par->clks[i] = clock;
> -	}
> +	par->clk_count = clk_bulk_get_all(&pdev->dev, &par->clks);
> +	if (par->clk_count == -EPROBE_DEFER)
> +		return -EPROBE_DEFER;
>   
>   	return 0;
>   }
> @@ -252,39 +228,27 @@ static int simplefb_clocks_get(struct simplefb_par *par,
>   static void simplefb_clocks_enable(struct simplefb_par *par,
>   				   struct platform_device *pdev)
>   {
> -	int i, ret;
> +	int ret;
>   
> -	for (i = 0; i < par->clk_count; i++) {
> -		if (par->clks[i]) {
> -			ret = clk_prepare_enable(par->clks[i]);
> -			if (ret) {
> -				dev_err(&pdev->dev,
> -					"%s: failed to enable clock %d: %d\n",
> -					__func__, i, ret);
> -				clk_put(par->clks[i]);
> -				par->clks[i] = NULL;
> -			}
> -		}
> -	}
> -	par->clks_enabled = true;
> +	if (par->clk_count <= 0)
> +		return;
> +
> +	ret = clk_bulk_prepare_enable(par->clk_count, par->clks);
> +	if (ret)
> +		dev_warn(&pdev->dev, "failed to enable clocks\n");
> +	else
> +		par->clks_enabled = true;
>   }
>   
>   static void simplefb_clocks_destroy(struct simplefb_par *par)
>   {
> -	int i;
> -
> -	if (!par->clks)
> +	if (par->clk_count <= 0)
>   		return;
>   
> -	for (i = 0; i < par->clk_count; i++) {
> -		if (par->clks[i]) {
> -			if (par->clks_enabled)
> -				clk_disable_unprepare(par->clks[i]);
> -			clk_put(par->clks[i]);
> -		}
> -	}
> +	if (par->clks_enabled)
> +		clk_bulk_disable_unprepare(par->clk_count, par->clks);
>   
> -	kfree(par->clks);
> +	clk_bulk_put_all(par->clk_count, par->clks);
>   }
>   #else
>   static int simplefb_clocks_get(struct simplefb_par *par,
> 

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

* RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks
  2018-08-31  4:45 [PATCH V6 0/4] clk: new APIs to handle all available clocks Dong Aisheng
                   ` (3 preceding siblings ...)
  2018-08-31  4:45 ` [PATCH V6 4/4] video: simplefb: switch to use clk_bulk API to simplify clock operations Dong Aisheng
@ 2018-09-06  3:22 ` A.s. Dong
  2018-09-16 13:24   ` A.s. Dong
  4 siblings, 1 reply; 15+ messages in thread
From: A.s. Dong @ 2018-09-06  3:22 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	thor.thayer, dl-linux-imx, hdegoede

Gently ping...

> -----Original Message-----
> From: A.s. Dong
> Sent: Friday, August 31, 2018 12:46 PM
> To: linux-clk@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> sboyd@kernel.org; mturquette@baylibre.com; shawnguo@kernel.org;
> thor.thayer@linux.intel.com; dl-linux-imx <linux-imx@nxp.com>;
> hdegoede@redhat.com; A.s. Dong <aisheng.dong@nxp.com>
> Subject: [PATCH V6 0/4] clk: new APIs to handle all available clocks
>=20
> This patch series is a continue of discussion from here,
> https://patchwork.kernel.org/patch/9986293/
> that some users may want to handle all available clocks from device tree
> without need to know the detailed clock information likes clock numbers a=
nd
> names. This is useful in writing some generic drivers to handle clock par=
t.
>=20
> Note:
> This patch series is tested on MX6Q SDB cpufreq driver with a minor chang=
e to
> switch to use clk_bulk_get_all.
> But patch 4 only test compiling. Hopefully someone could help test the
> function.
>=20
> v3->v4:
>  * improve 'devres->clks =3D *clks' according to Stephen's suggestion
> v2->v3:
>  * address all comments from Stephen
>  * fix build warnings on other architectures.
> v1->v2:
>  * add clk_bulk_{get|put}_all() which only supports DT platform currently
>  * remove _all variants and the wrapper struct clk_bulk
>  * make of_clk_bulk_get and of_clk_bulk_get_all private until someone
>    proves they need it because they don't have a struct device pointer.
>=20
> Dong Aisheng (4):
>   clk: bulk: add of_clk_bulk_get()
>   clk: add new APIs to operate on all available clocks
>   clk: add managed version of clk_bulk_get_all
>   video: simplefb: switch to use clk_bulk API to simplify clock
>     operations
>=20
>  drivers/clk/clk-bulk.c         | 80
> ++++++++++++++++++++++++++++++++++++++++++
>  drivers/clk/clk-devres.c       | 24 +++++++++++++
>  drivers/video/fbdev/simplefb.c | 72 ++++++++++--------------------------=
-
>  include/linux/clk.h            | 65
> +++++++++++++++++++++++++++++++++-
>  4 files changed, 186 insertions(+), 55 deletions(-)
>=20
> --
> 2.7.4

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

* RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks
  2018-09-06  3:22 ` [PATCH V6 0/4] clk: new APIs to handle all available clocks A.s. Dong
@ 2018-09-16 13:24   ` A.s. Dong
  2018-09-19 14:47     ` Thor Thayer
  0 siblings, 1 reply; 15+ messages in thread
From: A.s. Dong @ 2018-09-16 13:24 UTC (permalink / raw)
  To: linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	thor.thayer, dl-linux-imx, hdegoede

Ping again

> -----Original Message-----
> From: A.s. Dong
> Sent: Thursday, September 6, 2018 11:23 AM
> To: linux-clk@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> sboyd@kernel.org; mturquette@baylibre.com; shawnguo@kernel.org;
> thor.thayer@linux.intel.com; dl-linux-imx <linux-imx@nxp.com>;
> hdegoede@redhat.com
> Subject: RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks
>=20
> Gently ping...
>=20
> > -----Original Message-----
> > From: A.s. Dong
> > Sent: Friday, August 31, 2018 12:46 PM
> > To: linux-clk@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org;
> > linux-arm-kernel@lists.infradead.org;
> > sboyd@kernel.org; mturquette@baylibre.com; shawnguo@kernel.org;
> > thor.thayer@linux.intel.com; dl-linux-imx <linux-imx@nxp.com>;
> > hdegoede@redhat.com; A.s. Dong <aisheng.dong@nxp.com>
> > Subject: [PATCH V6 0/4] clk: new APIs to handle all available clocks
> >
> > This patch series is a continue of discussion from here,
> > https://patchwork.kernel.org/patch/9986293/
> > that some users may want to handle all available clocks from device
> > tree without need to know the detailed clock information likes clock
> > numbers and names. This is useful in writing some generic drivers to ha=
ndle
> clock part.
> >
> > Note:
> > This patch series is tested on MX6Q SDB cpufreq driver with a minor
> > change to switch to use clk_bulk_get_all.
> > But patch 4 only test compiling. Hopefully someone could help test the
> > function.
> >
> > v3->v4:
> >  * improve 'devres->clks =3D *clks' according to Stephen's suggestion
> > v2->v3:
> >  * address all comments from Stephen
> >  * fix build warnings on other architectures.
> > v1->v2:
> >  * add clk_bulk_{get|put}_all() which only supports DT platform
> > currently
> >  * remove _all variants and the wrapper struct clk_bulk
> >  * make of_clk_bulk_get and of_clk_bulk_get_all private until someone
> >    proves they need it because they don't have a struct device pointer.
> >
> > Dong Aisheng (4):
> >   clk: bulk: add of_clk_bulk_get()
> >   clk: add new APIs to operate on all available clocks
> >   clk: add managed version of clk_bulk_get_all
> >   video: simplefb: switch to use clk_bulk API to simplify clock
> >     operations
> >
> >  drivers/clk/clk-bulk.c         | 80
> > ++++++++++++++++++++++++++++++++++++++++++
> >  drivers/clk/clk-devres.c       | 24 +++++++++++++
> >  drivers/video/fbdev/simplefb.c | 72 ++++++++++------------------------=
---
> >  include/linux/clk.h            | 65
> > +++++++++++++++++++++++++++++++++-
> >  4 files changed, 186 insertions(+), 55 deletions(-)
> >
> > --
> > 2.7.4

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

* Re: [PATCH V6 0/4] clk: new APIs to handle all available clocks
  2018-09-16 13:24   ` A.s. Dong
@ 2018-09-19 14:47     ` Thor Thayer
  2018-09-20  2:14       ` A.s. Dong
  0 siblings, 1 reply; 15+ messages in thread
From: Thor Thayer @ 2018-09-19 14:47 UTC (permalink / raw)
  To: A.s. Dong, linux-clk
  Cc: linux-kernel, linux-arm-kernel, sboyd, mturquette, shawnguo,
	dl-linux-imx, hdegoede

Hi,

On 09/16/2018 08:24 AM, A.s. Dong wrote:
> Ping again
> 
>> -----Original Message-----
>> From: A.s. Dong
>> Sent: Thursday, September 6, 2018 11:23 AM
>> To: linux-clk@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
>> sboyd@kernel.org; mturquette@baylibre.com; shawnguo@kernel.org;
>> thor.thayer@linux.intel.com; dl-linux-imx <linux-imx@nxp.com>;
>> hdegoede@redhat.com
>> Subject: RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks
>>
>> Gently ping...
>>
>>> -----Original Message-----
>>> From: A.s. Dong
>>> Sent: Friday, August 31, 2018 12:46 PM
>>> To: linux-clk@vger.kernel.org
>>> Cc: linux-kernel@vger.kernel.org;
>>> linux-arm-kernel@lists.infradead.org;
>>> sboyd@kernel.org; mturquette@baylibre.com; shawnguo@kernel.org;
>>> thor.thayer@linux.intel.com; dl-linux-imx <linux-imx@nxp.com>;
>>> hdegoede@redhat.com; A.s. Dong <aisheng.dong@nxp.com>
>>> Subject: [PATCH V6 0/4] clk: new APIs to handle all available clocks
>>>
>>> This patch series is a continue of discussion from here,
>>> https://patchwork.kernel.org/patch/9986293/
>>> that some users may want to handle all available clocks from device
>>> tree without need to know the detailed clock information likes clock
>>> numbers and names. This is useful in writing some generic drivers to handle
>> clock part.
>>>
>>> Note:
>>> This patch series is tested on MX6Q SDB cpufreq driver with a minor
>>> change to switch to use clk_bulk_get_all.
>>> But patch 4 only test compiling. Hopefully someone could help test the
>>> function.
>>>
>>> v3->v4:
>>>   * improve 'devres->clks = *clks' according to Stephen's suggestion
>>> v2->v3:
>>>   * address all comments from Stephen
>>>   * fix build warnings on other architectures.
>>> v1->v2:
>>>   * add clk_bulk_{get|put}_all() which only supports DT platform
>>> currently
>>>   * remove _all variants and the wrapper struct clk_bulk
>>>   * make of_clk_bulk_get and of_clk_bulk_get_all private until someone
>>>     proves they need it because they don't have a struct device pointer.
>>>
>>> Dong Aisheng (4):
>>>    clk: bulk: add of_clk_bulk_get()
>>>    clk: add new APIs to operate on all available clocks
>>>    clk: add managed version of clk_bulk_get_all
>>>    video: simplefb: switch to use clk_bulk API to simplify clock
>>>      operations
>>>
>>>   drivers/clk/clk-bulk.c         | 80
>>> ++++++++++++++++++++++++++++++++++++++++++
>>>   drivers/clk/clk-devres.c       | 24 +++++++++++++
>>>   drivers/video/fbdev/simplefb.c | 72 ++++++++++---------------------------
>>>   include/linux/clk.h            | 65
>>> +++++++++++++++++++++++++++++++++-
>>>   4 files changed, 186 insertions(+), 55 deletions(-)
>>>
>>> --
>>> 2.7.4
> 
Just checking on the status of this patch. The clock routines (patches 
1-3) are useful for one of my drivers but if they aren't accepted or 
will take a long time to be accepted, I'll need to refactor my driver.

Thanks,

Thor

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

* RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks
  2018-09-19 14:47     ` Thor Thayer
@ 2018-09-20  2:14       ` A.s. Dong
  2018-10-08 10:43         ` A.s. Dong
  0 siblings, 1 reply; 15+ messages in thread
From: A.s. Dong @ 2018-09-20  2:14 UTC (permalink / raw)
  To: thor.thayer, linux-clk, sboyd
  Cc: linux-kernel, linux-arm-kernel, mturquette, shawnguo,
	dl-linux-imx, hdegoede

PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBUaG9yIFRoYXllciBbbWFpbHRv
OnRob3IudGhheWVyQGxpbnV4LmludGVsLmNvbV0NCj4gU2VudDogV2VkbmVzZGF5LCBTZXB0ZW1i
ZXIgMTksIDIwMTggMTA6NDcgUE0NCj4gVG86IEEucy4gRG9uZyA8YWlzaGVuZy5kb25nQG54cC5j
b20+OyBsaW51eC1jbGtAdmdlci5rZXJuZWwub3JnDQo+IENjOiBsaW51eC1rZXJuZWxAdmdlci5r
ZXJuZWwub3JnOyBsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmc7DQo+IHNib3lk
Q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ysrKysrKysr
KysrKysrKysrKysrKysrKysrKysrKysrKysNCj4gPj4+ICAgZHJpdmVycy9jbGsvY2xrLWRldnJl
cy5jICAgICAgIHwgMjQgKysrKysrKysrKysrKw0KPiA+Pj4gICBkcml2ZXJzL3ZpZGVvL2ZiZGV2
L3NpbXBsZWZiLmMgfCA3MiArKysrKysrKysrLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQo+
ID4+PiAgIGluY2x1ZGUvbGludXgvY2xrLmggICAgICAgICAgICB8IDY1DQo+ID4+PiArKysrKysr
KysrKysrKysrKysrKysrKysrKysrKysrKystDQo+ID4+PiAgIDQgZmlsZXMgY2hhbmdlZCwgMTg2
IGluc2VydGlvbnMoKyksIDU1IGRlbGV0aW9ucygtKQ0KPiA+Pj4NCj4gPj4+IC0tDQo+ID4+PiAy
LjcuNA0KPiA+DQo+IEp1c3QgY2hlY2tpbmcgb24gdGhlIHN0YXR1cyBvZiB0aGlzIHBhdGNoLiBU
aGUgY2xvY2sgcm91dGluZXMgKHBhdGNoZXMNCj4gMS0zKSBhcmUgdXNlZnVsIGZvciBvbmUgb2Yg
bXkgZHJpdmVycyBidXQgaWYgdGhleSBhcmVuJ3QgYWNjZXB0ZWQgb3Igd2lsbCB0YWtlIGENCj4g
bG9uZyB0aW1lIHRvIGJlIGFjY2VwdGVkLCBJJ2xsIG5lZWQgdG8gcmVmYWN0b3IgbXkgZHJpdmVy
Lg0KPiANCg0KVGhhbmtzIGZvciB0aGlzIGluZm9ybWF0aW9uLg0KDQpTdGVwaGVuLA0KV291bGQg
eW91IGhlbHAgdG8gcHJvY2VlZCB0aGlzPw0KDQpSZWdhcmRzDQpEb25nIEFpc2hlbmcNCg==

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

* RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks
  2018-09-20  2:14       ` A.s. Dong
@ 2018-10-08 10:43         ` A.s. Dong
  2018-10-13 13:33           ` A.s. Dong
  0 siblings, 1 reply; 15+ messages in thread
From: A.s. Dong @ 2018-10-08 10:43 UTC (permalink / raw)
  To: thor.thayer, linux-clk, sboyd
  Cc: linux-kernel, linux-arm-kernel, mturquette, shawnguo,
	dl-linux-imx, hdegoede

Hi Stephen,

Gently ping again..

> > >
> > Just checking on the status of this patch. The clock routines (patches
> > 1-3) are useful for one of my drivers but if they aren't accepted or
> > will take a long time to be accepted, I'll need to refactor my driver.
> >
> 
> Thanks for this information.
> 
> Stephen,
> Would you help to proceed this?
> 

Regards
Dong Aisheng

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

* RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks
  2018-10-08 10:43         ` A.s. Dong
@ 2018-10-13 13:33           ` A.s. Dong
  0 siblings, 0 replies; 15+ messages in thread
From: A.s. Dong @ 2018-10-13 13:33 UTC (permalink / raw)
  To: thor.thayer, linux-clk, sboyd
  Cc: linux-kernel, linux-arm-kernel, mturquette, shawnguo,
	dl-linux-imx, hdegoede

Ping

> -----Original Message-----
> From: A.s. Dong
> Sent: Monday, October 8, 2018 6:43 PM
> To: thor.thayer@linux.intel.com; linux-clk@vger.kernel.org; sboyd@kernel.org
> Cc: linux-kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> mturquette@baylibre.com; shawnguo@kernel.org; dl-linux-imx
> <linux-imx@nxp.com>; hdegoede@redhat.com
> Subject: RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks
> 
> Hi Stephen,
> 
> Gently ping again..
> 
> > > >
> > > Just checking on the status of this patch. The clock routines
> > > (patches
> > > 1-3) are useful for one of my drivers but if they aren't accepted or
> > > will take a long time to be accepted, I'll need to refactor my driver.
> > >
> >
> > Thanks for this information.
> >
> > Stephen,
> > Would you help to proceed this?
> >
> 
> Regards
> Dong Aisheng

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

* Re: [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get()
  2018-08-31  4:45 ` [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get() Dong Aisheng
@ 2018-10-16 22:44   ` Stephen Boyd
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2018-10-16 22:44 UTC (permalink / raw)
  To: Dong Aisheng, linux-clk
  Cc: linux-kernel, linux-arm-kernel, mturquette, shawnguo,
	thor.thayer, linux-imx, hdegoede, Dong Aisheng, Stephen Boyd,
	Russell King

Quoting Dong Aisheng (2018-08-30 21:45:53)
> 'clock-names' property is optional in DT, so of_clk_bulk_get() is
> introduced here to handle this for DT users without 'clock-names'
> specified. Later clk_bulk_get_all() will be implemented on top of
> it and this API will be kept private until someone proves they need
> it because they don't have a struct device pointer.
> 
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Reported-by: Shawn Guo <shawnguo@kernel.org>
> Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---

Applied to clk-next


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

* Re: [PATCH V6 2/4] clk: add new APIs to operate on all available clocks
  2018-08-31  4:45 ` [PATCH V6 2/4] clk: add new APIs to operate on all available clocks Dong Aisheng
@ 2018-10-16 22:44   ` Stephen Boyd
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2018-10-16 22:44 UTC (permalink / raw)
  To: Dong Aisheng, linux-clk
  Cc: linux-kernel, linux-arm-kernel, mturquette, shawnguo,
	thor.thayer, linux-imx, hdegoede, Dong Aisheng, Stephen Boyd,
	Masahiro Yamada

Quoting Dong Aisheng (2018-08-30 21:45:54)
> This patch introduces of_clk_bulk_get_all and clk_bulk_x_all APIs
> to users who just want to handle all available clocks from device tree
> without need to know the detailed clock information likes clock numbers
> and names. This is useful in writing some generic drivers to handle clock
> part.
> 
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---

Applied to clk-next


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

* Re: [PATCH V6 3/4] clk: add managed version of clk_bulk_get_all
  2018-08-31  4:45 ` [PATCH V6 3/4] clk: add managed version of clk_bulk_get_all Dong Aisheng
@ 2018-10-16 22:44   ` Stephen Boyd
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Boyd @ 2018-10-16 22:44 UTC (permalink / raw)
  To: Dong Aisheng, linux-clk
  Cc: linux-kernel, linux-arm-kernel, mturquette, shawnguo,
	thor.thayer, linux-imx, hdegoede, Dong Aisheng, Stephen Boyd

Quoting Dong Aisheng (2018-08-30 21:45:55)
> This patch introduces the managed version of clk_bulk_get_all.
> 
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Tested-by: Thor Thayer <thor.thayer@linux.intel.com>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---

Applied to clk-next


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

end of thread, other threads:[~2018-10-16 22:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31  4:45 [PATCH V6 0/4] clk: new APIs to handle all available clocks Dong Aisheng
2018-08-31  4:45 ` [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get() Dong Aisheng
2018-10-16 22:44   ` Stephen Boyd
2018-08-31  4:45 ` [PATCH V6 2/4] clk: add new APIs to operate on all available clocks Dong Aisheng
2018-10-16 22:44   ` Stephen Boyd
2018-08-31  4:45 ` [PATCH V6 3/4] clk: add managed version of clk_bulk_get_all Dong Aisheng
2018-10-16 22:44   ` Stephen Boyd
2018-08-31  4:45 ` [PATCH V6 4/4] video: simplefb: switch to use clk_bulk API to simplify clock operations Dong Aisheng
2018-08-31 10:09   ` Hans de Goede
2018-09-06  3:22 ` [PATCH V6 0/4] clk: new APIs to handle all available clocks A.s. Dong
2018-09-16 13:24   ` A.s. Dong
2018-09-19 14:47     ` Thor Thayer
2018-09-20  2:14       ` A.s. Dong
2018-10-08 10:43         ` A.s. Dong
2018-10-13 13:33           ` A.s. Dong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).