Lines Matching +full:clk +full:- +full:provider

1 /* SPDX-License-Identifier: GPL-2.0+ */
19 * clock provider. This API provides a standard means for drivers to enable and
22 * A driver that implements UCLASS_CLOCK is a clock provider. A provider will
24 * often has this capability. clk-uclass.h describes the interface which
34 * struct clk - A handle to (allowing control of) a single clock.
42 * @id: The clock signal ID within the provider.
48 * for any provider be required in the future, the struct could be expanded to
51 * provider would dynamically allocated during its .of_xlate op, and process
55 struct clk { struct
65 * struct clk_bulk - A handle to (allowing control of) a bulk of clocks.
77 struct clk *clks; argument
81 #if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(CLK)
84 struct phandle_1_arg *cells, struct clk *clk);
87 * clock_get_by_index - Get/request a clock by integer index.
92 * device clock indices to provider clocks may be via device-tree properties,
93 * board-provided mapping tables, or some other mechanism.
101 int clk_get_by_index(struct udevice *dev, int index, struct clk *clk);
104 * clock_get_bulk - Get/request all clocks of a device.
109 * device clock indices to provider clocks may be via device-tree properties,
110 * board-provided mapping tables, or some other mechanism.
119 * clock_get_by_name - Get/request a clock by name.
124 * device clock names to provider clocks may be via device-tree properties,
125 * board-provided mapping tables, or some other mechanism.
133 int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk);
136 * clk_release_all() - Disable (turn off)/Free an array of previously
142 * @clk: A clock struct array that was previously successfully
145 * @return zero on success, or -ve error code.
147 int clk_release_all(struct clk *clk, int count);
151 struct clk *clk) in clk_get_by_index() argument
153 return -ENOSYS; in clk_get_by_index()
158 return -ENOSYS; in clk_get_bulk()
162 struct clk *clk) in clk_get_by_name() argument
164 return -ENOSYS; in clk_get_by_name()
167 static inline int clk_release_all(struct clk *clk, int count) in clk_release_all() argument
169 return -ENOSYS; in clk_release_all()
174 CONFIG_IS_ENABLED(CLK)
176 * clk_set_defaults - Process 'assigned-{clocks/clock-parents/clock-rates}'
191 * clk_release_bulk() - Disable (turn off)/Free an array of previously
197 * @clk: A clock bulk struct that was previously successfully
199 * @return zero on success, or -ve error code.
203 return clk_release_all(bulk->clks, bulk->count); in clk_release_bulk()
207 * clk_request - Request a clock by provider-specific ID.
209 * This requests a clock using a provider-specific ID. Generally, this function
212 * However, this function may be useful in core SoC-specific code.
214 * @dev: The clock provider device.
217 * clock provider uses to identify the clock.
220 int clk_request(struct udevice *dev, struct clk *clk);
223 * clock_free - Free a previously requested clock.
229 int clk_free(struct clk *clk);
232 * clk_get_rate() - Get current clock rate.
234 * @clk: A clock struct that was previously successfully requested by
236 * @return clock rate in Hz, or -ve error code.
238 ulong clk_get_rate(struct clk *clk);
241 * clk_set_rate() - Set current clock rate.
243 * @clk: A clock struct that was previously successfully requested by
246 * @return new rate, or -ve error code.
248 ulong clk_set_rate(struct clk *clk, ulong rate);
251 * clk_set_parent() - Set current clock parent.
253 * @clk: A clock struct that was previously successfully requested by
257 * @return new rate, or -ve error code.
259 int clk_set_parent(struct clk *clk, struct clk *parent);
262 * clk_enable() - Enable (turn on) a clock.
264 * @clk: A clock struct that was previously successfully requested by
266 * @return zero on success, or -ve error code.
268 int clk_enable(struct clk *clk);
271 * clk_enable_bulk() - Enable (turn on) all clocks in a clock bulk struct.
275 * @return zero on success, or -ve error code.
280 * clk_disable() - Disable (turn off) a clock.
282 * @clk: A clock struct that was previously successfully requested by
284 * @return zero on success, or -ve error code.
286 int clk_disable(struct clk *clk);
289 * clk_disable_bulk() - Disable (turn off) all clocks in a clock bulk struct.
293 * @return zero on success, or -ve error code.
300 * clk_valid() - check if clk is valid
302 * @clk: the clock to check
305 static inline bool clk_valid(struct clk *clk) in clk_valid() argument
307 return !!clk->dev; in clk_valid()