]> git.baikalelectronics.ru Git - uboot.git/commit
button: adc: set state to pressed when the voltage is closest to nominal
authorPeter Cai <peter@typeblog.net>
Wed, 2 Feb 2022 18:04:04 +0000 (13:04 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 11 Feb 2022 14:00:47 +0000 (09:00 -0500)
commit7bbc0edd2cf8bb7f25c198da684fb057912e7846
tree44d406100f1ffd0cbf16f766a74560f3cac9491d
parenta04f4f09354d5f67da2d2ae4448e298e77cf7ea1
button: adc: set state to pressed when the voltage is closest to nominal

In the Linux implementation of adc-keys
(drivers/input/keyboard/adc-keys.c), `press-threshold-microvolt` is not
really interpreted as a threshold, but rather as the "nominal voltage"
of the button. When the voltage read from the ADC is closest to a
button's `press-threshold-microvolt`, the button is considered pressed.

This patch reconciles the behavior of button-adc with Linux's adc-keys
such that device trees can be synchronized with minimal modifications.

Signed-off-by: Peter Cai <peter@typeblog.net>
drivers/button/button-adc.c