2 * Copyright (c) 2016, NVIDIA CORPORATION.
4 * SPDX-License-Identifier: GPL-2.0
7 #ifndef __SANDBOX_CLK_H
8 #define __SANDBOX_CLK_H
15 * enum sandbox_clk_id - Identity of clocks implemented by the sandbox clock
18 * These IDs are within/relative-to the clock provider.
28 * enum sandbox_clk_test_id - Identity of the clocks consumed by the sandbox
31 * These are the IDs the clock consumer knows the clocks as.
33 enum sandbox_clk_test_id {
34 SANDBOX_CLK_TEST_ID_FIXED,
35 SANDBOX_CLK_TEST_ID_SPI,
36 SANDBOX_CLK_TEST_ID_I2C,
38 SANDBOX_CLK_TEST_ID_COUNT,
42 * sandbox_clk_query_rate - Query the current rate of a sandbox clock.
44 * @dev: The sandbox clock provider device.
45 * @id: The clock to query.
46 * @return: The rate of the clock.
48 ulong sandbox_clk_query_rate(struct udevice *dev, int id);
50 * sandbox_clk_query_enable - Query the enable state of a sandbox clock.
52 * @dev: The sandbox clock provider device.
53 * @id: The clock to query.
54 * @return: The rate of the clock.
56 int sandbox_clk_query_enable(struct udevice *dev, int id);
59 * sandbox_clk_test_get - Ask the sandbox clock test device to request its
62 * @dev: The sandbox clock test (client) devivce.
63 * @return: 0 if OK, or a negative error code.
65 int sandbox_clk_test_get(struct udevice *dev);
67 * sandbox_clk_test_get_rate - Ask the sandbox clock test device to query a
70 * @dev: The sandbox clock test (client) devivce.
71 * @id: The test device's clock ID to query.
72 * @return: The rate of the clock.
74 ulong sandbox_clk_test_get_rate(struct udevice *dev, int id);
76 * sandbox_clk_test_set_rate - Ask the sandbox clock test device to set a
79 * @dev: The sandbox clock test (client) devivce.
80 * @id: The test device's clock ID to configure.
81 * @return: The new rate of the clock.
83 ulong sandbox_clk_test_set_rate(struct udevice *dev, int id, ulong rate);
85 * sandbox_clk_test_enable - Ask the sandbox clock test device to enable a
88 * @dev: The sandbox clock test (client) devivce.
89 * @id: The test device's clock ID to configure.
90 * @return: 0 if OK, or a negative error code.
92 int sandbox_clk_test_enable(struct udevice *dev, int id);
94 * sandbox_clk_test_disable - Ask the sandbox clock test device to disable a
97 * @dev: The sandbox clock test (client) devivce.
98 * @id: The test device's clock ID to configure.
99 * @return: 0 if OK, or a negative error code.
101 int sandbox_clk_test_disable(struct udevice *dev, int id);
103 * sandbox_clk_test_free - Ask the sandbox clock test device to free its
106 * @dev: The sandbox clock test (client) devivce.
107 * @return: 0 if OK, or a negative error code.
109 int sandbox_clk_test_free(struct udevice *dev);