12#ifndef ZEPHYR_INCLUDE_DRIVERS_RESET_H_ 
   13#define ZEPHYR_INCLUDE_DRIVERS_RESET_H_ 
   69#define RESET_DT_SPEC_GET_BY_IDX(node_id, idx)                                  \ 
   71                .dev = DEVICE_DT_GET(DT_RESET_CTLR_BY_IDX(node_id, idx)),       \ 
   72                .id = DT_RESET_ID_BY_IDX(node_id, idx)                          \ 
   82#define RESET_DT_SPEC_GET(node_id) \ 
   83        RESET_DT_SPEC_GET_BY_IDX(node_id, 0) 
   94#define RESET_DT_SPEC_INST_GET_BY_IDX(inst, idx) \ 
   95        RESET_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), idx) 
  104#define RESET_DT_SPEC_INST_GET(inst) \ 
  105        RESET_DT_SPEC_INST_GET_BY_IDX(inst, 0) 
  121typedef int (*reset_api_line_assert)(
const struct device *dev, 
uint32_t id);
 
  128typedef int (*reset_api_line_deassert)(
const struct device *dev, 
uint32_t id);
 
  135typedef int (*reset_api_line_toggle)(
const struct device *dev, 
uint32_t id);
 
  140__subsystem 
struct reset_driver_api {
 
  141        reset_api_status status;
 
  142        reset_api_line_assert line_assert;
 
  143        reset_api_line_deassert line_deassert;
 
  144        reset_api_line_toggle line_toggle;
 
  166        const struct reset_driver_api *api = (
const struct reset_driver_api *)dev->
api;
 
  168        if (api->status == NULL) {
 
  172        return api->status(dev, 
id, status);
 
  207static inline int z_impl_reset_line_assert(
const struct device *dev, 
uint32_t id)
 
  209        const struct reset_driver_api *api = (
const struct reset_driver_api *)dev->
api;
 
  211        if (api->line_assert == NULL) {
 
  215        return api->line_assert(dev, 
id);
 
  249static inline int z_impl_reset_line_deassert(
const struct device *dev, 
uint32_t id)
 
  251        const struct reset_driver_api *api = (
const struct reset_driver_api *)dev->
api;
 
  253        if (api->line_deassert == NULL) {
 
  257        return api->line_deassert(dev, 
id);
 
  290static inline int z_impl_reset_line_toggle(
const struct device *dev, 
uint32_t id)
 
  292        const struct reset_driver_api *api = (
const struct reset_driver_api *)dev->
api;
 
  294        if (api->line_toggle == NULL) {
 
  298        return api->line_toggle(dev, 
id);
 
  325#include <syscalls/reset.h> 
int reset_line_toggle(const struct device *dev, uint32_t id)
Reset the device.
 
static int reset_line_deassert_dt(const struct reset_dt_spec *spec)
Deassert the reset state from a reset_dt_spec.
Definition: reset.h:271
 
static int reset_status_dt(const struct reset_dt_spec *spec, uint8_t *status)
Get the reset status from a reset_dt_spec.
Definition: reset.h:187
 
int reset_line_deassert(const struct device *dev, uint32_t id)
Take out the device from reset state.
 
int reset_line_assert(const struct device *dev, uint32_t id)
Put the device in reset state.
 
static int reset_line_assert_dt(const struct reset_dt_spec *spec)
Assert the reset state from a reset_dt_spec.
Definition: reset.h:229
 
int reset_status(const struct device *dev, uint32_t id, uint8_t *status)
Get the reset status.
 
static int reset_line_toggle_dt(const struct reset_dt_spec *spec)
Reset the device from a reset_dt_spec.
Definition: reset.h:312
 
#define ENOSYS
Definition: errno.h:83
 
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
 
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
 
Runtime device structure (in ROM) per driver instance.
Definition: device.h:378
 
const void * api
Definition: device.h:384
 
const struct device * dev
Definition: reset.h:34
 
uint32_t id
Definition: reset.h:36