2017-12-05 22:46:42 +08:00
|
|
|
AXP209 GPIO & pinctrl controller
|
2016-07-20 22:11:36 +08:00
|
|
|
|
|
|
|
This driver follows the usual GPIO bindings found in
|
|
|
|
Documentation/devicetree/bindings/gpio/gpio.txt
|
|
|
|
|
2017-12-05 22:46:42 +08:00
|
|
|
This driver follows the usual pinctrl bindings found in
|
|
|
|
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
|
|
|
|
|
|
|
|
This driver employs the per-pin muxing pattern.
|
|
|
|
|
2016-07-20 22:11:36 +08:00
|
|
|
Required properties:
|
|
|
|
- compatible: Should be "x-powers,axp209-gpio"
|
|
|
|
- #gpio-cells: Should be two. The first cell is the pin number and the
|
|
|
|
second is the GPIO flags.
|
|
|
|
- gpio-controller: Marks the device node as a GPIO controller.
|
|
|
|
|
|
|
|
This node must be a subnode of the axp20x PMIC, documented in
|
|
|
|
Documentation/devicetree/bindings/mfd/axp20x.txt
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
axp209: pmic@34 {
|
|
|
|
compatible = "x-powers,axp209";
|
|
|
|
reg = <0x34>;
|
|
|
|
interrupt-parent = <&nmi_intc>;
|
|
|
|
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
|
|
|
|
interrupt-controller;
|
|
|
|
#interrupt-cells = <1>;
|
|
|
|
|
|
|
|
axp_gpio: gpio {
|
|
|
|
compatible = "x-powers,axp209-gpio";
|
|
|
|
gpio-controller;
|
|
|
|
#gpio-cells = <2>;
|
|
|
|
};
|
|
|
|
};
|
2017-12-05 22:46:42 +08:00
|
|
|
|
|
|
|
The GPIOs can be muxed to other functions and therefore, must be a subnode of
|
|
|
|
axp_gpio.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
&axp_gpio {
|
|
|
|
gpio0_adc: gpio0-adc {
|
|
|
|
pins = "GPIO0";
|
|
|
|
function = "adc";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
&example_node {
|
|
|
|
pinctrl-names = "default";
|
|
|
|
pinctrl-0 = <&gpio0_adc>;
|
|
|
|
};
|
|
|
|
|
|
|
|
GPIOs and their functions
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
Each GPIO is independent from the other (i.e. GPIO0 in gpio_in function does
|
|
|
|
not force GPIO1 and GPIO2 to be in gpio_in function as well).
|
|
|
|
|
|
|
|
GPIO | Functions
|
|
|
|
------------------------
|
|
|
|
GPIO0 | gpio_in, gpio_out, ldo, adc
|
|
|
|
GPIO1 | gpio_in, gpio_out, ldo, adc
|
|
|
|
GPIO2 | gpio_in, gpio_out
|