Lines Matching +full:- +full:- +full:reset
2 * Copyright (c) 2022 Andrei-Edward Popa <andrei.popa105@yahoo.com>
4 * SPDX-License-Identifier: Apache-2.0
9 * @brief Public Reset Controller driver APIs
16 * @brief Reset Controller Interface
17 * @defgroup reset_controller_interface Reset Controller Interface
33 /** Reset controller device configuration. */
35 /** Reset controller device. */
37 /** Reset line. */
45 * devicetree node identifier, a property specifying a Reset Controller and an index.
50 * resets = <&reset 10>;
58 * // .dev = DEVICE_DT_GET(DT_NODELABEL(reset)),
62 * The 'reset' field must still be checked for readiness, e.g. using
64 * exists, has the given property, and that property specifies a reset
65 * controller reset line id as shown above.
122 * instance's Reset Controller property at an index.
172 * API template to get the reset status of the device.
179 * API template to put the device in reset state.
186 * API template to take out the device from reset state.
193 * API template to reset the device.
200 * @brief Reset Controller driver API
212 * @brief Get the reset status
214 * This function returns the reset status of the device.
216 * @param dev Reset controller device.
217 * @param id Reset line.
218 * @param status Where to write the reset status.
221 * @retval -ENOSYS If the functionality is not implemented by the driver.
222 * @retval -errno Other negative errno in case of failure.
228 const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api; in z_impl_reset_status()
230 if (api->status == NULL) { in z_impl_reset_status()
231 return -ENOSYS; in z_impl_reset_status()
234 return api->status(dev, id, status); in z_impl_reset_status()
238 * @brief Get the reset status from a @p reset_dt_spec.
242 * reset_status(spec->dev, spec->id, status);
244 * @param spec Reset controller specification from devicetree
245 * @param status Where to write the reset status.
251 return reset_status(spec->dev, spec->id, status); in reset_status_dt()
255 * @brief Put the device in reset state
257 * This function sets/clears the reset bits of the device,
258 * depending on the logic level (active-high/active-low).
260 * @param dev Reset controller device.
261 * @param id Reset line.
264 * @retval -ENOSYS If the functionality is not implemented by the driver.
265 * @retval -errno Other negative errno in case of failure.
271 const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api; in z_impl_reset_line_assert()
273 if (api->line_assert == NULL) { in z_impl_reset_line_assert()
274 return -ENOSYS; in z_impl_reset_line_assert()
277 return api->line_assert(dev, id); in z_impl_reset_line_assert()
281 * @brief Assert the reset state from a @p reset_dt_spec.
285 * reset_line_assert(spec->dev, spec->id);
287 * @param spec Reset controller specification from devicetree
293 return reset_line_assert(spec->dev, spec->id); in reset_line_assert_dt()
297 * @brief Take out the device from reset state.
299 * This function sets/clears the reset bits of the device,
300 * depending on the logic level (active-low/active-high).
302 * @param dev Reset controller device.
303 * @param id Reset line.
306 * @retval -ENOSYS If the functionality is not implemented by the driver.
307 * @retval -errno Other negative errno in case of failure.
313 const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api; in z_impl_reset_line_deassert()
315 if (api->line_deassert == NULL) { in z_impl_reset_line_deassert()
316 return -ENOSYS; in z_impl_reset_line_deassert()
319 return api->line_deassert(dev, id); in z_impl_reset_line_deassert()
323 * @brief Deassert the reset state from a @p reset_dt_spec.
327 * reset_line_deassert(spec->dev, spec->id)
329 * @param spec Reset controller specification from devicetree
335 return reset_line_deassert(spec->dev, spec->id); in reset_line_deassert_dt()
339 * @brief Reset the device.
341 * This function performs reset for a device (assert + deassert).
343 * @param dev Reset controller device.
344 * @param id Reset line.
347 * @retval -ENOSYS If the functionality is not implemented by the driver.
348 * @retval -errno Other negative errno in case of failure.
354 const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api; in z_impl_reset_line_toggle()
356 if (api->line_toggle == NULL) { in z_impl_reset_line_toggle()
357 return -ENOSYS; in z_impl_reset_line_toggle()
360 return api->line_toggle(dev, id); in z_impl_reset_line_toggle()
364 * @brief Reset the device from a @p reset_dt_spec.
368 * reset_line_toggle(spec->dev, spec->id)
370 * @param spec Reset controller specification from devicetree
376 return reset_line_toggle(spec->dev, spec->id); in reset_line_toggle_dt()
387 #include <zephyr/syscalls/reset.h>