summaryrefslogtreecommitdiff
path: root/docs/zephyr/zephyr_gpio.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/zephyr/zephyr_gpio.md')
-rw-r--r--docs/zephyr/zephyr_gpio.md32
1 files changed, 21 insertions, 11 deletions
diff --git a/docs/zephyr/zephyr_gpio.md b/docs/zephyr/zephyr_gpio.md
index 5e70562ab9..5204e6107f 100644
--- a/docs/zephyr/zephyr_gpio.md
+++ b/docs/zephyr/zephyr_gpio.md
@@ -70,6 +70,15 @@ included from the main board DTS file.
For platform specific features, other flags may be available in the Zephyr
[dt-bindings/gpio/gpio.h] file, such as `GPIO_VOLTAGE_1P8`.
+### Alternate functions
+
+All pins are configured as GPIO by default, so normally pinctrl configuration
+for GPIO pins is not required. Note that on NPCX ECs some pins default to a
+non-GPIO function after reset. These are explicitly set to GPIO during
+initialization, based on the `def-io-conf-list` node in [npcx9.dtsi], so they
+do not need to be set to GPIO usage, but they need an explicit `pinctrl-x`
+entry to be set back to the specific function.
+
### Legacy enum-name usage
Only GPIOs that require referencing from legacy common code should have
@@ -241,18 +250,18 @@ For example on the Volteer reference board:
Low voltage pins configuration depends on the specific chip family.
-For Nuvoton, this is done using a [nuvoton,npcx-lvolctrl-def] devicetree node,
-with a `lvol-io-pads` property listing all the pins that have to be configured
-for low-voltage operation. For example:
+For Nuvoton, this is done using the `GPIO_VOLTAGE_1P8` flag in the `named-gpios`
+child node. For example
```
-def-lvol-io-list {
- compatible = "nuvoton,npcx-lvolctrl-def";
- lvol-io-pads = <
- &lvol_iob3 /* EC_I2C_SENSOR_SCL */
- &lvol_iob2 /* EC_I2C_SENSOR_SDA */
- >;
-};
+named-gpios {
+ compatible = "named-gpios";
+ ...
+ ec-i2c-sensor-scl {
+ gpios = <&gpiob 5 (GPIO_INPUT | GPIO_VOLTAGE_1P8)>;
+ };
+ ...
+}
```
For ITE, this is done using the `GPIO_VOLTAGE_1P8` flag in the `named-gpios`
@@ -456,4 +465,5 @@ project.
[gpio.dts]: ../../zephyr/projects/volteer/volteer/gpio.dts
[interrupts.dts]: ../../zephyr/projects/volteer/volteer/interrupts.dts
[BUILD.py]: ../../zephyr/projects/volteer/volteer/BUILD.py
-[*node label*]: https://docs.zephyrproject.org/latest/build/dts/intro.html#dt-node-labels \ No newline at end of file
+[*node label*]: https://docs.zephyrproject.org/latest/build/dts/intro.html#dt-node-labels
+[npcx9.dtsi]: https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/arm/nuvoton/npcx9.dtsi