diff --git a/drivers/pinctrl/pinctrl_rpi_pico.c b/drivers/pinctrl/pinctrl_rpi_pico.c index 037213ea52d..b15ccdecf30 100644 --- a/drivers/pinctrl/pinctrl_rpi_pico.c +++ b/drivers/pinctrl/pinctrl_rpi_pico.c @@ -20,6 +20,9 @@ static void pinctrl_configure_pin(const pinctrl_soc_pin_t *pin) gpio_set_input_hysteresis_enabled(pin->pin_num, pin->schmitt_enable); gpio_set_input_enabled(pin->pin_num, pin->input_enable); gpio_set_oeover(pin->pin_num, pin->oe_override); + gpio_set_outover(pin->pin_num, pin->out_override); + gpio_set_inover(pin->pin_num, pin->in_override); + gpio_set_irqover(pin->pin_num, pin->irq_override); } int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, diff --git a/dts/bindings/pinctrl/raspberrypi,pico-pinctrl.yaml b/dts/bindings/pinctrl/raspberrypi,pico-pinctrl.yaml index 2e02bbaa252..684bc66c473 100644 --- a/dts/bindings/pinctrl/raspberrypi,pico-pinctrl.yaml +++ b/dts/bindings/pinctrl/raspberrypi,pico-pinctrl.yaml @@ -139,4 +139,61 @@ child-binding: - 2 (RP2_GPIO_OVERRIDE_LOW) - disable output. - 3 (RP2_GPIO_OVERRIDE_HIGH) - enable output. + The default value is 0, as this is the power on reset value. + raspberrypi,out-override: + type: int + enum: + - 0 + - 1 + - 2 + - 3 + default: 0 + description: | + Override output for a pin. + + - 0 (RP2_GPIO_OVERRIDE_NORMAL) - drive output from selected + peripheral signal. + - 1 (RP2_GPIO_OVERRIDE_INVERT) - drive output from inverse of + selected peripheral signal. + - 2 (RP2_GPIO_OVERRIDE_LOW) - drive output low. + - 3 (RP2_GPIO_OVERRIDE_HIGH) - drive output high. + + The default value is 0, as this is the power on reset value. + raspberrypi,in-override: + type: int + enum: + - 0 + - 1 + - 2 + - 3 + default: 0 + description: | + Override input for a pin. + + - 0 (RP2_GPIO_OVERRIDE_NORMAL) - drive input from selected + pin. + - 1 (RP2_GPIO_OVERRIDE_INVERT) - drive input from inverse of + selected pin. + - 2 (RP2_GPIO_OVERRIDE_LOW) - drive input low. + - 3 (RP2_GPIO_OVERRIDE_HIGH) - drive input high. + + The default value is 0, as this is the power on reset value. + raspberrypi,irq-override: + type: int + enum: + - 0 + - 1 + - 2 + - 3 + default: 0 + description: | + Override interrupt signal for a pin. + + - 0 (RP2_GPIO_OVERRIDE_NORMAL) - drive interrupt signal to selected + peripheral. + - 1 (RP2_GPIO_OVERRIDE_INVERT) - drive interrupt signal from inverse to + selected peripheral. + - 2 (RP2_GPIO_OVERRIDE_LOW) - drive interrupt signal low. + - 3 (RP2_GPIO_OVERRIDE_HIGH) - drive interrupt signal high. + The default value is 0, as this is the power on reset value. diff --git a/soc/raspberrypi/rpi_pico/common/pinctrl_soc.h b/soc/raspberrypi/rpi_pico/common/pinctrl_soc.h index 43cafe1cff9..0727c58444b 100644 --- a/soc/raspberrypi/rpi_pico/common/pinctrl_soc.h +++ b/soc/raspberrypi/rpi_pico/common/pinctrl_soc.h @@ -31,6 +31,12 @@ struct rpi_pinctrl_soc_pin { uint32_t schmitt_enable : 1; /** Output-enable override */ uint32_t oe_override : 2; + /** Output override */ + uint32_t out_override : 2; + /** Input override */ + uint32_t in_override : 2; + /** Interrupt override */ + uint32_t irq_override : 2; }; typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t; @@ -52,7 +58,10 @@ typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t; DT_PROP(node_id, bias_pull_down), \ DT_PROP(node_id, input_enable), \ DT_PROP(node_id, input_schmitt_enable), \ - DT_PROP(node_id, raspberrypi_oe_override), \ + DT_PROP(node_id, raspberrypi_oe_override), \ + DT_PROP(node_id, raspberrypi_out_override), \ + DT_PROP(node_id, raspberrypi_in_override), \ + DT_PROP(node_id, raspberrypi_irq_override), \ }, /**