Skip to content

Commit d82c10f

Browse files
andrei-edward-popambolivar-nordic
authored andcommitted
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 <[email protected]>
1 parent 4b111c1 commit d82c10f

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

doc/hardware/peripherals/reset.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ control over their reset input signals, including the ability to assert,
1212
deassert and toggle those signals. Also, the reset status of the reset input
1313
signal can be checked.
1414

15-
Mainly, the assert and deassert API functions are optional because in most
16-
cases we want to toggle the reset signals.
15+
Mainly, the line_assert and line_deassert API functions are optional because
16+
in most cases we want to toggle the reset signals.
1717

1818
Configuration Options
1919
*********************

drivers/reset/reset_rpi_pico.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,26 +106,26 @@ static int reset_rpi_update(const struct device *dev, uint32_t id, uint8_t asser
106106
return reset_rpi_write_register(dev, offset, value);
107107
}
108108

109-
static int reset_rpi_assert(const struct device *dev, uint32_t id)
109+
static int reset_rpi_line_assert(const struct device *dev, uint32_t id)
110110
{
111111
return reset_rpi_update(dev, id, 1);
112112
}
113113

114-
static int reset_rpi_deassert(const struct device *dev, uint32_t id)
114+
static int reset_rpi_line_deassert(const struct device *dev, uint32_t id)
115115
{
116116
return reset_rpi_update(dev, id, 0);
117117
}
118118

119-
static int reset_rpi_toggle(const struct device *dev, uint32_t id)
119+
static int reset_rpi_line_toggle(const struct device *dev, uint32_t id)
120120
{
121121
int ret;
122122

123-
ret = reset_rpi_assert(dev, id);
123+
ret = reset_rpi_line_assert(dev, id);
124124
if (ret) {
125125
return ret;
126126
}
127127

128-
return reset_rpi_deassert(dev, id);
128+
return reset_rpi_line_deassert(dev, id);
129129
}
130130

131131
static int reset_rpi_init(const struct device *dev)
@@ -137,9 +137,9 @@ static int reset_rpi_init(const struct device *dev)
137137

138138
static const struct reset_driver_api reset_rpi_driver_api = {
139139
.status = reset_rpi_status,
140-
.assert = reset_rpi_assert,
141-
.deassert = reset_rpi_deassert,
142-
.toggle = reset_rpi_toggle,
140+
.line_assert = reset_rpi_line_assert,
141+
.line_deassert = reset_rpi_line_deassert,
142+
.line_toggle = reset_rpi_line_toggle,
143143
};
144144

145145
#define RPI_RESET_INIT(idx) \

include/zephyr/drivers/reset.h

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -114,32 +114,32 @@ typedef int (*reset_api_status)(const struct device *dev, uint32_t id, uint8_t *
114114
/**
115115
* API template to put the device in reset state.
116116
*
117-
* @see reset_assert
117+
* @see reset_line_assert
118118
*/
119-
typedef int (*reset_api_assert)(const struct device *dev, uint32_t id);
119+
typedef int (*reset_api_line_assert)(const struct device *dev, uint32_t id);
120120

121121
/**
122122
* API template to take out the device from reset state.
123123
*
124-
* @see reset_deassert
124+
* @see reset_line_deassert
125125
*/
126-
typedef int (*reset_api_deassert)(const struct device *dev, uint32_t id);
126+
typedef int (*reset_api_line_deassert)(const struct device *dev, uint32_t id);
127127

128128
/**
129129
* API template to reset the device.
130130
*
131-
* @see reset_toggle
131+
* @see reset_line_toggle
132132
*/
133-
typedef int (*reset_api_toggle)(const struct device *dev, uint32_t id);
133+
typedef int (*reset_api_line_toggle)(const struct device *dev, uint32_t id);
134134

135135
/**
136136
* @brief Reset Controller driver API
137137
*/
138138
__subsystem struct reset_driver_api {
139139
reset_api_status status;
140-
reset_api_assert assert;
141-
reset_api_deassert deassert;
142-
reset_api_toggle toggle;
140+
reset_api_line_assert line_assert;
141+
reset_api_line_deassert line_deassert;
142+
reset_api_line_toggle line_toggle;
143143
};
144144

145145
/** @endcond */
@@ -200,33 +200,33 @@ static inline int reset_status_dt(const struct reset_dt_spec *spec, uint8_t *sta
200200
* @retval -ENOSYS If the functionality is not implemented by the driver.
201201
* @retval -errno Other negative errno in case of failure.
202202
*/
203-
__syscall int reset_assert(const struct device *dev, uint32_t id);
203+
__syscall int reset_line_assert(const struct device *dev, uint32_t id);
204204

205-
static inline int z_impl_reset_assert(const struct device *dev, uint32_t id)
205+
static inline int z_impl_reset_line_assert(const struct device *dev, uint32_t id)
206206
{
207207
const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api;
208208

209-
if (api->assert == NULL) {
209+
if (api->line_assert == NULL) {
210210
return -ENOSYS;
211211
}
212212

213-
return api->assert(dev, id);
213+
return api->line_assert(dev, id);
214214
}
215215

216216
/**
217217
* @brief Assert the reset state from a @p reset_dt_spec.
218218
*
219219
* This is equivalent to:
220220
*
221-
* reset_assert(spec->dev, spec->id);
221+
* reset_line_assert(spec->dev, spec->id);
222222
*
223223
* @param spec Reset controller specification from devicetree
224224
*
225-
* @return a value from reset_assert()
225+
* @return a value from reset_line_assert()
226226
*/
227-
static inline int reset_assert_dt(const struct reset_dt_spec *spec)
227+
static inline int reset_line_assert_dt(const struct reset_dt_spec *spec)
228228
{
229-
return reset_assert(spec->dev, spec->id);
229+
return reset_line_assert(spec->dev, spec->id);
230230
}
231231

232232
/**
@@ -242,33 +242,33 @@ static inline int reset_assert_dt(const struct reset_dt_spec *spec)
242242
* @retval -ENOSYS If the functionality is not implemented by the driver.
243243
* @retval -errno Other negative errno in case of failure.
244244
*/
245-
__syscall int reset_deassert(const struct device *dev, uint32_t id);
245+
__syscall int reset_line_deassert(const struct device *dev, uint32_t id);
246246

247-
static inline int z_impl_reset_deassert(const struct device *dev, uint32_t id)
247+
static inline int z_impl_reset_line_deassert(const struct device *dev, uint32_t id)
248248
{
249249
const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api;
250250

251-
if (api->deassert == NULL) {
251+
if (api->line_deassert == NULL) {
252252
return -ENOSYS;
253253
}
254254

255-
return api->deassert(dev, id);
255+
return api->line_deassert(dev, id);
256256
}
257257

258258
/**
259259
* @brief Deassert the reset state from a @p reset_dt_spec.
260260
*
261261
* This is equivalent to:
262262
*
263-
* reset_deassert(spec->dev, spec->id)
263+
* reset_line_deassert(spec->dev, spec->id)
264264
*
265265
* @param spec Reset controller specification from devicetree
266266
*
267-
* @return a value from reset_deassert()
267+
* @return a value from reset_line_deassert()
268268
*/
269-
static inline int reset_deassert_dt(const struct reset_dt_spec *spec)
269+
static inline int reset_line_deassert_dt(const struct reset_dt_spec *spec)
270270
{
271-
return reset_deassert(spec->dev, spec->id);
271+
return reset_line_deassert(spec->dev, spec->id);
272272
}
273273

274274
/**
@@ -283,33 +283,33 @@ static inline int reset_deassert_dt(const struct reset_dt_spec *spec)
283283
* @retval -ENOSYS If the functionality is not implemented by the driver.
284284
* @retval -errno Other negative errno in case of failure.
285285
*/
286-
__syscall int reset_toggle(const struct device *dev, uint32_t id);
286+
__syscall int reset_line_toggle(const struct device *dev, uint32_t id);
287287

288-
static inline int z_impl_reset_toggle(const struct device *dev, uint32_t id)
288+
static inline int z_impl_reset_line_toggle(const struct device *dev, uint32_t id)
289289
{
290290
const struct reset_driver_api *api = (const struct reset_driver_api *)dev->api;
291291

292-
if (api->toggle == NULL) {
292+
if (api->line_toggle == NULL) {
293293
return -ENOSYS;
294294
}
295295

296-
return api->toggle(dev, id);
296+
return api->line_toggle(dev, id);
297297
}
298298

299299
/**
300300
* @brief Reset the device from a @p reset_dt_spec.
301301
*
302302
* This is equivalent to:
303303
*
304-
* reset_toggle(spec->dev, spec->id)
304+
* reset_line_toggle(spec->dev, spec->id)
305305
*
306306
* @param spec Reset controller specification from devicetree
307307
*
308-
* @return a value from reset_toggle()
308+
* @return a value from reset_line_toggle()
309309
*/
310-
static inline int reset_toggle_dt(const struct reset_dt_spec *spec)
310+
static inline int reset_line_toggle_dt(const struct reset_dt_spec *spec)
311311
{
312-
return reset_toggle(spec->dev, spec->id);
312+
return reset_line_toggle(spec->dev, spec->id);
313313
}
314314

315315
/**

0 commit comments

Comments
 (0)