drivers: pinctrl: nrf: add support for CAN TX/RX

So that we can configure CAN pins.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
Gerard Marull-Paretas 2024-05-07 12:45:46 +02:00 committed by Carles Cufí
commit 0d4d4e7754
2 changed files with 15 additions and 0 deletions

View file

@ -360,6 +360,17 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
input = NRF_GPIO_PIN_INPUT_DISCONNECT;
break;
#endif /* defined(NRF_PSEL_QSPI) */
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can)
/* Pin routing is controlled by secure domain, via UICR */
case NRF_FUN_CAN_TX:
dir = NRF_GPIO_PIN_DIR_OUTPUT;
input = NRF_GPIO_PIN_INPUT_DISCONNECT;
break;
case NRF_FUN_CAN_RX:
dir = NRF_GPIO_PIN_DIR_INPUT;
input = NRF_GPIO_PIN_INPUT_CONNECT;
break;
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_can) */
default:
return -ENOTSUP;
}

View file

@ -147,6 +147,10 @@
#define NRF_FUN_EXMIF_CS0 44U
/** EXMIF CS1 */
#define NRF_FUN_EXMIF_CS1 45U
/** CAN TX */
#define NRF_FUN_CAN_TX 46U
/** CAN RX */
#define NRF_FUN_CAN_RX 47U
/** @} */