Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH 0/6] clk: Improve consumer field in debugfs clk_summary
@ 2026-11-19 13:40 Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 1/6] clk: Remove unused clk.dev Geert Uytterhoeven
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-11-19 13:40 UTC (permalink / raw)
  To: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Russell King, Paul Walmsley, Stephen Boyd,
	Brian Masney, Jerome Brunet, Sandy Huang, Heiko Stübner,
	Andy Yan, Ulf Hansson
  Cc: linux-clk, linux-renesas-soc, linux-rockchip, linux-omap,
	linux-arm-kernel, dri-devel, linux-pm, Geert Uytterhoeven

	Hi all,

When a driver uses of_clk_get_from_provider() to obtain clocks, the
latter show up as "deviceless" in the consumer column of the clk_summary
file in debugfs.

This patch series aims to improve that, by introducing a new variant
dev_clk_get_from_provider() that also takes a consumer device.
When callers provide it, the consumer's name will be shown in the
clk_summary output.

Sample clk_summary change snippet on R-Car H1 Marzen:
    - sata 1 1 0 62500000 0 0 50000 Y deviceless    of_clk_get_from_provider
    + sata 1 1 0 62500000 0 0 50000 Y fc600000.sata dev_clk_get_from_provider

Overview:
  - The first patch removes the unused "dev" member from struct clk and
    the "dev" parameter from clk_hw_create_clk(): it felt wrong to add
    yet another user of clk_hw_create_clk() passing a useless device
    pointer,
  - The second patch introduces the new dev_clk_get_from_provider()
    function,
  - Patches 3-6 convert users to the new helper:
      - The Renesas clock patch was tested on R-Car H1 and H3, and
	should work fine on other Renesas SoCs,
      - The Rockchip HDMI patch was only compile-tested, but is probably
	fine, too,
      - The OMAP2+ patch definitely needs testing,
      - The Renesas pmdomain patch depends on work in progress.

This series has been tested on R-Car H1, H3, and X5H.

Thanks for your comments!

Geert Uytterhoeven (6):
  clk: Remove unused clk.dev
  clk: Add dev_clk_get_from_provider()
  clk: renesas: Convert to dev_clk_get_from_provider()
  [RFT] drm/rockchip: dw_hdmi: Convert to dev_clk_get_from_provider()
  [RFT] ARM: OMAP2+: Convert to dev_clk_get_from_provider()
  [RFC] pmdomain: renesas: r8a78000: Convert to
    dev_clk_get_from_provider()

 arch/arm/mach-omap2/omap_device.c           |  2 +-
 arch/arm/mach-omap2/omap_hwmod.c            |  3 ++-
 drivers/clk/clk.c                           | 23 ++++++++++-----------
 drivers/clk/clk.h                           | 11 ++++------
 drivers/clk/clkdev.c                        | 14 ++++---------
 drivers/clk/renesas/clk-mstp.c              |  2 +-
 drivers/clk/renesas/r9a06g032-clocks.c      |  2 +-
 drivers/clk/renesas/renesas-cpg-mssr.c      |  2 +-
 drivers/clk/renesas/rzg2l-cpg.c             |  2 +-
 drivers/clk/renesas/rzv2h-cpg.c             |  2 +-
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c |  3 ++-
 drivers/pmdomain/renesas/r8a78000-mdlc.c    |  2 +-
 include/linux/clk.h                         | 10 +++++++--
 13 files changed, 38 insertions(+), 40 deletions(-)

-- 
2.43.0

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* [PATCH 1/6] clk: Remove unused clk.dev
  2026-11-19 13:40 [PATCH 0/6] clk: Improve consumer field in debugfs clk_summary Geert Uytterhoeven
@ 2026-11-19 13:40 ` Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 2/6] clk: Add dev_clk_get_from_provider() Geert Uytterhoeven
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-11-19 13:40 UTC (permalink / raw)
  To: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Russell King, Paul Walmsley, Stephen Boyd,
	Brian Masney, Jerome Brunet, Sandy Huang, Heiko Stübner,
	Andy Yan, Ulf Hansson
  Cc: linux-clk, linux-renesas-soc, linux-rockchip, linux-omap,
	linux-arm-kernel, dri-devel, linux-pm, Geert Uytterhoeven

This basically reverts commit efa850487a6b6742 ("clk: Inform the core
about consumer devices").

This commit added a struct device pointer member to struct clk and a
parameter to clk_hw_create_clk(), but the new member was never used
beyond setting.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/clk.c    | 14 +++++---------
 drivers/clk/clk.h    | 11 ++++-------
 drivers/clk/clkdev.c | 14 ++++----------
 3 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 673eac47450b1e1c..858f4d60ed2d97c4 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -160,7 +160,6 @@ struct clk_core {
 
 struct clk {
 	struct clk_core	*core;
-	struct device *dev;
 	const char *dev_id;
 	const char *con_id;
 	unsigned long min_rate;
@@ -4249,7 +4248,6 @@ static void free_clk(struct clk *clk)
 /**
  * clk_hw_create_clk: Allocate and link a clk consumer to a clk_core given
  * a clk_hw
- * @dev: clk consumer device
  * @hw: clk_hw associated with the clk being consumed
  * @dev_id: string describing device name
  * @con_id: connection ID string on device
@@ -4259,9 +4257,8 @@ static void free_clk(struct clk *clk)
  * consumers. It connects a consumer to the clk_core and clk_hw structures
  * used by the framework and clk provider respectively.
  */
-struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
-			      const char *dev_id, const char *con_id,
-			      struct module *owner)
+struct clk *clk_hw_create_clk(struct clk_hw *hw, const char *dev_id,
+			      const char *con_id, struct module *owner)
 {
 	struct clk *clk;
 	struct clk_core *core;
@@ -4274,7 +4271,6 @@ struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
 	clk = alloc_clk(core, dev_id, con_id);
 	if (IS_ERR(clk))
 		return clk;
-	clk->dev = dev;
 
 	/*
 	 * Pin the provider module only when the consumer lives in a different
@@ -4303,7 +4299,7 @@ struct clk *__clk_hw_get_clk(struct clk_hw *hw, const char *con_id,
 	struct device *dev = hw->core->dev;
 	const char *name = dev ? dev_name(dev) : NULL;
 
-	return clk_hw_create_clk(dev, hw, name, con_id, owner);
+	return clk_hw_create_clk(hw, name, con_id, owner);
 }
 EXPORT_SYMBOL(__clk_hw_get_clk);
 
@@ -5392,7 +5388,7 @@ struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
 {
 	struct clk_hw *hw = of_clk_get_hw_from_clkspec(clkspec);
 
-	return clk_hw_create_clk(NULL, hw, NULL, __func__, NULL);
+	return clk_hw_create_clk(hw, NULL, __func__, NULL);
 }
 EXPORT_SYMBOL_GPL(of_clk_get_from_provider);
 
@@ -5420,7 +5416,7 @@ static struct clk *__of_clk_get(struct device_node *np,
 {
 	struct clk_hw *hw = of_clk_get_hw(np, index, con_id);
 
-	return clk_hw_create_clk(NULL, hw, dev_id, con_id, NULL);
+	return clk_hw_create_clk(hw, dev_id, con_id, NULL);
 }
 
 struct clk *of_clk_get(struct device_node *np, int index)
diff --git a/drivers/clk/clk.h b/drivers/clk/clk.h
index 5009380863a9dc6f..ba23700149de0445 100644
--- a/drivers/clk/clk.h
+++ b/drivers/clk/clk.h
@@ -5,8 +5,6 @@
  */
 
 struct clk_hw;
-struct device;
-struct of_phandle_args;
 
 #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
 struct clk_hw *of_clk_get_hw(struct device_node *np,
@@ -22,15 +20,14 @@ static inline struct clk_hw *of_clk_get_hw(struct device_node *np,
 struct clk_hw *clk_find_hw(const char *dev_id, const char *con_id);
 
 #ifdef CONFIG_COMMON_CLK
-struct clk *clk_hw_create_clk(struct device *dev, struct clk_hw *hw,
-			      const char *dev_id, const char *con_id,
-			      struct module *owner);
+struct clk *clk_hw_create_clk(struct clk_hw *hw, const char *dev_id,
+			      const char *con_id, struct module *owner);
 void __clk_put(struct clk *clk);
 #else
 /* All these casts to avoid ifdefs in clkdev... */
 static inline struct clk *
-clk_hw_create_clk(struct device *dev, struct clk_hw *hw, const char *dev_id,
-		  const char *con_id, struct module *owner)
+clk_hw_create_clk(struct clk_hw *hw, const char *dev_id, const char *con_id,
+		  struct module *owner)
 {
 	return (struct clk *)hw;
 }
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 919fc680ae4dd6ec..e963f878290564da 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -83,17 +83,11 @@ struct clk_hw *clk_find_hw(const char *dev_id, const char *con_id)
 	return hw;
 }
 
-static struct clk *__clk_get_sys(struct device *dev, const char *dev_id,
-				 const char *con_id)
+struct clk *clk_get_sys(const char *dev_id, const char *con_id)
 {
 	struct clk_hw *hw = clk_find_hw(dev_id, con_id);
 
-	return clk_hw_create_clk(dev, hw, dev_id, con_id, NULL);
-}
-
-struct clk *clk_get_sys(const char *dev_id, const char *con_id)
-{
-	return __clk_get_sys(NULL, dev_id, con_id);
+	return clk_hw_create_clk(hw, dev_id, con_id, NULL);
 }
 EXPORT_SYMBOL(clk_get_sys);
 
@@ -105,10 +99,10 @@ struct clk *clk_get(struct device *dev, const char *con_id)
 	if (dev && dev->of_node) {
 		hw = of_clk_get_hw(dev->of_node, 0, con_id);
 		if (!IS_ERR(hw) || PTR_ERR(hw) == -EPROBE_DEFER)
-			return clk_hw_create_clk(dev, hw, dev_id, con_id, NULL);
+			return clk_hw_create_clk(hw, dev_id, con_id, NULL);
 	}
 
-	return __clk_get_sys(dev, dev_id, con_id);
+	return clk_get_sys(dev_id, con_id);
 }
 EXPORT_SYMBOL(clk_get);
 
-- 
2.43.0


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

* [PATCH 2/6] clk: Add dev_clk_get_from_provider()
  2026-11-19 13:40 [PATCH 0/6] clk: Improve consumer field in debugfs clk_summary Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 1/6] clk: Remove unused clk.dev Geert Uytterhoeven
@ 2026-11-19 13:40 ` Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 3/6] clk: renesas: Convert to dev_clk_get_from_provider() Geert Uytterhoeven
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-11-19 13:40 UTC (permalink / raw)
  To: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Russell King, Paul Walmsley, Stephen Boyd,
	Brian Masney, Jerome Brunet, Sandy Huang, Heiko Stübner,
	Andy Yan, Ulf Hansson
  Cc: linux-clk, linux-renesas-soc, linux-rockchip, linux-omap,
	linux-arm-kernel, dri-devel, linux-pm, Geert Uytterhoeven

Clocks obtained through of_clk_get_from_provider() show up as
"deviceless" in the consumer column of the clk_summary file in debugfs.
Add a new variant dev_clk_get_from_provider() that also takes a consumer
device, so callers can provide it, and consumer's name will be shown in
the clk_summary output.

Reimplement of_clk_get_from_provider() on top of
dev_clk_get_from_provider().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/clk.c   | 11 +++++++----
 include/linux/clk.h | 10 ++++++++--
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 858f4d60ed2d97c4..195c7d80e4f2b579 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -5377,20 +5377,23 @@ of_clk_get_hw_from_clkspec(struct of_phandle_args *clkspec)
 }
 
 /**
- * of_clk_get_from_provider() - Lookup a clock from a clock provider
+ * dev_clk_get_from_provider() - Lookup a clock from a clock provider
+ * @dev: clk consumer device
  * @clkspec: pointer to a clock specifier data structure
  *
  * This function looks up a struct clk from the registered list of clock
  * providers, an input is a clock specifier data structure as returned
  * from the OF phandle parser.
  */
-struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
+struct clk *dev_clk_get_from_provider(struct device *dev,
+				      struct of_phandle_args *clkspec)
 {
 	struct clk_hw *hw = of_clk_get_hw_from_clkspec(clkspec);
+	const char *name = dev ? dev_name(dev) : NULL;
 
-	return clk_hw_create_clk(hw, NULL, __func__, NULL);
+	return clk_hw_create_clk(hw, name, __func__, NULL);
 }
-EXPORT_SYMBOL_GPL(of_clk_get_from_provider);
+EXPORT_SYMBOL_GPL(dev_clk_get_from_provider);
 
 struct clk_hw *of_clk_get_hw(struct device_node *np, int index,
 			     const char *con_id)
diff --git a/include/linux/clk.h b/include/linux/clk.h
index db9cf184fd999b85..45c6eb09436036bb 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -1261,7 +1261,8 @@ static inline struct clk *clk_get_optional(struct device *dev, const char *id)
 #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
 struct clk *of_clk_get(struct device_node *np, int index);
 struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
-struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
+struct clk *dev_clk_get_from_provider(struct device *dev,
+				      struct of_phandle_args *clkspec);
 #else
 static inline struct clk *of_clk_get(struct device_node *np, int index)
 {
@@ -1272,10 +1273,15 @@ static inline struct clk *of_clk_get_by_name(struct device_node *np,
 {
 	return ERR_PTR(-ENOENT);
 }
-static inline struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
+static inline struct clk *dev_clk_get_from_provider(struct device *dev,
+						    struct of_phandle_args *clkspec)
 {
 	return ERR_PTR(-ENOENT);
 }
 #endif
+static inline struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec)
+{
+	return dev_clk_get_from_provider(NULL, clkspec);
+}
 
 #endif
-- 
2.43.0


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

* [PATCH 3/6] clk: renesas: Convert to dev_clk_get_from_provider()
  2026-11-19 13:40 [PATCH 0/6] clk: Improve consumer field in debugfs clk_summary Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 1/6] clk: Remove unused clk.dev Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 2/6] clk: Add dev_clk_get_from_provider() Geert Uytterhoeven
@ 2026-11-19 13:40 ` Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 4/6] [RFT] drm/rockchip: dw_hdmi: " Geert Uytterhoeven
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-11-19 13:40 UTC (permalink / raw)
  To: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Russell King, Paul Walmsley, Stephen Boyd,
	Brian Masney, Jerome Brunet, Sandy Huang, Heiko Stübner,
	Andy Yan, Ulf Hansson
  Cc: linux-clk, linux-renesas-soc, linux-rockchip, linux-omap,
	linux-arm-kernel, dri-devel, linux-pm, Geert Uytterhoeven

Renesas clock domain callbacks use of_clk_get_from_provider() to obtain
clocks used for power management, so the latter show up as "deviceless"
in the consumer column of the clk_summary file in debugfs.

Fix this by using dev_clk_get_from_provider() instead, letting us pass
the consumer device, too.

Sample clk_summary change snippet on R-Car H1 Marzen:
    - sata 1 1 0 62500000 0 0 50000 Y deviceless    of_clk_get_from_provider
    + sata 1 1 0 62500000 0 0 50000 Y fc600000.sata dev_clk_get_from_provider

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Tested on R-Car H1 and H3.
---
 drivers/clk/renesas/clk-mstp.c         | 2 +-
 drivers/clk/renesas/r9a06g032-clocks.c | 2 +-
 drivers/clk/renesas/renesas-cpg-mssr.c | 2 +-
 drivers/clk/renesas/rzg2l-cpg.c        | 2 +-
 drivers/clk/renesas/rzv2h-cpg.c        | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
index 1bd2acb7e175f9c7..79d3a0b9cf7bb08a 100644
--- a/drivers/clk/renesas/clk-mstp.c
+++ b/drivers/clk/renesas/clk-mstp.c
@@ -276,7 +276,7 @@ int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
 	return 0;
 
 found:
-	clk = of_clk_get_from_provider(&clkspec);
+	clk = dev_clk_get_from_provider(dev, &clkspec);
 	of_node_put(clkspec.np);
 
 	if (IS_ERR(clk))
diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c
index 871a915c24b8b609..9ae716dc6ede3438 100644
--- a/drivers/clk/renesas/r9a06g032-clocks.c
+++ b/drivers/clk/renesas/r9a06g032-clocks.c
@@ -748,7 +748,7 @@ static int create_add_module_clock(struct of_phandle_args *clkspec,
 	struct clk *clk;
 	int error;
 
-	clk = of_clk_get_from_provider(clkspec);
+	clk = dev_clk_get_from_provider(dev, clkspec);
 	if (IS_ERR(clk))
 		return PTR_ERR(clk);
 
diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c
index 1ed11ce4a04c8b44..1fc12132acfe4a8b 100644
--- a/drivers/clk/renesas/renesas-cpg-mssr.c
+++ b/drivers/clk/renesas/renesas-cpg-mssr.c
@@ -641,7 +641,7 @@ int cpg_mssr_attach_dev(struct generic_pm_domain *unused, struct device *dev)
 	return 0;
 
 found:
-	clk = of_clk_get_from_provider(&clkspec);
+	clk = dev_clk_get_from_provider(dev, &clkspec);
 	of_node_put(clkspec.np);
 
 	if (IS_ERR(clk))
diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
index 06ae7228a95480fd..fb57d26947e1647c 100644
--- a/drivers/clk/renesas/rzg2l-cpg.c
+++ b/drivers/clk/renesas/rzg2l-cpg.c
@@ -2557,7 +2557,7 @@ static int rzg2l_cpg_attach_dev(struct generic_pm_domain *domain, struct device
 				goto err;
 			}
 		}
-		clk = of_clk_get_from_provider(&clkspec);
+		clk = dev_clk_get_from_provider(dev, &clkspec);
 		of_node_put(clkspec.np);
 		if (IS_ERR(clk)) {
 			error = PTR_ERR(clk);
diff --git a/drivers/clk/renesas/rzv2h-cpg.c b/drivers/clk/renesas/rzv2h-cpg.c
index fabeaef8e62fba33..4b685f7250f661bd 100644
--- a/drivers/clk/renesas/rzv2h-cpg.c
+++ b/drivers/clk/renesas/rzv2h-cpg.c
@@ -1483,7 +1483,7 @@ static int rzv2h_cpg_attach_dev(struct generic_pm_domain *domain, struct device
 				goto err;
 			}
 		}
-		clk = of_clk_get_from_provider(&clkspec);
+		clk = dev_clk_get_from_provider(dev, &clkspec);
 		of_node_put(clkspec.np);
 		if (IS_ERR(clk)) {
 			error = PTR_ERR(clk);
-- 
2.43.0


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

* [PATCH 4/6] [RFT] drm/rockchip: dw_hdmi: Convert to dev_clk_get_from_provider()
  2026-11-19 13:40 [PATCH 0/6] clk: Improve consumer field in debugfs clk_summary Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2026-11-19 13:40 ` [PATCH 3/6] clk: renesas: Convert to dev_clk_get_from_provider() Geert Uytterhoeven
@ 2026-11-19 13:40 ` Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 5/6] [RFT] ARM: OMAP2+: " Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 6/6] [RFC] pmdomain: renesas: r8a78000: " Geert Uytterhoeven
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-11-19 13:40 UTC (permalink / raw)
  To: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Russell King, Paul Walmsley, Stephen Boyd,
	Brian Masney, Jerome Brunet, Sandy Huang, Heiko Stübner,
	Andy Yan, Ulf Hansson
  Cc: linux-clk, linux-renesas-soc, linux-rockchip, linux-omap,
	linux-arm-kernel, dri-devel, linux-pm, Geert Uytterhoeven

The Rockchip Designware HDMI driver uses of_clk_get_from_provider() to
obtain the clock for the HDMI PHY, so the latter shows up as
"deviceless" in the consumer column of the clk_summary file in debugfs.

Fix this by using dev_clk_get_from_provider() instead, letting us pass
the consumer device, too.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index b6e154c35e7c290e..a44e4b273924430e 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -633,7 +633,8 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
 
 		if (!of_parse_phandle_with_args(np, "phys", "#phy-cells", index,
 						&clkspec)) {
-			hdmi->hdmiphy_clk = of_clk_get_from_provider(&clkspec);
+			hdmi->hdmiphy_clk = dev_clk_get_from_provider(dev,
+								      &clkspec);
 			of_node_put(clkspec.np);
 			if (IS_ERR(hdmi->hdmiphy_clk))
 				hdmi->hdmiphy_clk = NULL;
-- 
2.43.0


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

* [PATCH 5/6] [RFT] ARM: OMAP2+: Convert to dev_clk_get_from_provider()
  2026-11-19 13:40 [PATCH 0/6] clk: Improve consumer field in debugfs clk_summary Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2026-11-19 13:40 ` [PATCH 4/6] [RFT] drm/rockchip: dw_hdmi: " Geert Uytterhoeven
@ 2026-11-19 13:40 ` Geert Uytterhoeven
  2026-11-19 13:40 ` [PATCH 6/6] [RFC] pmdomain: renesas: r8a78000: " Geert Uytterhoeven
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-11-19 13:40 UTC (permalink / raw)
  To: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Russell King, Paul Walmsley, Stephen Boyd,
	Brian Masney, Jerome Brunet, Sandy Huang, Heiko Stübner,
	Andy Yan, Ulf Hansson
  Cc: linux-clk, linux-renesas-soc, linux-rockchip, linux-omap,
	linux-arm-kernel, dri-devel, linux-pm, Geert Uytterhoeven

OMAP2+ clock handling uses of_clk_get_from_provider() to obtain clocks
used for power management, so the latter show up as "deviceless" in the
consumer column of the clk_summary file in debugfs.

Fix this by using dev_clk_get_from_provider() instead, letting us pass
the consumer device, too.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.

The first change is probably OK.  The second change may fail if anything
in the oh->od->pdev->dev chain is not available yet at this point.
---
 arch/arm/mach-omap2/omap_device.c | 2 +-
 arch/arm/mach-omap2/omap_hwmod.c  | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c
index 77a75b0b9ae69c85..5695e0c8f2392eca 100644
--- a/arch/arm/mach-omap2/omap_device.c
+++ b/arch/arm/mach-omap2/omap_device.c
@@ -73,7 +73,7 @@ static void _add_clkdev(struct omap_device *od, const char *clk_alias,
 
 		clkspec.np = of_find_node_by_name(NULL, clk_name);
 
-		r = of_clk_get_from_provider(&clkspec);
+		r = dev_clk_get_from_provider(&od->pdev->dev, &clkspec);
 
 		rc = clk_register_clkdev(r, clk_alias,
 					 dev_name(&od->pdev->dev));
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 03cd523dff874bb0..5e4123014909d4ac 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -147,6 +147,7 @@
 #include <asm/system_misc.h>
 
 #include "clock.h"
+#include "omap_device.h"
 #include "omap_hwmod.h"
 
 #include "soc.h"
@@ -796,7 +797,7 @@ static struct clk *_lookup_clkctrl_clk(struct omap_hwmod *oh)
 				clkspec.args[0] = addr - provider->addr[0];
 				clkspec.args[1] = 0;
 
-				clk = of_clk_get_from_provider(&clkspec);
+				clk = dev_clk_get_from_provider(&oh->od->pdev->dev, &clkspec);
 
 				pr_debug("%s: %s got %p (offset=%x, provider=%pOF)\n",
 					 __func__, oh->name, clk,
-- 
2.43.0


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

* [PATCH 6/6] [RFC] pmdomain: renesas: r8a78000: Convert to dev_clk_get_from_provider()
  2026-11-19 13:40 [PATCH 0/6] clk: Improve consumer field in debugfs clk_summary Geert Uytterhoeven
                   ` (4 preceding siblings ...)
  2026-11-19 13:40 ` [PATCH 5/6] [RFT] ARM: OMAP2+: " Geert Uytterhoeven
@ 2026-11-19 13:40 ` Geert Uytterhoeven
  5 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-11-19 13:40 UTC (permalink / raw)
  To: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
	Tony Lindgren, Russell King, Paul Walmsley, Stephen Boyd,
	Brian Masney, Jerome Brunet, Sandy Huang, Heiko Stübner,
	Andy Yan, Ulf Hansson
  Cc: linux-clk, linux-renesas-soc, linux-rockchip, linux-omap,
	linux-arm-kernel, dri-devel, linux-pm, Geert Uytterhoeven

The R-Car X5H clock domain callback uses of_clk_get_from_provider() to
obtain clocks used for power management, so the latter show up as
"deviceless" in the consumer column of the clk_summary file in debugfs.

Fix this by using dev_clk_get_from_provider() instead, letting us pass
the consumer device, too.

Sample clk_summary change snippet on R-Car X5H Ironhide:
    - hscif0 1 1 0 0 0 0 50000 Y deviceless      dev_clk_get_from_provider
    + hscif0 1 1 0 0 0 0 50000 Y c0710000.serial dev_clk_get_from_provider

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This depends on "[PATCH v5 14/15] pmdomain: renesas: r8a78000: Add SCMI
remapping support"
https://lore.kernel.org/e6816327da51f9fbeef67f13aac723b891e5042f.1795029012.git.geert+renesas@glider.be/
---
 drivers/pmdomain/renesas/r8a78000-mdlc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pmdomain/renesas/r8a78000-mdlc.c b/drivers/pmdomain/renesas/r8a78000-mdlc.c
index 79f6f1a9ae95d245..bb8c9f2b68fbf746 100644
--- a/drivers/pmdomain/renesas/r8a78000-mdlc.c
+++ b/drivers/pmdomain/renesas/r8a78000-mdlc.c
@@ -232,7 +232,7 @@ static struct clk *scmi_get_clk(struct device *dev, struct device_node *np,
 	if (fw_id < 0)
 		return NULL;
 
-	clk = of_clk_get_from_provider(&scmi_spec);
+	clk = dev_clk_get_from_provider(dev, &scmi_spec);
 	if (IS_ERR(clk))
 		dev_err(dev, "Cannot get SCMI clock %d: %pe\n", fw_id, clk);
 	else
-- 
2.43.0


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

end of thread, other threads:[~2026-11-19 13:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 13:40 [PATCH 0/6] clk: Improve consumer field in debugfs clk_summary Geert Uytterhoeven
2026-11-19 13:40 ` [PATCH 1/6] clk: Remove unused clk.dev Geert Uytterhoeven
2026-11-19 13:40 ` [PATCH 2/6] clk: Add dev_clk_get_from_provider() Geert Uytterhoeven
2026-11-19 13:40 ` [PATCH 3/6] clk: renesas: Convert to dev_clk_get_from_provider() Geert Uytterhoeven
2026-11-19 13:40 ` [PATCH 4/6] [RFT] drm/rockchip: dw_hdmi: " Geert Uytterhoeven
2026-11-19 13:40 ` [PATCH 5/6] [RFT] ARM: OMAP2+: " Geert Uytterhoeven
2026-11-19 13:40 ` [PATCH 6/6] [RFC] pmdomain: renesas: r8a78000: " Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox