| # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) | |
| %YAML 1.2 | |
| --- | |
| $id: http://devicetree.org/schemas/pinctrl/airoha,an7563-pinctrl.yaml# | |
| $schema: http://devicetree.org/meta-schemas/core.yaml# | |
| title: Airoha AN7563 Pin Controller | |
| maintainers: | |
| - Lorenzo Bianconi <lorenzo@kernel.org> | |
| description: | |
| The Airoha's AN7563 Pin controller is used to control SoC pins. | |
| properties: | |
| compatible: | |
| const: airoha,an7563-pinctrl | |
| interrupts: | |
| maxItems: 1 | |
| gpio-controller: true | |
| '#gpio-cells': | |
| const: 2 | |
| gpio-ranges: | |
| maxItems: 1 | |
| interrupt-controller: true | |
| '#interrupt-cells': | |
| const: 2 | |
| allOf: | |
| - $ref: pinctrl.yaml# | |
| required: | |
| - compatible | |
| - interrupts | |
| - gpio-controller | |
| - "#gpio-cells" | |
| - interrupt-controller | |
| - "#interrupt-cells" | |
| patternProperties: | |
| '-pins$': | |
| type: object | |
| patternProperties: | |
| '^mux(-|$)': | |
| type: object | |
| description: | |
| pinmux configuration nodes. | |
| $ref: /schemas/pinctrl/pinmux-node.yaml | |
| properties: | |
| function: | |
| description: | |
| A string containing the name of the function to mux to the group. | |
| enum: [pon, sipo, mdio, uart, jtag, pcm, spi, pnand, gpio, | |
| pcie_reset, pwm, phy1_led0, phy2_led0, phy3_led0, | |
| phy4_led0, phy1_led1, phy2_led1, phy3_led1, phy4_led1] | |
| groups: | |
| description: | |
| An array of strings. Each string contains the name of a group. | |
| required: | |
| - function | |
| - groups | |
| allOf: | |
| - if: | |
| properties: | |
| function: | |
| const: pon | |
| then: | |
| properties: | |
| groups: | |
| enum: [pon] | |
| - if: | |
| properties: | |
| function: | |
| const: sipo | |
| then: | |
| properties: | |
| groups: | |
| enum: [sipo, sipo_rclk] | |
| - if: | |
| properties: | |
| function: | |
| const: mdio | |
| then: | |
| properties: | |
| groups: | |
| enum: [mdio] | |
| - if: | |
| properties: | |
| function: | |
| const: uart | |
| then: | |
| properties: | |
| groups: | |
| items: | |
| enum: [hsuart, hsuart_cts_rts] | |
| maxItems: 2 | |
| - if: | |
| properties: | |
| function: | |
| const: jtag | |
| then: | |
| properties: | |
| groups: | |
| enum: [jtag_udi, jtag_dfd] | |
| - if: | |
| properties: | |
| function: | |
| const: pcm | |
| then: | |
| properties: | |
| groups: | |
| enum: [pcm1, pcm2] | |
| - if: | |
| properties: | |
| function: | |
| const: spi | |
| then: | |
| properties: | |
| groups: | |
| items: | |
| enum: [spi_quad, spi_cs1] | |
| maxItems: 2 | |
| - if: | |
| properties: | |
| function: | |
| const: pnand | |
| then: | |
| properties: | |
| groups: | |
| enum: [pnand] | |
| - if: | |
| properties: | |
| function: | |
| const: gpio | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio28, gpio29, gpio30, gpio31, gpio32, | |
| gpio33, gpio34, gpio35, gpio36, gpio37] | |
| - if: | |
| properties: | |
| function: | |
| const: pcie_reset | |
| then: | |
| properties: | |
| groups: | |
| enum: [pcie_reset0, pcie_reset1] | |
| - if: | |
| properties: | |
| function: | |
| const: pwm | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, | |
| gpio7, gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, | |
| gpio14, gpio15, gpio16, gpio17, gpio18, gpio19, | |
| gpio20, gpio21, gpio22, gpio23, gpio24, gpio25, | |
| gpio26, gpio27, gpio28, gpio29, gpio30, gpio31, | |
| gpio36, gpio37] | |
| - if: | |
| properties: | |
| function: | |
| const: phy1_led0 | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio8, gpio9, gpio10, gpio11] | |
| - if: | |
| properties: | |
| function: | |
| const: phy2_led0 | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio8, gpio9, gpio10, gpio11] | |
| - if: | |
| properties: | |
| function: | |
| const: phy3_led0 | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio8, gpio9, gpio10, gpio11] | |
| - if: | |
| properties: | |
| function: | |
| const: phy4_led0 | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio8, gpio9, gpio10, gpio11] | |
| - if: | |
| properties: | |
| function: | |
| const: phy1_led1 | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio4, gpio5, gpio6, gpio7] | |
| - if: | |
| properties: | |
| function: | |
| const: phy2_led1 | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio4, gpio5, gpio6, gpio7] | |
| - if: | |
| properties: | |
| function: | |
| const: phy3_led1 | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio4, gpio5, gpio6, gpio7] | |
| - if: | |
| properties: | |
| function: | |
| const: phy4_led1 | |
| then: | |
| properties: | |
| groups: | |
| enum: [gpio4, gpio5, gpio6, gpio7] | |
| additionalProperties: false | |
| '^conf(-|$)': | |
| type: object | |
| description: | |
| pinconf configuration nodes. | |
| $ref: /schemas/pinctrl/pincfg-node.yaml | |
| properties: | |
| pins: | |
| description: | |
| An array of strings. Each string contains the name of a pin. | |
| items: | |
| enum: [gpio0, gpio1, gpio2, gpio3, gpio4, gpio5, gpio6, gpio7, | |
| gpio8, gpio9, gpio10, gpio11, gpio12, gpio13, gpio14, | |
| gpio15, gpio16, gpio17, gpio18, gpio19, gpio20, gpio21, | |
| gpio22, gpio23, gpio24, gpio25, gpio26, gpio27, | |
| pcie_reset0, pcie_reset1, i2c_scl, i2c_sda, spi_clk, | |
| spi_cs, spi_mosi, spi_miso, uart_txd, uart_rxd] | |
| minItems: 1 | |
| maxItems: 38 | |
| bias-disable: true | |
| bias-pull-up: true | |
| bias-pull-down: true | |
| input-enable: true | |
| output-enable: true | |
| output-low: true | |
| output-high: true | |
| drive-open-drain: true | |
| drive-strength: | |
| description: | |
| Selects the drive strength for MIO pins, in mA. | |
| enum: [2, 4, 6, 8] | |
| required: | |
| - pins | |
| additionalProperties: false | |
| additionalProperties: false | |
| additionalProperties: false | |
| examples: | |
| - | | |
| #include <dt-bindings/interrupt-controller/arm-gic.h> | |
| pinctrl { | |
| compatible = "airoha,an7563-pinctrl"; | |
| interrupt-parent = <&gic>; | |
| interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; | |
| gpio-controller; | |
| #gpio-cells = <2>; | |
| interrupt-controller; | |
| #interrupt-cells = <2>; | |
| gpio-ranges = <&pinctrl 0 0 38>; | |
| pcie1-rst-pins { | |
| conf { | |
| pins = "pcie_reset1"; | |
| drive-open-drain = <1>; | |
| }; | |
| }; | |
| pwm-pins { | |
| mux { | |
| function = "pwm"; | |
| groups = "gpio18"; | |
| }; | |
| }; | |
| spi-pins { | |
| mux { | |
| function = "spi"; | |
| groups = "spi_quad", "spi_cs1"; | |
| }; | |
| }; | |
| hsuart-pins { | |
| mux { | |
| function = "uart"; | |
| groups = "hsuart", "hsuart_cts_rts"; | |
| }; | |
| }; | |
| mdio-pins { | |
| mux { | |
| function = "mdio"; | |
| groups = "mdio"; | |
| }; | |
| conf { | |
| pins = "gpio2"; | |
| output-enable; | |
| }; | |
| }; | |
| }; |