Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fa261a8
[nrf fromtree] drivers: power_domain: Power domain TISCI driver support
Kronosblaster May 23, 2025
57a4115
[nrf fromtree] devicetree: Use `IS_EQ()` for `DT_SAME_NODE()`
soburi Jun 7, 2025
e6f0186
Revert "[nrf fromlist] tests: drivers: gpio: basic_api: Add nrf54h20/…
bjarki-andreasen Jul 30, 2025
654c818
Revert "[nrf fromlist] drivers: gpio: nrfx: Add support for GPIOTE0 o…
bjarki-andreasen Jul 30, 2025
d0eb92d
Revert "[nrf fromlist] modules: hal_nordic: nrfx: Add GPIOTE config f…
bjarki-andreasen Jul 30, 2025
f0a56b4
Revert "[nrf fromlist] dts: bindings: gpio: nrf-gpiote: Extend descri…
bjarki-andreasen Jul 30, 2025
e9ccc86
Revert "[nrf fromlist] dts: vendor: nordic: nrf54h20: Add gpiote0 node"
bjarki-andreasen Jul 30, 2025
879c1ef
Revert "[nrf noup] modules: hal_nordic: require nrf-regtool"
bjarki-andreasen Jul 30, 2025
67fe2da
Revert "[nrf fromlist] modules: hal_nordic: Bump nrf-regtool to 9.2.0"
bjarki-andreasen Jul 30, 2025
c2499d1
Revert "[nrf fromlist] drivers: spi: nrfx_spim: use dmm"
bjarki-andreasen Jul 30, 2025
d2fbde9
[nrf fromtree] drivers: power_domain: introduce nrfs gdpwr
bjarki-andreasen Jul 2, 2025
ccc42d6
[nrf fromtree] drivers: power_domain: introduce nrf_gpio_pad_group
bjarki-andreasen Jul 2, 2025
98cb53b
Revert "[nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration"
bjarki-andreasen Jul 10, 2025
749588c
Revert "[nrf noup] drivers: spi_dw: Bring back custom EXMIF periphera…
bjarki-andreasen Jul 10, 2025
f840df1
[nrf fromtree] spi: nrfx_spim: fix incorrect clock control logic
JordanYates May 2, 2025
10577eb
Revert "[nrf noup] tests: arm_irq_vector_table: Disable starting of S…
bjarki-andreasen Jul 10, 2025
bc82667
Revert "[nrf noup] dts: Select SoftDevice Controller DTS binding as d…
bjarki-andreasen Jul 10, 2025
229a2e3
Revert "[nrf noup] dts: Add Bluetooth Controller to nRF54H20"
bjarki-andreasen Jul 10, 2025
91e50ec
[nrf fromtree] soc: nordic: nrf54h: transition from gpd to zephyr pin…
bjarki-andreasen Jul 3, 2025
4a98043
[nrf fromtree] soc: nrf54h: remove deprecated gpd (global power domai…
bjarki-andreasen Jul 3, 2025
8eb1bb7
[nrf noup] dts: Add Bluetooth Controller to nRF54H20
rugeGerritsen Jul 16, 2024
7d412ff
[nrf noup] dts: Select SoftDevice Controller DTS binding as default
rugeGerritsen Sep 5, 2024
af1472c
[nrf noup] tests: arm_irq_vector_table: Disable starting of SSF client
anangl Jan 24, 2025
217525d
[nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration
jaz1-nordic Nov 25, 2024
80d9863
[nrf noup] drivers: spi_dw: Bring back custom EXMIF peripheral handling
anangl Dec 17, 2024
6286dc5
[nrf fromlist] modules: hal_nordic: Bump nrf-regtool to 9.2.0
nordic-krch Jun 26, 2025
68021be
[nrf noup] modules: hal_nordic: require nrf-regtool
jonathannilsen Apr 22, 2025
0211c8f
[nrf fromlist] dts: vendor: nordic: nrf54h20: Add gpiote0 node
nordic-krch Jun 3, 2025
afe326f
[nrf fromlist] dts: bindings: gpio: nrf-gpiote: Extend description
nordic-krch Jun 3, 2025
86ff866
[nrf fromlist] modules: hal_nordic: nrfx: Add GPIOTE config flag
nordic-krch Jun 4, 2025
5c6aa69
[nrf fromlist] drivers: gpio: nrfx: Add support for GPIOTE0 on cpurad
nordic-krch Jun 4, 2025
fd271eb
[nrf fromlist] tests: drivers: gpio: basic_api: Add nrf54h20/cpurad G…
nordic-krch Jun 4, 2025
4d0b19d
[nrf fromlist] drivers: spi: nrfx_spim: use dmm
nika-nordic Jun 12, 2024
ddc0f2d
[nrf fromlist] power_domain: nrfs_gdpwr: patch init sync
bjarki-andreasen Aug 7, 2025
f7d881b
[nrf fromtree] drivers: counter: counter_nrfx_timer: fix fast instanc…
bjarki-andreasen Aug 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions drivers/can/can_nrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/irq.h>

#ifdef CONFIG_SOC_NRF54H20_GPD
#include <nrf/gpd.h>
#endif

/* nRF CAN wrapper offsets */
#define CAN_TASKS_START offsetof(NRF_CAN_Type, TASKS_START)
#define CAN_EVENTS_CORE_0 offsetof(NRF_CAN_Type, EVENTS_CORE[0])
Expand Down Expand Up @@ -187,13 +183,6 @@ static int can_nrf_init(const struct device *dev)
sys_write32(CAN_INTEN_CORE0_Msk | CAN_INTEN_CORE1_Msk, config->wrapper + CAN_INTEN);
sys_write32(1U, config->wrapper + CAN_TASKS_START);

#ifdef CONFIG_SOC_NRF54H20_GPD
ret = nrf_gpd_retain_pins_set(config->pcfg, false);
if (ret < 0) {
return ret;
}
#endif

config->irq_configure();

ret = can_mcan_configure_mram(dev, config->mrba, config->mram);
Expand Down
29 changes: 9 additions & 20 deletions drivers/counter/counter_nrfx_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,11 @@
#define MAYBE_CONST_CONFIG const
#endif

#ifdef CONFIG_SOC_NRF54H20_GPD
#include <nrf/gpd.h>

#define NRF_CLOCKS_INSTANCE_IS_FAST(node) \
COND_CODE_1(DT_NODE_HAS_PROP(node, power_domains), \
(IS_EQ(DT_PHA(node, power_domains, id), NRF_GPD_FAST_ACTIVE1)), \
(0))

/* Macro must resolve to literal 0 or 1 */
#define INSTANCE_IS_FAST(idx) NRF_CLOCKS_INSTANCE_IS_FAST(DT_DRV_INST(idx))

#define INSTANCE_IS_FAST_OR(idx) INSTANCE_IS_FAST(idx) ||

#if (DT_INST_FOREACH_STATUS_OKAY(INSTANCE_IS_FAST_OR) 0)
#define COUNTER_ANY_FAST 1
#endif
#if NRF_DT_INST_ANY_IS_FAST && CONFIG_CLOCK_CONTROL
#define COUNTER_IS_FAST(idx) NRF_DT_INST_IS_FAST(idx)
#define COUNTER_ANY_FAST
#else
#define COUNTER_IS_FAST(idx) 0
#endif

struct counter_nrfx_data {
Expand Down Expand Up @@ -474,13 +463,13 @@
* which is using nrfs (IPC) are initialized later.
*/
#define TIMER_INIT_LEVEL(idx) \
COND_CODE_1(INSTANCE_IS_FAST(idx), (POST_KERNEL), (PRE_KERNEL_1))
COND_CODE_1(COUNTER_IS_FAST(idx), (POST_KERNEL), (PRE_KERNEL_1))

/* Get initialization priority of an instance. Instances that requires clock control
* which is using nrfs (IPC) are initialized later.
*/
#define TIMER_INIT_PRIO(idx) \
COND_CODE_1(INSTANCE_IS_FAST(idx), \
COND_CODE_1(COUNTER_IS_FAST(idx), \

Check notice on line 472 in drivers/counter/counter_nrfx_timer.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/counter/counter_nrfx_timer.c:472 -#define TIMER_INIT_LEVEL(idx) \ - COND_CODE_1(COUNTER_IS_FAST(idx), (POST_KERNEL), (PRE_KERNEL_1)) +#define TIMER_INIT_LEVEL(idx) COND_CODE_1(COUNTER_IS_FAST(idx), (POST_KERNEL), (PRE_KERNEL_1)) /* Get initialization priority of an instance. Instances that requires clock control * which is using nrfs (IPC) are initialized later. */ -#define TIMER_INIT_PRIO(idx) \ +#define TIMER_INIT_PRIO(idx) \
(UTIL_INC(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL_INIT_PRIORITY)), \
(CONFIG_COUNTER_INIT_PRIORITY))

Expand Down Expand Up @@ -536,8 +525,8 @@
}, \
.ch_data = counter##idx##_ch_data, \
.timer = (NRF_TIMER_Type *)DT_INST_REG_ADDR(idx), \
IF_ENABLED(INSTANCE_IS_FAST(idx), \
(.clk_dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(DT_DRV_INST(idx))), \
IF_ENABLED(COUNTER_IS_FAST(idx), \

Check notice on line 528 in drivers/counter/counter_nrfx_timer.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/counter/counter_nrfx_timer.c:528 -#define COUNTER_NRFX_TIMER_DEVICE(idx) \ - BUILD_ASSERT(DT_INST_PROP(idx, prescaler) <= \ - TIMER_PRESCALER_PRESCALER_Msk, \ - "TIMER prescaler out of range"); \ +#define COUNTER_NRFX_TIMER_DEVICE(idx) \ + BUILD_ASSERT(DT_INST_PROP(idx, prescaler) <= TIMER_PRESCALER_PRESCALER_Msk, \ + "TIMER prescaler out of range"); \ COND_CODE_1(DT_INST_PROP(idx, zli), ( \ ISR_DIRECT_DECLARE(counter_timer##idx##_isr_wrapper) \ { \ irq_handler(DEVICE_DT_INST_GET(idx)); \ /* No rescheduling, it shall not access zephyr primitives. */ \ return 0; \ - }), ()) \ - static int counter_##idx##_init(const struct device *dev) \ - { \ - TIMER_IRQ_CONNECT(idx); \ - static const struct counter_timer_config config = { \ - .prescaler = DT_INST_PROP(idx, prescaler), \ - .mode = NRF_TIMER_MODE_TIMER, \ - .bit_width = (DT_INST_PROP(idx, max_bit_width) == 32) ? \ - NRF_TIMER_BIT_WIDTH_32 : NRF_TIMER_BIT_WIDTH_16, \ - }; \ - return init_timer(dev, &config); \ - } \ - static struct counter_nrfx_data counter_##idx##_data; \ - static struct counter_nrfx_ch_data \ - counter##idx##_ch_data[CC_TO_ID(DT_INST_PROP(idx, cc_num))]; \ - LOG_INSTANCE_REGISTER(LOG_MODULE_NAME, idx, CONFIG_COUNTER_LOG_LEVEL); \ - static MAYBE_CONST_CONFIG struct counter_nrfx_config nrfx_counter_##idx##_config = { \ - .info = { \ - .max_top_value = (uint32_t)BIT64_MASK(DT_INST_PROP(idx, max_bit_width)),\ - .freq = NRF_PERIPH_GET_FREQUENCY(DT_DRV_INST(idx)) / \ - BIT(DT_INST_PROP(idx, prescaler)), \ - .flags = COUNTER_CONFIG_INFO_COUNT_UP, \ - .channels = CC_TO_ID(DT_INST_PROP(idx, cc_num)), \ - }, \ - .ch_data = counter##idx##_ch_data, \ - .timer = (NRF_TIMER_Type *)DT_INST_REG_ADDR(idx), \ + }), ()) \ + static int counter_##idx##_init(const struct device *dev) \ + { \ + TIMER_IRQ_CONNECT(idx); \ + static const struct counter_timer_config config = { \ + .prescaler = DT_INST_PROP(idx, prescaler), \ + .mode = NRF_TIMER_MODE_TIMER, \ + .bit_width = (DT_INST_PROP(idx, max_bit_width) == 32) \ + ? NRF_TIMER_BIT_WIDTH_32 \ + : NRF_TIMER_BIT_WIDTH_16, \ + }; \ + return init_timer(dev, &config); \ + } \ + static struct counter_nrfx_data counter_##idx##_data; \ + static struct counter_nrfx_ch_data \ + counter##idx##_ch_data[CC_TO_ID(DT_INST_PROP(idx, cc_num))]; \ + LOG_INSTANCE_REGISTER(LOG_MODULE_NAME, idx, CONFIG_COUNTER_LOG_LEVEL); \ + static MAYBE_CONST_CONFIG struct counter_nrfx_config nrfx_counter_##idx##_config = { \ + .info = \ + { \ + .max_top_value = \ + (uint32_t)BIT64_MASK(DT_INST_PROP(idx, max_bit_width)), \ + .freq = NRF_PERIPH_GET_FREQUENCY(DT_DRV_INST(idx)) / \ + BIT(DT_INST_PROP(idx, prescaler)), \ + .flags = COUNTER_CONFIG_INFO_COUNT_UP,
(.clk_dev = DEVICE_DT_GET_OR_NULL(DT_CLOCKS_CTLR(DT_DRV_INST(idx))), \
.clk_spec = { \
.frequency = NRF_PERIPH_GET_FREQUENCY(DT_DRV_INST(idx)), \
.accuracy = 0, \
Expand All @@ -553,5 +542,5 @@
&nrfx_counter_##idx##_config.info, \
TIMER_INIT_LEVEL(idx), TIMER_INIT_PRIO(idx), \
&counter_nrfx_driver_api);

Check notice on line 545 in drivers/counter/counter_nrfx_timer.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/counter/counter_nrfx_timer.c:545 - )) \ - LOG_INSTANCE_PTR_INIT(log, LOG_MODULE_NAME, idx) \ - }; \ - DEVICE_DT_INST_DEFINE(idx, \ - counter_##idx##_init, \ - NULL, \ - &counter_##idx##_data, \ - &nrfx_counter_##idx##_config.info, \ - TIMER_INIT_LEVEL(idx), TIMER_INIT_PRIO(idx), \ - &counter_nrfx_driver_api); + )) \ + LOG_INSTANCE_PTR_INIT(log, LOG_MODULE_NAME, \ + idx)}; \ + DEVICE_DT_INST_DEFINE(idx, counter_##idx##_init, NULL, &counter_##idx##_data, \ + &nrfx_counter_##idx##_config.info, TIMER_INIT_LEVEL(idx), \ + TIMER_INIT_PRIO(idx), &counter_nrfx_driver_api);
DT_INST_FOREACH_STATUS_OKAY(COUNTER_NRFX_TIMER_DEVICE)
77 changes: 18 additions & 59 deletions drivers/gpio/gpio_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

#include <zephyr/drivers/gpio/gpio_utils.h>

#ifdef CONFIG_SOC_NRF54H20_GPD
#include <nrf/gpd.h>
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_pad_group)
#define GPIO_HAS_PAD_GROUP 1
#else
#define GPIO_HAS_PAD_GROUP 0
#endif

#define GPIOTE_PHANDLE(id) DT_INST_PHANDLE(id, gpiote_instance)
Expand Down Expand Up @@ -53,12 +55,12 @@
uint32_t edge_sense;
uint8_t port_num;
nrfx_gpiote_t gpiote;
#if GPIO_HAS_PAD_GROUP
const struct device *pad_group;
#endif
#if defined(GPIOTE_FEATURE_FLAG)
uint32_t flags;
#endif
#ifdef CONFIG_SOC_NRF54H20_GPD
uint8_t pad_pd;
#endif
};

static inline struct gpio_nrfx_data *get_port_data(const struct device *port)
Expand Down Expand Up @@ -87,30 +89,6 @@
return NRF_GPIO_PIN_NOPULL;
}

static void gpio_nrfx_gpd_retain_set(const struct device *port, uint32_t mask)
{
#ifdef CONFIG_SOC_NRF54H20_GPD
const struct gpio_nrfx_cfg *cfg = get_port_cfg(port);

nrf_gpio_port_retain_enable(cfg->port, mask);
#else
ARG_UNUSED(port);
ARG_UNUSED(mask);
#endif
}

static void gpio_nrfx_gpd_retain_clear(const struct device *port, uint32_t mask)
{
#ifdef CONFIG_SOC_NRF54H20_GPD
const struct gpio_nrfx_cfg *cfg = get_port_cfg(port);

nrf_gpio_port_retain_disable(cfg->port, mask);
#else
ARG_UNUSED(port);
ARG_UNUSED(mask);
#endif
}

static int gpio_nrfx_pin_configure(const struct device *port, gpio_pin_t pin,
gpio_flags_t flags)
{
Expand All @@ -122,6 +100,7 @@
nrfx_gpiote_pin_t abs_pin = NRF_GPIO_PIN_MAP(cfg->port_num, pin);
nrf_gpio_pin_pull_t pull = get_pull(flags);
nrf_gpio_pin_drive_t drive;
int pm_ret;

switch (flags & (NRF_GPIO_DRIVE_MSK | GPIO_OPEN_DRAIN)) {
case NRF_GPIO_DRIVE_S0S1:
Expand Down Expand Up @@ -157,8 +136,6 @@
return ret;
}

gpio_nrfx_gpd_retain_clear(port, BIT(pin));

if (flags & GPIO_OUTPUT_INIT_HIGH) {
nrf_gpio_port_out_set(cfg->port, BIT(pin));
} else if (flags & GPIO_OUTPUT_INIT_LOW) {
Expand Down Expand Up @@ -246,8 +223,7 @@
}

end:
gpio_nrfx_gpd_retain_set(port, BIT(pin));
int pm_ret = pm_device_runtime_put(port);
pm_ret = pm_device_runtime_put(port);

return (ret != 0) ? ret : pm_ret;
}
Expand Down Expand Up @@ -349,10 +325,8 @@
return ret;
}

gpio_nrfx_gpd_retain_clear(port, mask);
nrf_gpio_port_out_set(reg, set_mask);
nrf_gpio_port_out_clear(reg, clear_mask);
gpio_nrfx_gpd_retain_set(port, mask);
return pm_device_runtime_put(port);
}

Expand All @@ -367,9 +341,7 @@
return ret;
}

gpio_nrfx_gpd_retain_clear(port, mask);
nrf_gpio_port_out_set(reg, mask);
gpio_nrfx_gpd_retain_set(port, mask);
return pm_device_runtime_put(port);
}

Expand All @@ -384,9 +356,7 @@
return ret;
}

gpio_nrfx_gpd_retain_clear(port, mask);
nrf_gpio_port_out_clear(reg, mask);
gpio_nrfx_gpd_retain_set(port, mask);
return pm_device_runtime_put(port);
}

Expand All @@ -404,10 +374,8 @@
return ret;
}

gpio_nrfx_gpd_retain_clear(port, mask);
nrf_gpio_port_out_set(reg, set_mask);
nrf_gpio_port_out_clear(reg, clear_mask);
gpio_nrfx_gpd_retain_set(port, mask);
return pm_device_runtime_put(port);
}

Expand Down Expand Up @@ -614,14 +582,10 @@

static int gpio_nrfx_pm_suspend(const struct device *port)
{
#ifdef CONFIG_SOC_NRF54H20_GPD
#if GPIO_HAS_PAD_GROUP
const struct gpio_nrfx_cfg *cfg = get_port_cfg(port);

if (cfg->pad_pd != NRF_GPD_FAST_ACTIVE1) {
return 0;
}

return nrf_gpd_release(NRF_GPD_FAST_ACTIVE1);
return pm_device_runtime_put(cfg->pad_group);
#else
ARG_UNUSED(port);
return 0;
Expand All @@ -630,14 +594,10 @@

static int gpio_nrfx_pm_resume(const struct device *port)
{
#ifdef CONFIG_SOC_NRF54H20_GPD
#if GPIO_HAS_PAD_GROUP
const struct gpio_nrfx_cfg *cfg = get_port_cfg(port);

if (cfg->pad_pd != NRF_GPD_FAST_ACTIVE1) {
return 0;
}

return nrf_gpd_request(NRF_GPD_FAST_ACTIVE1);
return pm_device_runtime_get(cfg->pad_group);
#else
ARG_UNUSED(port);
return 0;
Expand Down Expand Up @@ -727,12 +687,11 @@
"Please enable GPIOTE instance for used GPIO port!")), \
())

#ifdef CONFIG_SOC_NRF54H20_GPD
#define PAD_PD(inst) \
.pad_pd = DT_INST_PHA_BY_NAME_OR(inst, power_domains, pad, id, \
NRF_GPD_SLOW_MAIN),
#if GPIO_HAS_PAD_GROUP
#define GPIO_NRF_PAD_GROUP_INIT(id) \
.pad_group = DEVICE_DT_GET(DT_INST_CHILD(id, pad_group)),
#else
#define PAD_PD(inst)
#define GPIO_NRF_PAD_GROUP_INIT(id)
#endif

#define GPIO_NRF_DEVICE(id) \
Expand All @@ -746,14 +705,14 @@
.port_num = DT_INST_PROP(id, port), \
.edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \
.gpiote = GPIOTE_INSTANCE(id), \
GPIO_NRF_PAD_GROUP_INIT(id) \
IF_ENABLED(GPIOTE_FEATURE_FLAG, \
(.flags = \
(DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) ? \
GPIOTE_FLAG_NO_PORT_EVT : 0) | \
(DT_PROP_OR(GPIOTE_PHANDLE(id), fixed_channels_supported, 0) ? \
GPIOTE_FLAG_FIXED_CHAN : 0),) \
) \
PAD_PD(id) \
}; \
\
static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \
Expand All @@ -767,5 +726,5 @@
PRE_KERNEL_1, \
CONFIG_GPIO_INIT_PRIORITY, \
&gpio_nrfx_drv_api_funcs);

Check notice on line 729 in drivers/gpio/gpio_nrfx.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/gpio/gpio_nrfx.c:729 -#define GPIO_NRF_PAD_GROUP_INIT(id) \ - .pad_group = DEVICE_DT_GET(DT_INST_CHILD(id, pad_group)), +#define GPIO_NRF_PAD_GROUP_INIT(id) .pad_group = DEVICE_DT_GET(DT_INST_CHILD(id, pad_group)), #else #define GPIO_NRF_PAD_GROUP_INIT(id) #endif -#define GPIO_NRF_DEVICE(id) \ - GPIOTE_CHECK(id); \ - static const struct gpio_nrfx_cfg gpio_nrfx_p##id##_cfg = { \ - .common = { \ - .port_pin_mask = \ - GPIO_PORT_PIN_MASK_FROM_DT_INST(id), \ - }, \ - .port = _CONCAT(NRF_P, DT_INST_PROP(id, port)), \ - .port_num = DT_INST_PROP(id, port), \ - .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ - .gpiote = GPIOTE_INSTANCE(id), \ - GPIO_NRF_PAD_GROUP_INIT(id) \ - IF_ENABLED(GPIOTE_FEATURE_FLAG, \ +#define GPIO_NRF_DEVICE(id) \ + GPIOTE_CHECK(id); \ + static const struct gpio_nrfx_cfg gpio_nrfx_p##id##_cfg = { \ + .common = \ + { \ + .port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(id), \ + }, \ + .port = _CONCAT(NRF_P, DT_INST_PROP(id, port)), \ + .port_num = DT_INST_PROP(id, port), \ + .edge_sense = DT_INST_PROP_OR(id, sense_edge_mask, 0), \ + .gpiote = GPIOTE_INSTANCE(id), \ + GPIO_NRF_PAD_GROUP_INIT(id) IF_ENABLED(GPIOTE_FEATURE_FLAG, \ (.flags = \ (DT_PROP_OR(GPIOTE_PHANDLE(id), no_port_event, 0) ? \ GPIOTE_FLAG_NO_PORT_EVT : 0) | \ (DT_PROP_OR(GPIOTE_PHANDLE(id), fixed_channels_supported, 0) ? \ GPIOTE_FLAG_FIXED_CHAN : 0),) \ - ) \ - }; \ - \ - static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \ - \ - PM_DEVICE_DT_INST_DEFINE(id, gpio_nrfx_pm_hook); \ - \ - DEVICE_DT_INST_DEFINE(id, gpio_nrfx_init, \ - PM_DEVICE_DT_INST_GET(id), \ - &gpio_nrfx_p##id##_data, \ - &gpio_nrfx_p##id##_cfg, \ - PRE_KERNEL_1, \ - CONFIG_GPIO_INIT_PRIORITY, \ - &gpio_nrfx_drv_api_funcs); + ) }; \ + \ + static struct gpio_nrfx_data gpio_nrfx_p##id##_data; \ + \ + PM_DEVICE_DT_INST_DEFINE(id, gpio_nrfx_pm_hook); \ + \ + DEVICE_DT_INST_DEFINE(id, gpio_nrfx_init, PM_DEVICE_DT_INST_GET(id), \ + &gpio_nrfx_p##id##_data, &gpio_nrfx_p##id##_cfg, PRE_KERNEL_1, \ + CONFIG_GPIO_INIT_PRIORITY, &gpio_nrfx_drv_api_funcs);
DT_INST_FOREACH_STATUS_OKAY(GPIO_NRF_DEVICE)
Loading
Loading