include: drivers: changed API function names for reset controller

assert API function needed to be changed because of newlib assert
macro name conflict

Signed-off-by: Andrei-Edward Popa <andrei.popa105@yahoo.com>
This commit is contained in:
Andrei-Edward Popa 2022-05-26 19:10:57 +03:00 committed by Marti Bolivar
commit d82c10f197
3 changed files with 43 additions and 43 deletions

View file

@ -12,8 +12,8 @@ control over their reset input signals, including the ability to assert,
deassert and toggle those signals. Also, the reset status of the reset input deassert and toggle those signals. Also, the reset status of the reset input
signal can be checked. signal can be checked.
Mainly, the assert and deassert API functions are optional because in most Mainly, the line_assert and line_deassert API functions are optional because
cases we want to toggle the reset signals. in most cases we want to toggle the reset signals.
Configuration Options Configuration Options
********************* *********************

View file

@ -106,26 +106,26 @@ static int reset_rpi_update(const struct device *dev, uint32_t id, uint8_t asser
return reset_rpi_write_register(dev, offset, value); return reset_rpi_write_register(dev, offset, value);
} }
static int reset_rpi_assert(const struct device *dev, uint32_t id) static int reset_rpi_line_assert(const struct device *dev, uint32_t id)
{ {
return reset_rpi_update(dev, id, 1); return reset_rpi_update(dev, id, 1);
} }
static int reset_rpi_deassert(const struct device *dev, uint32_t id) static int reset_rpi_line_deassert(const struct device *dev, uint32_t id)
{ {
return reset_rpi_update(dev, id, 0); return reset_rpi_update(dev, id, 0);
} }
static int reset_rpi_toggle(const struct device *dev, uint32_t id) static int reset_rpi_line_toggle(const struct device *dev, uint32_t id)
{ {
int ret; int ret;
ret = reset_rpi_assert(dev, id); ret = reset_rpi_line_assert(dev, id);
if (ret) { if (ret) {
return ret; return ret;
} }
return reset_rpi_deassert(dev, id); return reset_rpi_line_deassert(dev, id);
} }
static int reset_rpi_init(const struct device *dev) static int reset_rpi_init(const struct device *dev)
@ -137,9 +137,9 @@ static int reset_rpi_init(const struct device *dev)
static const struct reset_driver_api reset_rpi_driver_api = { static const struct reset_driver_api reset_rpi_driver_api = {
.status = reset_rpi_status, .status = reset_rpi_status,
.assert = reset_rpi_assert, .line_assert = reset_rpi_line_assert,
.deassert = reset_rpi_deassert, .line_deassert = reset_rpi_line_deassert,
.toggle = reset_rpi_toggle, .line_toggle = reset_rpi_line_toggle,
}; };
#define RPI_RESET_INIT(idx) \ #define RPI_RESET_INIT(idx) \

View file

@ -114,32 +114,32 @@ typedef int (*reset_api_status)(const struct device *dev, uint32_t id, uint8_t *
/** /**
* API template to put the device in reset state. * API template to put the device in reset state.
* *
* @see reset_assert * @see reset_line_assert
*/ */
typedef int (*reset_api_assert)(const struct device *dev, uint32_t id); typedef int (*reset_api_line_assert)(const struct device *dev, uint32_t id);
/** /**
* API template to take out the device from reset state. * API template to take out the device from reset state.
* *
* @see reset_deassert * @see reset_line_deassert
*/ */
typedef int (*reset_api_deassert)(const struct device *dev, uint32_t id); typedef int (*reset_api_line_deassert)(const struct device *dev, uint32_t id);
/** /**
* API template to reset the device. * API template to reset the device.
* *
* @see reset_toggle * @see reset_line_toggle
*/ */
typedef int (*reset_api_toggle)(const struct device *dev, uint32_t id); typedef int (*reset_api_line_toggle)(const struct device *dev, uint32_t id);
/** /**
* @brief Reset Controller driver API * @brief Reset Controller driver API
*/ */
__subsystem struct reset_driver_api { __subsystem struct reset_driver_api {
reset_api_status status; reset_api_status status;
reset_api_assert assert; reset_api_line_assert line_assert;
reset_api_deassert deassert; reset_api_line_deassert line_deassert;
reset_api_toggle toggle; reset_api_line_toggle line_toggle;
}; };
/** @endcond */ /** @endcond */
@ -200,17 +200,17 @@ static inline int reset_status_dt(const struct reset_dt_spec *spec, uint8_t *sta
* @retval -ENOSYS If the functionality is not implemented by the driver. * @retval -ENOSYS If the functionality is not implemented by the driver.
* @retval -errno Other negative errno in case of failure. * @retval -errno Other negative errno in case of failure.
*/ */
__syscall int reset_assert(const struct device *dev, uint32_t id); __syscall int reset_line_assert(const struct device *dev, uint32_t id);
static inline int z_impl_reset_assert(const struct device *dev, uint32_t id) static inline int z_impl_reset_line_assert(const struct device *dev, uint32_t id)
{ {
const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api; const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api;
if (api->assert == NULL) { if (api->line_assert == NULL) {
return -ENOSYS; return -ENOSYS;
} }
return api->assert(dev, id); return api->line_assert(dev, id);
} }
/** /**
@ -218,15 +218,15 @@ static inline int z_impl_reset_assert(const struct device *dev, uint32_t id)
* *
* This is equivalent to: * This is equivalent to:
* *
* reset_assert(spec->dev, spec->id); * reset_line_assert(spec->dev, spec->id);
* *
* @param spec Reset controller specification from devicetree * @param spec Reset controller specification from devicetree
* *
* @return a value from reset_assert() * @return a value from reset_line_assert()
*/ */
static inline int reset_assert_dt(const struct reset_dt_spec *spec) static inline int reset_line_assert_dt(const struct reset_dt_spec *spec)
{ {
return reset_assert(spec->dev, spec->id); return reset_line_assert(spec->dev, spec->id);
} }
/** /**
@ -242,17 +242,17 @@ static inline int reset_assert_dt(const struct reset_dt_spec *spec)
* @retval -ENOSYS If the functionality is not implemented by the driver. * @retval -ENOSYS If the functionality is not implemented by the driver.
* @retval -errno Other negative errno in case of failure. * @retval -errno Other negative errno in case of failure.
*/ */
__syscall int reset_deassert(const struct device *dev, uint32_t id); __syscall int reset_line_deassert(const struct device *dev, uint32_t id);
static inline int z_impl_reset_deassert(const struct device *dev, uint32_t id) static inline int z_impl_reset_line_deassert(const struct device *dev, uint32_t id)
{ {
const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api; const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api;
if (api->deassert == NULL) { if (api->line_deassert == NULL) {
return -ENOSYS; return -ENOSYS;
} }
return api->deassert(dev, id); return api->line_deassert(dev, id);
} }
/** /**
@ -260,15 +260,15 @@ static inline int z_impl_reset_deassert(const struct device *dev, uint32_t id)
* *
* This is equivalent to: * This is equivalent to:
* *
* reset_deassert(spec->dev, spec->id) * reset_line_deassert(spec->dev, spec->id)
* *
* @param spec Reset controller specification from devicetree * @param spec Reset controller specification from devicetree
* *
* @return a value from reset_deassert() * @return a value from reset_line_deassert()
*/ */
static inline int reset_deassert_dt(const struct reset_dt_spec *spec) static inline int reset_line_deassert_dt(const struct reset_dt_spec *spec)
{ {
return reset_deassert(spec->dev, spec->id); return reset_line_deassert(spec->dev, spec->id);
} }
/** /**
@ -283,17 +283,17 @@ static inline int reset_deassert_dt(const struct reset_dt_spec *spec)
* @retval -ENOSYS If the functionality is not implemented by the driver. * @retval -ENOSYS If the functionality is not implemented by the driver.
* @retval -errno Other negative errno in case of failure. * @retval -errno Other negative errno in case of failure.
*/ */
__syscall int reset_toggle(const struct device *dev, uint32_t id); __syscall int reset_line_toggle(const struct device *dev, uint32_t id);
static inline int z_impl_reset_toggle(const struct device *dev, uint32_t id) static inline int z_impl_reset_line_toggle(const struct device *dev, uint32_t id)
{ {
const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api; const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api;
if (api->toggle == NULL) { if (api->line_toggle == NULL) {
return -ENOSYS; return -ENOSYS;
} }
return api->toggle(dev, id); return api->line_toggle(dev, id);
} }
/** /**
@ -301,15 +301,15 @@ static inline int z_impl_reset_toggle(const struct device *dev, uint32_t id)
* *
* This is equivalent to: * This is equivalent to:
* *
* reset_toggle(spec->dev, spec->id) * reset_line_toggle(spec->dev, spec->id)
* *
* @param spec Reset controller specification from devicetree * @param spec Reset controller specification from devicetree
* *
* @return a value from reset_toggle() * @return a value from reset_line_toggle()
*/ */
static inline int reset_toggle_dt(const struct reset_dt_spec *spec) static inline int reset_line_toggle_dt(const struct reset_dt_spec *spec)
{ {
return reset_toggle(spec->dev, spec->id); return reset_line_toggle(spec->dev, spec->id);
} }
/** /**