gpio-ir-overlay: add parameter to configure signal polarity (#3490)
authorMatthias Reichl <hias@horus.com>
Fri, 6 Mar 2020 10:08:10 +0000 (11:08 +0100)
committerGitHub <noreply@github.com>
Fri, 6 Mar 2020 10:08:10 +0000 (10:08 +0000)
Standard IR receivers use inverted / active-low signalling
and the gpio-ir overlay configures the GPIO appropriately
as GPIO_ACTIVE_LOW (1).

In order to support (rather rare) non-inverted / active-high
signalling the GPIO needs to be configured as GPIO_ACTIVE_HIGH (0).

Add an "invert" parameter to override this like in the gpio-ir-tx
overlay.

Signed-off-by: Matthias Reichl <hias@horus.com>
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/gpio-ir-overlay.dts

index 572edc7..d2306a2 100644 (file)
@@ -754,6 +754,10 @@ Params: gpio_pin                Input pin number. Default is 18.
         gpio_pull               Desired pull-up/down state (off, down, up)
                                 Default is "up".
 
+        invert                  "1" = invert the input (active-low signalling).
+                                "0" = non-inverted input (active-high
+                                signalling). Default is "1".
+
         rc-map-name             Default rc keymap (can also be changed by
                                 ir-keytable), defaults to "rc-rc6-mce"
 
index 58f5884..162b6ce 100644 (file)
@@ -42,6 +42,7 @@
                                 <&gpio_ir_pins>,"brcm,pins:0",
                                 <&gpio_ir_pins>,"reg:0";
                 gpio_pull = <&gpio_ir_pins>,"brcm,pull:0";              // pull-up/down state
+                invert = <&gpio_ir>,"gpios:8";                          // 0 = active high input
 
                 rc-map-name = <&gpio_ir>,"linux,rc-map-name";           // default rc map
         };