Lines Matching +full:data +full:- +full:rate
1 /* clock_control.h - public clock controller driver API */
6 * SPDX-License-Identifier: Apache-2.0
54 * clock_control_subsys_t is a type to identify a clock controller sub-system.
55 * Such data pointed is opaque and relevant only to the clock controller
62 * controller sub-system rate. Such data pointed is opaque and
63 * relevant only to set the clock controller rate of the driver
71 * @param subsys Opaque data representing the clock.
72 * @param user_data User data.
83 uint32_t *rate);
96 clock_control_subsys_rate_t rate);
100 void *data);
119 * Use @ref clock_control_async_on() for non-blocking operation.
122 * @param sys Opaque data representing the clock.
129 (const struct clock_control_driver_api *)dev->api; in clock_control_on()
131 return api->on(dev, sys); in clock_control_on()
137 * This function is non-blocking and can be called from any context.
141 * @param sys Opaque data representing the clock
148 (const struct clock_control_driver_api *)dev->api; in clock_control_off()
150 return api->off(dev, sys); in clock_control_off()
156 * Function is non-blocking and can be called from any context. User callback is
160 * @param sys A pointer to an opaque data representing the sub-system.
165 * @retval -EALREADY if clock was already started and is starting or running.
166 * @retval -ENOTSUP If the requested mode of operation is not supported.
167 * @retval -ENOSYS if the interface is not implemented.
176 (const struct clock_control_driver_api *)dev->api; in clock_control_async_on()
178 if (api->async_on == NULL) { in clock_control_async_on()
179 return -ENOSYS; in clock_control_async_on()
182 return api->async_on(dev, sys, cb, user_data); in clock_control_async_on()
189 * @param sys A pointer to an opaque data representing the sub-system.
197 (const struct clock_control_driver_api *)dev->api; in clock_control_get_status()
199 if (!api->get_status) { in clock_control_get_status()
203 return api->get_status(dev, sys); in clock_control_get_status()
207 * @brief Obtain the clock rate of given sub-system
210 * @param sys A pointer to an opaque data representing the sub-system
211 * @param[out] rate Subsystem clock rate
212 * @retval 0 on successful rate reading.
213 * @retval -EAGAIN if rate cannot be read. Some drivers do not support returning the rate when the
215 * @retval -ENOTSUP if reading the clock rate is not supported for the given sub-system.
216 * @retval -ENOSYS if the interface is not implemented.
220 uint32_t *rate) in clock_control_get_rate() argument
223 (const struct clock_control_driver_api *)dev->api; in clock_control_get_rate()
225 if (api->get_rate == NULL) { in clock_control_get_rate()
226 return -ENOSYS; in clock_control_get_rate()
229 return api->get_rate(dev, sys, rate); in clock_control_get_rate()
233 * @brief Set the rate of the clock controlled by the device.
235 * On success, the new clock rate is set and ready when this function
240 * @param sys Opaque data representing the clock.
241 * @param rate Opaque data representing the clock rate to be used.
243 * @retval -EALREADY if clock was already in the given rate.
244 * @retval -ENOTSUP If the requested mode of operation is not supported.
245 * @retval -ENOSYS if the interface is not implemented.
250 clock_control_subsys_rate_t rate) in clock_control_set_rate() argument
253 (const struct clock_control_driver_api *)dev->api; in clock_control_set_rate()
255 if (api->set_rate == NULL) { in clock_control_set_rate()
256 return -ENOSYS; in clock_control_set_rate()
259 return api->set_rate(dev, sys, rate); in clock_control_set_rate()
265 * This function is non-blocking and can be called from any context.
273 * @p data is implementation specific and could be used to convey
277 * @param sys Opaque data representing the clock
278 * @param data Opaque data providing additional input for clock configuration
281 * @retval -ENOSYS If the device driver does not implement this call
282 * @retval -errno Other negative errno on failure.
286 void *data) in clock_control_configure() argument
289 (const struct clock_control_driver_api *)dev->api; in clock_control_configure()
291 if (api->configure == NULL) { in clock_control_configure()
292 return -ENOSYS; in clock_control_configure()
295 return api->configure(dev, sys, data); in clock_control_configure()