Skip to contentSkip to conversation

clk: new APIs to handle all available clocks

PATCH Applied Dong Aisheng 4 participants 15 messages Aug 31, 2018 – Oct 16, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v6 cover 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(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v6 1/4 clk: bulk: add of_clk_bulk_get()

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

---
v3->v4:
* no changes
v2->v3:
* remove #if define condition
* remove EXPORT_SYMBOL

---
 drivers/clk/clk-bulk.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
drivers/clk/clk-bulk.c +29 -0
index 6904ed6..4460ac5 100644
@@ -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)
 {
Signature · 1 line
2.7.4
maintainer Applied
#2 lore raw

Re: [PATCH V6 1/4] clk: bulk: add of_clk_bulk_get()

Quoting Dong Aisheng (2018-08-30 21:45:53)

Quoted 6 lines

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

Quoted 7 lines

---

Applied to clk-next

#3 lore raw

PATCH v6 2/4 clk: add new APIs to operate on all available clocks

In reply to Dong Aisheng

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.

---
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(-)
drivers/clk/clk-bulk.c +51 -0
index 4460ac5..6a7118d 100644
@@ -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
 
 /**
include/linux/clk.h +41 -1

66 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer Applied
#4 lore raw

Re: [PATCH V6 2/4] clk: add new APIs to operate on all available clocks

Quoting Dong Aisheng (2018-08-30 21:45:54)

Quoted 11 lines

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.

---

Applied to clk-next

#5 lore raw

PATCH v6 3/4 clk: add managed version of clk_bulk_get_all

In reply to Dong Aisheng

This patch introduces the managed version of clk_bulk_get_all.

---
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(+)
drivers/clk/clk-devres.c +24 -0
index d854e26..12c8745 100644
@@ -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;
include/linux/clk.h +23 -0
index e9433c7..c705271 100644
@@ -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)
 {
Signature · 1 line
2.7.4
#7 lore raw

PATCH v6 4/4 video: simplefb: switch to use clk_bulk API to simplify clock operations

In reply to Dong Aisheng

Switching to use clk_bulk API to simplify clock operations.

Cc Hans de Goede <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc linux-fbdev at vger.kernel.org
Cc Masahiro Yamada <[email protected]>
Cc Stephen Boyd <[email protected]>

---
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(-)
drivers/video/fbdev/simplefb.c +18 -54
index 9a9d748..89fb1e7 100644
@@ -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,
Signature · 1 line
2.7.4
Reviewed-by on v6 4/4
#8 lore raw

Re: [PATCH V6 4/4] video: simplefb: switch to use clk_bulk API to simplify clock operations

Hi,

Quoted 9 lines · Dong Aisheng

Switching to use clk_bulk API to simplify clock operations.

Cc Hans de Goede <[email protected]>
Cc Bartlomiej Zolnierkiewicz <[email protected]>
Cc linux-fbdev at vger.kernel.org
Cc Masahiro Yamada <[email protected]>
Cc Stephen Boyd <[email protected]>
Quoted 3 lines

---
v5->v6:
* address Hans's comments

v6 looks good to me:

Regards,

Hans

Quoted 123 lines

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(-)
drivers/video/fbdev/simplefb.c +18 -54
index 9a9d748..89fb1e7 100644
@@ -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,
author
#9 lore raw
In reply to Dong Aisheng

Gently ping...

Quoted 50 lines

-----Original Message-----
From: A.s. Dong
Sent: Friday, August 31, 2018 12:46 PM
To: linux-clk at vger.kernel.org
Cc: linux-kernel at vger.kernel.org; linux-arm-kernel at lists.infradead.org; sboyd at kernel.org; mturquette at baylibre.com; shawnguo at kernel.org; thor.thayer at linux.intel.com; dl-linux-imx <[email protected]>; hdegoede at redhat.com; A.s. Dong <[email protected]>
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

author
#10 lore raw

Ping again

Quoted 65 lines

-----Original Message-----
From: A.s. Dong
Sent: Thursday, September 6, 2018 11:23 AM
To: linux-clk at vger.kernel.org
Cc: linux-kernel at vger.kernel.org; linux-arm-kernel at lists.infradead.org; sboyd at kernel.org; mturquette at baylibre.com; shawnguo at kernel.org; thor.thayer at linux.intel.com; dl-linux-imx <[email protected]>; hdegoede at redhat.com
Subject: RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks

Gently ping...

Quoted 11 lines

-----Original Message-----
From: A.s. Dong
Sent: Friday, August 31, 2018 12:46 PM
To: linux-clk at vger.kernel.org
Cc: linux-kernel at vger.kernel.org;
linux-arm-kernel at lists.infradead.org;
sboyd at kernel.org; mturquette at baylibre.com; shawnguo at kernel.org; thor.thayer at linux.intel.com; dl-linux-imx <[email protected]>; hdegoede at redhat.com; A.s. Dong <[email protected]>
Subject: [PATCH V6 0/4] clk: new APIs to handle all available clocks

Quoted 5 lines

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.

Quoted 36 lines

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

#11 lore raw

Hi,

Quoted 68 lines · A.s. Dong

Ping again

Quoted 65 lines

-----Original Message-----
From: A.s. Dong
Sent: Thursday, September 6, 2018 11:23 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]
Subject: RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks

Gently ping...

Quoted 11 lines

-----Original Message-----
From: A.s. Dong
Sent: Friday, August 31, 2018 12:46 PM
To: [email protected]
Cc: [email protected]; [email protected];
[email protected]; [email protected]; [email protected]; [email protected]; dl-linux-imx <[email protected]>; [email protected]; A.s. Dong <[email protected]>
Subject: [PATCH V6 0/4] clk: new APIs to handle all available clocks

Quoted 5 lines

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.

Quoted 36 lines

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

author
#12 lore raw
Quoted 90 lines

-----Original Message-----
From: Thor Thayer [mailto:thor.thayer at linux.intel.com]
Sent: Wednesday, September 19, 2018 10:47 PM
To: A.s. Dong <[email protected]>; linux-clk at vger.kernel.org
Cc: linux-kernel at vger.kernel.org; linux-arm-kernel at lists.infradead.org; sboyd at kernel.org; mturquette at baylibre.com; shawnguo at kernel.org; dl-linux-imx <[email protected]>; hdegoede at redhat.com
Subject: Re: [PATCH V6 0/4] clk: new APIs to handle all available clocks

Hi,

Quoted 30 lines · A.s. Dong

Ping again

Quoted 28 lines

-----Original Message-----
From: A.s. Dong
Sent: Thursday, September 6, 2018 11:23 AM
To: linux-clk at vger.kernel.org
Cc: linux-kernel at vger.kernel.org;
linux-arm-kernel at lists.infradead.org;
sboyd at kernel.org; mturquette at baylibre.com; shawnguo at kernel.org; thor.thayer at linux.intel.com; dl-linux-imx <[email protected]>; hdegoede at redhat.com
Subject: RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks

Gently ping...

Quoted 14 lines

-----Original Message-----
From: A.s. Dong
Sent: Friday, August 31, 2018 12:46 PM
To: linux-clk at vger.kernel.org
Cc: linux-kernel at vger.kernel.org;
linux-arm-kernel at lists.infradead.org;
sboyd at kernel.org; mturquette at baylibre.com; shawnguo at kernel.org; thor.thayer at linux.intel.com; dl-linux-imx <[email protected]>; hdegoede at redhat.com; A.s. Dong <[email protected]>
Subject: [PATCH V6 0/4] clk: new APIs to handle all available clocks

This patch series is a continue of discussion from here,
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fp

atchwork.kernel.org%2Fpatch%2F9986293%2F&amp;data=02%7C01%7Caishe ng.

Quoted 1 line
Quoted 1 line
Quoted 1 line

dong%40nxp.com%7Cb79f0aa8c74c4f935adb08d61e3e7944%7C686ea1d3bc 2b4c6f

Quoted 1 line
Quoted 1 line
Quoted 1 line

a92cd99c5c301635%7C0%7C0%7C636729651014549633&amp;sdata=zh0RP Vt4pqyM

Quoted 40 lines
Quoted 40 lines
Quoted 5 lines

84SUFRpDcbIH583JNONlBhTQeLYwDFo%3D&amp;reserved=0
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.

Quoted 34 lines

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(-)
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

--
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 for this information.

Stephen,
Would you help to proceed this?

Regards
Dong Aisheng

author
#13 lore raw

Hi Stephen,

Gently ping again..

Quoted 11 lines
Quoted 5 lines
Quoted 1 line

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

author
#14 lore raw

Ping

Quoted 28 lines

-----Original Message-----
From: A.s. Dong
Sent: Monday, October 8, 2018 6:43 PM
To: thor.thayer at linux.intel.com; linux-clk at vger.kernel.org; sboyd at kernel.org
Cc: linux-kernel at vger.kernel.org; linux-arm-kernel at lists.infradead.org; mturquette at baylibre.com; shawnguo at kernel.org; dl-linux-imx <[email protected]>; hdegoede at redhat.com
Subject: RE: [PATCH V6 0/4] clk: new APIs to handle all available clocks

Hi Stephen,

Gently ping again..

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

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.

Quoted 5 lines

Thanks for this information.

Stephen,
Would you help to proceed this?

Regards
Dong Aisheng