1# SPDX-License-Identifier: Apache-2.0
2
3description: |
4  The ENE KB1200 pin controller is a singleton node responsible for controlling
5  pin function selection and pin properties. For example, you can use these
6  nodes to select peripheral pin functions.
7
8  Here is a list of supported standard pin properties:
9    - bias-disable: Disable pull-up/down resistor.
10    - bias-pull-up: Enable pull-up resistor.
11    - bias-pull-down: Enable pull-down resistor.
12    - drive-push-pull: Output driver is push-pull.
13    - drive-open-drain: Output driver is open-drain.
14    - output-disable: Disable GPIO output driver data
15    - output-enable: Ensable GPIO output driver data
16    - output-high: GPIO output data high
17    - output-low: GPIO output data low
18    - low-power-enable: Support input data ViH/ViL with low vlotage range(ex. 1.8V domain)
19
20  Here is a list of support pinmux type:
21    - PINMUX_FUNC_A : GPIO        Function
22    - PINMUX_FUNC_B : AltOutput 1 Function
23    - PINMUX_FUNC_C : AltOutput 2 Function
24    - PINMUX_FUNC_D : AltOutput 3 Function
25    - PINMUX_FUNC_E : AltOutput 4 Function
26    (Note. Alt-input function does not need to set pinmux type other than PINMUX_FUNC_A)
27
28  An example for KB1200, include the chip level pinctrl DTSI file in the
29  board level DTS:
30
31    #include <ene_kb1200/ene_kb1200-pinctrl.dtsi>
32
33  We want to use the I2C0_0 port of the KB1200 controller and enable the
34  internal 3.3V pull-up if its i2c frequency won't exceed 400kHz. And we
35  need to set I2C0_0 pinmux type as PINMUX_FUNC_B (the alt-output 1
36  function) not a GPIO.
37
38  To change a pin's pinctrl default properties, add a reference to the
39  pin in the board's DTS file and set the properties as below:
40
41    &i2c0_0 {
42      pinctrl-0 = <&i2c0_clk_gpio2c &i2c0_dat_gpio2d>;
43      pinctrl-names = "default";
44    }
45
46    /omit-if-no-ref/ i2c0_clk_gpio2c: i2c0_clk_gpio2c {
47      pinmux = <ENE_KB1200_PINMUX(0x2C, PINMUX_FUNC_B)>;
48      bias-pull-up;
49    };
50    /omit-if-no-ref/ i2c0_dat_gpio2d: i2c0_dat_gpio2d {
51      pinmux = <ENE_KB1200_PINMUX(0x2D, PINMUX_FUNC_B)>;
52      bias-pull-up;
53    };
54
55compatible: "ene,kb1200-pinctrl"
56
57include: base.yaml
58
59properties:
60  reg:
61    required: true
62
63child-binding:
64  description: |
65    This binding gives a base representation of the ENE KB1200 pins
66    configuration
67
68  include:
69    - name: pincfg-node.yaml
70      property-allowlist:
71        - bias-disable
72        - bias-pull-down
73        - bias-pull-up
74        - drive-push-pull
75        - drive-open-drain
76        - output-disable
77        - output-enable
78        - output-high
79        - output-low
80        - low-power-enable
81
82  properties:
83    pinmux:
84      type: int
85      required: true
86      description: Pinmux selection
87