diff --git a/sun8i-h3/README.sun8i-h3-overlays b/sun8i-h3/README.sun8i-h3-overlays index 3029734..030c8b0 100644 --- a/sun8i-h3/README.sun8i-h3-overlays +++ b/sun8i-h3/README.sun8i-h3-overlays @@ -17,6 +17,7 @@ adding fixed software (GPIO) chip selects is possible with a separate overlay - analog-codec - cir +- gpio-poweroff - i2c0 - i2c1 - i2c2 @@ -68,6 +69,16 @@ I2C2 pins (SCL, SDA): PE12, PE13 On most board this bus is wired to Camera (CSI) socket +### gpio-poweroff + +Activates poweroff gpio driver, this driver toggles a pin when the system shuts down + +Parameters: + +param_pwr_off_pin (pin) + Pin which outputs poweroff signal when system halts + Default: PG11 + ### pps-gpio Activates pulse-per-second GPIO client diff --git a/sun8i-h3/sun8i-h3-gpio-poweroff.dts b/sun8i-h3/sun8i-h3-gpio-poweroff.dts new file mode 100644 index 0000000..7146c85 --- /dev/null +++ b/sun8i-h3/sun8i-h3-gpio-poweroff.dts @@ -0,0 +1,28 @@ +/dts-v1/; +/plugin/; + +/ { + compatible = "allwinner,sun8i-h3"; + + fragment@0 { + target = <&pio>; + __overlay__ { + pwr_off_pins: pwr_off_pins { + pins = "PG11"; + function = "gpio_out"; + }; + }; + }; + + fragment@1 { + target-path = "/"; + __overlay__ { + gpio-poweroff { + compatible = "gpio-poweroff"; + pinctrl-names = "default"; + pinctrl-0 = <&pwr_off_pins>; + gpios = <&pio 6 11 0>; + }; + }; + }; +};