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_bulk - Ask the sandbox clock test device to request its
68 * clocks with the bulk clk API.
70 * @dev: The sandbox clock test (client) devivce.
71 * @return: 0 if OK, or a negative error code.
73 int sandbox_clk_test_get_bulk(struct udevice *dev);
75 * sandbox_clk_test_get_rate - Ask the sandbox clock test device to query a
78 * @dev: The sandbox clock test (client) devivce.
79 * @id: The test device's clock ID to query.
80 * @return: The rate of the clock.
82 ulong sandbox_clk_test_get_rate(struct udevice *dev, int id);
84 * sandbox_clk_test_set_rate - Ask the sandbox clock test device to set a
87 * @dev: The sandbox clock test (client) devivce.
88 * @id: The test device's clock ID to configure.
89 * @return: The new rate of the clock.
91 ulong sandbox_clk_test_set_rate(struct udevice *dev, int id, ulong rate);
93 * sandbox_clk_test_enable - Ask the sandbox clock test device to enable a
96 * @dev: The sandbox clock test (client) devivce.
97 * @id: The test device's clock ID to configure.
98 * @return: 0 if OK, or a negative error code.
100 int sandbox_clk_test_enable(struct udevice *dev, int id);
102 * sandbox_clk_test_enable_bulk - Ask the sandbox clock test device to enable
103 * all clocks in it's clock bulk struct.
105 * @dev: The sandbox clock test (client) devivce.
106 * @return: 0 if OK, or a negative error code.
108 int sandbox_clk_test_enable_bulk(struct udevice *dev);
110 * sandbox_clk_test_disable - Ask the sandbox clock test device to disable a
113 * @dev: The sandbox clock test (client) devivce.
114 * @id: The test device's clock ID to configure.
115 * @return: 0 if OK, or a negative error code.
117 int sandbox_clk_test_disable(struct udevice *dev, int id);
119 * sandbox_clk_test_disable_bulk - Ask the sandbox clock test device to disable
120 * all clocks in it's clock bulk struct.
122 * @dev: The sandbox clock test (client) devivce.
123 * @return: 0 if OK, or a negative error code.
125 int sandbox_clk_test_disable_bulk(struct udevice *dev);
127 * sandbox_clk_test_free - Ask the sandbox clock test device to free its
130 * @dev: The sandbox clock test (client) devivce.
131 * @return: 0 if OK, or a negative error code.
133 int sandbox_clk_test_free(struct udevice *dev);
135 * sandbox_clk_test_release_bulk - Ask the sandbox clock test device to release
136 * all clocks in it's clock bulk struct.
138 * @dev: The sandbox clock test (client) devivce.
139 * @return: 0 if OK, or a negative error code.
141 int sandbox_clk_test_release_bulk(struct udevice *dev);