Skip to content

Commit 1bb86a1

Browse files
committed
drivers: serial: NRF UARTE: changes to build with pinctrl API
tweaks to uarte driver to build with pinctrl API Signed-off-by: Kumar Gala <[email protected]>
1 parent f732d5c commit 1bb86a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ struct uarte_nrfx_data {
160160
*/
161161
struct uarte_nrfx_config {
162162
NRF_UARTE_Type *uarte_regs; /* Instance address */
163+
const struct pinctrl_config pincfg;
163164
uint32_t flags;
164165
bool disable_rx;
165166
#ifdef CONFIG_UART_ASYNC_API
@@ -1670,10 +1671,7 @@ static int uarte_instance_init(const struct device *dev,
16701671

16711672
data->dev = dev;
16721673

1673-
err = pinctrl_state_set(dev, PINCTRL_STATE_ID_DEFAULT);
1674-
if (err < 0) {
1675-
return err;
1676-
}
1674+
pinctrl_set_pin_state(cfg->pincfg.states[0]);
16771675

16781676
err = uarte_nrfx_configure(dev, &get_dev_data(dev)->uart_config);
16791677
if (err) {
@@ -1881,6 +1879,7 @@ static int uarte_nrfx_pm_control(const struct device *dev,
18811879
(1))) ? 0 : UARTE_CFG_FLAG_LOW_POWER)
18821880

18831881
#define UART_NRF_UARTE_DEVICE(idx) \
1882+
PINCTRL_DT_CONFIG_DEFINE(UARTE(idx)); \
18841883
UARTE_INT_DRIVEN(idx); \
18851884
UARTE_ASYNC(idx); \
18861885
static struct uarte_nrfx_data uarte_##idx##_data = { \
@@ -1892,6 +1891,7 @@ static int uarte_nrfx_pm_control(const struct device *dev,
18921891
}; \
18931892
static const struct uarte_nrfx_config uarte_##idx##z_config = { \
18941893
.uarte_regs = (NRF_UARTE_Type *)DT_REG_ADDR(UARTE(idx)), \
1894+
.pincfg = PINCTRL_DT_CONFIG_NAME(UARTE(idx)), \
18951895
.flags = \
18961896
(UARTE_HAS_PROP(idx, rts_pin) ? \
18971897
UARTE_CFG_FLAG_RTS_PIN_SET : 0) | \

0 commit comments

Comments
 (0)