Skip to content

Commit 98b3a2f

Browse files
cyliangtwfabiobaltieri
authored andcommitted
drivers: reset: support for Nuvoton numaker m55m1x series
Add support macros of RESET_IP_OFFSET and RESET_IP_BIT for m55m1x series. Signed-off-by: cyliang tw <cyliang@nuvoton.com>
1 parent 47dfd85 commit 98b3a2f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/reset/reset_numaker.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@
1111
#include <zephyr/devicetree.h>
1212
#include <zephyr/drivers/reset.h>
1313

14+
#if defined(CONFIG_SOC_SERIES_M55M1X)
15+
#define NUMAKER_RESET_IP_OFFSET(id) (((id) >> 20UL) & 0xfffUL)
16+
#define NUMAKER_RESET_IP_BIT(id) (id & 0x000fffffUL)
17+
#else
1418
/* Reset controller module IPRST offset */
1519
#define NUMAKER_RESET_IPRST0_OFFSET (8UL)
1620
#define NUMAKER_RESET_IP_OFFSET(id) (NUMAKER_RESET_IPRST0_OFFSET + (((id) >> 24UL) & 0xffUL))
1721
/* Reset controller module configuration bit */
1822
#define NUMAKER_RESET_IP_BIT(id) (id & 0x00ffffffUL)
23+
#endif
1924

2025
struct reset_numaker_config {
2126
uint32_t base;
@@ -59,7 +64,7 @@ static int reset_numaker_line_toggle(const struct device *dev, uint32_t id)
5964
return 0;
6065
}
6166

62-
static DEVICE_API(reset, reset_numaker_driver_api) = {
67+
static const struct reset_driver_api reset_numaker_driver_api = {
6368
.status = reset_numaker_status,
6469
.line_assert = reset_numaker_line_assert,
6570
.line_deassert = reset_numaker_line_deassert,

0 commit comments

Comments
 (0)