| # SPDX-License-Identifier: Apache-2.0 |
| |
| description: | |
| The ENE KB106X pin controller is a singleton node responsible for controlling |
| pin function selection and pin properties. For example, you can use these |
| nodes to select peripheral pin functions. |
| |
| Here is a list of supported standard pin properties: |
| - bias-disable: Disable pull-up/down resistor. |
| - bias-pull-up: Enable pull-up resistor. |
| - bias-pull-down: Enable pull-down resistor. |
| - drive-push-pull: Output driver is push-pull. |
| - drive-open-drain: Output driver is open-drain. |
| - output-disable: Disable GPIO output driver data |
| - output-enable: Ensable GPIO output driver data |
| - output-high: GPIO output data high |
| - output-low: GPIO output data low |
| - low-power-enable: Support input data ViH/ViL with low vlotage range(ex. 1.8V domain) |
| - input-enable: enable input on pin |
| - input-disable: disable input on pin |
| - drive-strength: current driving strength |
| |
| Here is a list of support pinmux type: |
| - PINMUX_FUNC_A : GPIO Function |
| - PINMUX_FUNC_B : AltOutput 1 Function |
| - PINMUX_FUNC_C : AltOutput 2 Function |
| - PINMUX_FUNC_D : AltOutput 3 Function |
| - PINMUX_FUNC_E : AltOutput 4 Function |
| (Note. Alt-input function does not need to set pinmux type other than PINMUX_FUNC_A) |
| |
| An example for KB106X, include the chip level pinctrl DTSI file in the |
| board level DTS: |
| |
| #include <ene_kb106x/ene_kb106x-pinctrl.dtsi> |
| |
| We want to use the I2C0_0 port of the KB106X controller and enable the |
| internal 3.3V pull-up if its i2c frequency won't exceed 400kHz. And we |
| need to set I2C0_0 pinmux type as PINMUX_FUNC_B (the alt-output 1 |
| function) not a GPIO. |
| |
| To change a pin's pinctrl default properties, add a reference to the |
| pin in the board's DTS file and set the properties as below: |
| |
| &i2c0_0 { |
| pinctrl-0 = <&i2c0_clk_gpio2c &i2c0_dat_gpio2d>; |
| pinctrl-names = "default"; |
| } |
| |
| /omit-if-no-ref/ i2c0_clk_gpio2c: i2c0_clk_gpio2c { |
| pinmux = <ENE_KB106X_PINMUX(0x2C, PINMUX_FUNC_B)>; |
| bias-pull-up; |
| }; |
| /omit-if-no-ref/ i2c0_dat_gpio2d: i2c0_dat_gpio2d { |
| pinmux = <ENE_KB106X_PINMUX(0x2D, PINMUX_FUNC_B)>; |
| bias-pull-up; |
| }; |
| |
| compatible: "ene,kb106x-pinctrl" |
| |
| include: base.yaml |
| |
| properties: |
| reg: |
| required: true |
| |
| child-binding: |
| description: | |
| This binding gives a base representation of the ENE KB106x pins configuration. |
| Only when the pinmux type is selected as PINMUX_FUNC_A and output enable is set, |
| the below setting will effect. |
| "output-high/output-low/drive-push-pull/drive-open-drain." |
| |
| include: |
| - name: pincfg-node.yaml |
| property-allowlist: |
| - bias-disable |
| - bias-pull-down |
| - bias-pull-up |
| - drive-push-pull |
| - drive-open-drain |
| - output-disable |
| - output-enable |
| - output-high |
| - output-low |
| - input-enable |
| - input-disable |
| - low-power-enable |
| - drive-strength |
| properties: |
| pinmux: |
| type: int |
| required: true |
| description: Pinmux selection |
| drive-strength: |
| enum: |
| - 4 |
| - 16 |
| default: 4 |
| description: | |
| The drive strength controls the maximum driving capabilities. |
| 4 : 4 mA (SoC default) |
| 16: 16 mA |