1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2016, NVIDIA CORPORATION.
6 #ifndef __SANDBOX_CLK_H
7 #define __SANDBOX_CLK_H
14 * enum sandbox_clk_id - Identity of clocks implemented by the sandbox clock
17 * These IDs are within/relative-to the clock provider.
27 * enum sandbox_clk_test_id - Identity of the clocks consumed by the sandbox
30 * These are the IDs the clock consumer knows the clocks as.
32 enum sandbox_clk_test_id {
33 SANDBOX_CLK_TEST_ID_FIXED,
34 SANDBOX_CLK_TEST_ID_SPI,
35 SANDBOX_CLK_TEST_ID_I2C,
37 SANDBOX_CLK_TEST_ID_COUNT,
41 * sandbox_clk_query_rate - Query the current rate of a sandbox clock.
43 * @dev: The sandbox clock provider device.
44 * @id: The clock to query.
45 * @return: The rate of the clock.
47 ulong sandbox_clk_query_rate(struct udevice *dev, int id);
49 * sandbox_clk_query_enable - Query the enable state of a sandbox clock.
51 * @dev: The sandbox clock provider device.
52 * @id: The clock to query.
53 * @return: The rate of the clock.
55 int sandbox_clk_query_enable(struct udevice *dev, int id);
58 * sandbox_clk_test_get - Ask the sandbox clock test device to request its
61 * @dev: The sandbox clock test (client) devivce.
62 * @return: 0 if OK, or a negative error code.
64 int sandbox_clk_test_get(struct udevice *dev);
66 * sandbox_clk_test_get_bulk - Ask the sandbox clock test device to request its
67 * clocks with the bulk clk API.
69 * @dev: The sandbox clock test (client) devivce.
70 * @return: 0 if OK, or a negative error code.
72 int sandbox_clk_test_get_bulk(struct udevice *dev);
74 * sandbox_clk_test_get_rate - Ask the sandbox clock test device to query a
77 * @dev: The sandbox clock test (client) devivce.
78 * @id: The test device's clock ID to query.
79 * @return: The rate of the clock.
81 ulong sandbox_clk_test_get_rate(struct udevice *dev, int id);
83 * sandbox_clk_test_set_rate - Ask the sandbox clock test device to set a
86 * @dev: The sandbox clock test (client) devivce.
87 * @id: The test device's clock ID to configure.
88 * @return: The new rate of the clock.
90 ulong sandbox_clk_test_set_rate(struct udevice *dev, int id, ulong rate);
92 * sandbox_clk_test_enable - Ask the sandbox clock test device to enable a
95 * @dev: The sandbox clock test (client) devivce.
96 * @id: The test device's clock ID to configure.
97 * @return: 0 if OK, or a negative error code.
99 int sandbox_clk_test_enable(struct udevice *dev, int id);
101 * sandbox_clk_test_enable_bulk - Ask the sandbox clock test device to enable
102 * all clocks in it's clock bulk struct.
104 * @dev: The sandbox clock test (client) devivce.
105 * @return: 0 if OK, or a negative error code.
107 int sandbox_clk_test_enable_bulk(struct udevice *dev);
109 * sandbox_clk_test_disable - Ask the sandbox clock test device to disable a
112 * @dev: The sandbox clock test (client) devivce.
113 * @id: The test device's clock ID to configure.
114 * @return: 0 if OK, or a negative error code.
116 int sandbox_clk_test_disable(struct udevice *dev, int id);
118 * sandbox_clk_test_disable_bulk - Ask the sandbox clock test device to disable
119 * all clocks in it's clock bulk struct.
121 * @dev: The sandbox clock test (client) devivce.
122 * @return: 0 if OK, or a negative error code.
124 int sandbox_clk_test_disable_bulk(struct udevice *dev);
126 * sandbox_clk_test_free - Ask the sandbox clock test device to free its
129 * @dev: The sandbox clock test (client) devivce.
130 * @return: 0 if OK, or a negative error code.
132 int sandbox_clk_test_free(struct udevice *dev);
134 * sandbox_clk_test_release_bulk - Ask the sandbox clock test device to release
135 * all clocks in it's clock bulk struct.
137 * @dev: The sandbox clock test (client) devivce.
138 * @return: 0 if OK, or a negative error code.
140 int sandbox_clk_test_release_bulk(struct udevice *dev);