Clk API
The KUnit clk API is used to test clk providers and clk consumers.
clk_prepare_enable_kunit() #
int Test managed clk_prepare_enable()
Parameters
struct kunit *test: The test contextstruct clk *clk: clk to prepare and enable
Return
0 on success, or negative errno on failure.
clk_get_kunit() #
struct clk * Test managed clk_get()
Parameters
struct kunit *test: The test contextstruct device *dev: device for clock "consumer"const char *con_id: clock consumer ID
Description
Just like clk_get(), except the clk is managed by the test case and is
automatically put with clk_put() after the test case concludes.
Return
new clk consumer or ERR_PTR on failure.
of_clk_get_kunit() #
struct clk * Test managed of_clk_get()
Parameters
struct kunit *test: The test contextstruct device_node *np: device_node for clock "consumer"int index: index in 'clocks' property of np
Description
Just like of_clk_get(), except the clk is managed by the test case and is
automatically put with clk_put() after the test case concludes.
Return
new clk consumer or ERR_PTR on failure.
clk_hw_get_clk_kunit() #
struct clk * Test managed clk_hw_get_clk()
Parameters
struct kunit *test: The test contextstruct clk_hw *hw: clk_hw associated with the clk being consumedconst char *con_id: connection ID string on device
Description
Just like clk_hw_get_clk(), except the clk is managed by the test case and
is automatically put with clk_put() after the test case concludes.
Return
new clk consumer or ERR_PTR on failure.
clk_hw_get_clk_prepared_enabled_kunit() #
struct clk * Test managed clk_hw_get_clk() + clk_prepare_enable()
Parameters
struct kunit *test: The test contextstruct clk_hw *hw: clk_hw associated with the clk being consumedconst char *con_id: connection ID string on device
Description
Just like
struct clk *clk = ;
;
except the clk is managed by the test case and is automatically disabled and
unprepared with clk_disable_unprepare() and put with clk_put() after the
test case concludes.
Return
new clk consumer that is prepared and enabled or ERR_PTR on failure.
clk_hw_register_kunit() #
int Test managed clk_hw_register()
Parameters
struct kunit *test: The test contextstruct device *dev: device that is registering this clockstruct clk_hw *hw: link to hardware-specific clock data
Description
Just like clk_hw_register(), except the clk registration is managed by the
test case and is automatically unregistered after the test case concludes.
Return
0 on success or a negative errno value on failure.
of_clk_hw_register_kunit() #
int Test managed of_clk_hw_register()
Parameters
struct kunit *test: The test contextstruct device_node *node: device_node of device that is registering this clockstruct clk_hw *hw: link to hardware-specific clock data
Description
Just like of_clk_hw_register(), except the clk registration is managed by
the test case and is automatically unregistered after the test case
concludes.
Return
0 on success or a negative errno value on failure.
of_clk_add_hw_provider_kunit() #
int Test managed of_clk_add_hw_provider()
Parameters
struct kunit *test: The test contextstruct device_node *np: Device node pointer associated with clock providerstruct clk_hw *(*get)(struct of_phandle_args *clkspec, void *data): Callback for decoding clk_hwvoid *data: Context pointer for get callback.
Description
Just like of_clk_add_hw_provider(), except the clk_hw provider is managed by
the test case and is automatically unregistered after the test case
concludes.
Return
0 on success or a negative errno value on failure.