clk: Add test managed clk provider/consumer APIs

Unit tests are more ergonomic and simpler to understand if they don't
have to hoist a bunch of code into the test harness init and exit
functions. Add some test managed wrappers for the clk APIs so that clk
unit tests can write more code in the actual test and less code in the
harness.

Only add APIs that are used for now. More wrappers can be added in the
future as necessary.

Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Rae Moar <rmoar@google.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20240718210513.3801024-7-sboyd@kernel.org
This commit is contained in:
Stephen Boyd
2024-07-18 14:05:05 -07:00
parent 5ac7973032
commit d690bd11e8
5 changed files with 255 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
.. SPDX-License-Identifier: GPL-2.0
========
Clk API
========
The KUnit clk API is used to test clk providers and clk consumers.
.. kernel-doc:: drivers/clk/clk_kunit_helpers.c
:export:
@@ -9,6 +9,7 @@ API Reference
test
resource
functionredirection
clk
of
platformdevice
@@ -34,6 +35,10 @@ Documentation/dev-tools/kunit/api/functionredirection.rst
Driver KUnit API
================
Documentation/dev-tools/kunit/api/clk.rst
- Documents the KUnit clk API
Documentation/dev-tools/kunit/api/of.rst
- Documents the KUnit device tree (OF) API