Re: [PATCH 0/2] clk: add a clk_hw helpers to get the clock device or device_node

From: Jerome Brunet
Date: Mon Jun 02 2025 - 07:59:27 EST


On Thu 17 Apr 2025 at 15:44, Jerome Brunet <jbrunet@xxxxxxxxxxxx> wrote:

> This patchset adds helpers to get the device or device_node associated with
> clk_hw. This can be used by clock drivers to access various device related
> functionality. The 2nd changes adds kunit test coverage for the new helpers
>
> This patchset is the v4 of the series previously sent here [1], with the
> amlogic patches dropped for now. I'll resume the work on the amlogic
> changes when the helpers are available in CCF core.

Hi Stephen,

Gentle reminder.
We have been stuck on this for a few months now. Could please take patch
#1 at least. There is a significant amount queued on this on and it
would really help.

Thanks

>
> Added tests run example:
> KTAP version 1
> # Subtest: clk_hw_register_get_dev_of_node_test_suite
> # module: clk_test
> 1..2
> KTAP version 1
> # Subtest: clk_hw_register_get_dev_test
> ok 1 clock with device reference
> ok 2 clock missing device reference
> # clk_hw_register_get_dev_test: pass:2 fail:0 skip:0 total:2
> ok 1 clk_hw_register_get_dev_test
> KTAP version 1
> # Subtest: clk_hw_register_get_of_node_test
> ok 1 clock with device reference
> ok 2 clock missing device reference
> # clk_hw_register_get_of_node_test: pass:2 fail:0 skip:0 total:2
> ok 2 clk_hw_register_get_of_node_test
> # clk_hw_register_get_dev_of_node_test_suite: pass:2 fail:0 skip:0 total:2
> # Totals: pass:4 fail:0 skip:0 total:4
> ok 17 clk_hw_register_get_dev_of_node_test_suite
> KTAP version 1
> # Subtest: of_clk_hw_register_get_dev_of_node_test_suite
> # module: clk_test
> 1..2
> KTAP version 1
> # Subtest: of_clk_hw_register_get_dev_test
> ok 1 clock with of_node reference
> ok 2 clock missing of_node reference
> # of_clk_hw_register_get_dev_test: pass:2 fail:0 skip:0 total:2
> ok 1 of_clk_hw_register_get_dev_test
> KTAP version 1
> # Subtest: of_clk_hw_register_get_of_node_test
> ok 1 clock with of_node reference
> ok 2 clock missing of_node reference
> # of_clk_hw_register_get_of_node_test: pass:2 fail:0 skip:0 total:2
> ok 2 of_clk_hw_register_get_of_node_test
> # of_clk_hw_register_get_dev_of_node_test_suite: pass:2 fail:0 skip:0 total:2
> # Totals: pass:4 fail:0 skip:0 total:4
>
> [1]: https://lore.kernel.org/linux-clk/20250120-amlogic-clk-drop-clk-regmap-tables-v3-0-126244146947@xxxxxxxxxxxx
>
> Signed-off-by: Jerome Brunet <jbrunet@xxxxxxxxxxxx>
> ---
> Jerome Brunet (2):
> clk: add a clk_hw helpers to get the clock device or device_node
> clk: tests: add clk_hw_get_dev() and clk_hw_get_of_node() tests
>
> drivers/clk/Makefile | 1 +
> drivers/clk/clk.c | 12 ++
> drivers/clk/clk_test.c | 215 ++++++++++++++++++++++++--
> drivers/clk/kunit_clk_hw_get_dev_of_node.dtso | 10 ++
> include/linux/clk-provider.h | 26 ++++
> 5 files changed, 247 insertions(+), 17 deletions(-)
> ---
> base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
> change-id: 20250415-clk-hw-get-helpers-c2344d404f3c
>
> Best regards,

--
Jerome