diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2021-02-18 11:33:18 +0100 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2021-02-18 11:37:26 +0100 |
commit | 289d0ead2887af6b1c013a96cc2c85100e1e591c (patch) | |
tree | ee4e378502d90c6c423a1fa7ff76688d02d8526e /arch | |
parent | a638fba9fc77a2d6994671f5bb2afa3e730ff26f (diff) | |
download | u-boot-289d0ead2887af6b1c013a96cc2c85100e1e591c.tar.gz u-boot-289d0ead2887af6b1c013a96cc2c85100e1e591c.tar.xz u-boot-289d0ead2887af6b1c013a96cc2c85100e1e591c.zip |
test: add a simple test for the adc-keys button driver
Add adc-keys device to the sandbox/test.dts and connect it to the channel
#3 of the sandbox_adc driver. The default values sampled by sandbox_adc
driver determines that button3 and button4 are released and button5 is
pressed.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sandbox/dts/test.dts | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index e95f4631bf..202e091841 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -2,6 +2,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/sandbox-gpio.h> +#include <dt-bindings/input/input.h> #include <dt-bindings/pinctrl/sandbox-pinmux.h> #include <dt-bindings/mux/mux.h> @@ -69,6 +70,30 @@ }; }; + buttons2 { + compatible = "adc-keys"; + io-channels = <&adc 3>; + keyup-threshold-microvolt = <3000000>; + + button-up { + label = "button3"; + linux,code = <KEY_F3>; + press-threshold-microvolt = <1500000>; + }; + + button-down { + label = "button4"; + linux,code = <KEY_F4>; + press-threshold-microvolt = <1000000>; + }; + + button-enter { + label = "button5"; + linux,code = <KEY_F5>; + press-threshold-microvolt = <500000>; + }; + }; + cros_ec: cros-ec { reg = <0 0>; compatible = "google,cros-ec-sandbox"; @@ -587,8 +612,9 @@ i2c-eeprom = <&bootcount_i2c>; }; - adc@0 { + adc: adc@0 { compatible = "sandbox,adc"; + #io-channel-cells = <1>; vdd-supply = <&buck2>; vss-microvolts = <0>; }; |