drivers: cc13xx_cc26xx: pinctrl: support drive strength

Introduces support for drive-strength configuration to the CC13/26xx
pinctrl driver.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This commit is contained in:
Florian Grandel 2023-07-25 12:45:24 +02:00 committed by Carles Cufí
commit 0dcbb22265
2 changed files with 26 additions and 0 deletions

View file

@ -26,6 +26,7 @@ description: |
- bias-pull-up: Enable pull-up resistor.
- drive-open-drain: Output driver is open-drain.
- drive-open-drain: Output driver is open-source.
- drive-strength: Minimum current that can be sourced from the pin.
- input-enable: enable input.
- input-schmitt-enable: enable input schmitt circuit.
@ -57,6 +58,16 @@ description: |
};
};
To configure an output pin (e.g. for PWM output):
&pinctrl {
gpt0_pwm: gpt0_pwm {
pinmux = <16 IOC_PORT_MCU_PORT_EVENT1>;
bias-disable;
drive-strength = <8>; /* in mA */
};
};
compatible: "ti,cc13xx-cc26xx-pinctrl"
include: base.yaml
@ -78,6 +89,7 @@ child-binding:
- bias-pull-up
- drive-open-drain
- drive-open-source
- drive-strength
- input-enable
- input-schmitt-enable
@ -87,3 +99,16 @@ child-binding:
type: array
description: |
CC13XX/CC26XX pin's configuration (IO pin, IO function).
drive-strength:
enum:
- 2
- 4
- 8
default: 2
description: |
The drive strength controls the minimum output driver strength of an I/O pin
configured as an output.
2: min 2 mA (SoC default)
4: min 4 mA
8: min 8 mA for for double drive strength IOs, min 4 mA for normal IOs

View file

@ -24,6 +24,7 @@ typedef struct pinctrl_soc_pin {
DT_PROP(node_id, bias_disable) * IOC_NO_IOPULL | \
DT_PROP(node_id, drive_open_drain) * IOC_IOMODE_OPEN_DRAIN_NORMAL | \
DT_PROP(node_id, drive_open_source) * IOC_IOMODE_OPEN_SRC_NORMAL | \
(DT_PROP(node_id, drive_strength) >> 2) << IOC_IOCFG0_IOCURR_S | \
DT_PROP(node_id, input_enable) * IOC_INPUT_ENABLE | \
DT_PROP(node_id, input_schmitt_enable) * IOC_HYST_ENABLE)