^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) AXP209 GPIO & pinctrl controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) This driver follows the usual GPIO bindings found in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Documentation/devicetree/bindings/gpio/gpio.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) This driver follows the usual pinctrl bindings found in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) This driver employs the per-pin muxing pattern.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) Required properties:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) - compatible: Should be one of:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) - "x-powers,axp209-gpio"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) - "x-powers,axp813-gpio"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) - #gpio-cells: Should be two. The first cell is the pin number and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) second is the GPIO flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) - gpio-controller: Marks the device node as a GPIO controller.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) This node must be a subnode of the axp20x PMIC, documented in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) Documentation/devicetree/bindings/mfd/axp20x.txt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) axp209: pmic@34 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) compatible = "x-powers,axp209";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) reg = <0x34>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) interrupt-parent = <&nmi_intc>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) interrupt-controller;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #interrupt-cells = <1>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) axp_gpio: gpio {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) compatible = "x-powers,axp209-gpio";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) gpio-controller;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #gpio-cells = <2>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) The GPIOs can be muxed to other functions and therefore, must be a subnode of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) axp_gpio.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) &axp_gpio {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) gpio0_adc: gpio0-adc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) pins = "GPIO0";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) function = "adc";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) &example_node {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) pinctrl-names = "default";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) pinctrl-0 = <&gpio0_adc>;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) GPIOs and their functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) -------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) Each GPIO is independent from the other (i.e. GPIO0 in gpio_in function does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) not force GPIO1 and GPIO2 to be in gpio_in function as well).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) axp209
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) ------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) GPIO | Functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) ------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) GPIO0 | gpio_in, gpio_out, ldo, adc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) GPIO1 | gpio_in, gpio_out, ldo, adc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) GPIO2 | gpio_in, gpio_out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) axp813
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) ------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) GPIO | Functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) ------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) GPIO0 | gpio_in, gpio_out, ldo, adc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) GPIO1 | gpio_in, gpio_out, ldo