adc-keys.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ADC attached resistor ladder buttons
  2. ------------------------------------
  3. Required properties:
  4. - compatible: "adc-keys"
  5. - io-channels: Phandle to an ADC channel
  6. - io-channel-names = "buttons";
  7. - keyup-threshold-microvolt: Voltage at which all the keys are considered up.
  8. Optional properties:
  9. - poll-interval: Poll interval time in milliseconds
  10. - autorepeat: Boolean, Enable auto repeat feature of Linux input
  11. subsystem.
  12. Each button (key) is represented as a sub-node of "adc-keys":
  13. Required subnode-properties:
  14. - label: Descriptive name of the key.
  15. - linux,code: Keycode to emit.
  16. - press-threshold-microvolt: Voltage ADC input when this key is pressed.
  17. Example:
  18. #include <dt-bindings/input/input.h>
  19. adc-keys {
  20. compatible = "adc-keys";
  21. io-channels = <&lradc 0>;
  22. io-channel-names = "buttons";
  23. keyup-threshold-microvolt = <2000000>;
  24. button-up {
  25. label = "Volume Up";
  26. linux,code = <KEY_VOLUMEUP>;
  27. press-threshold-microvolt = <1500000>;
  28. };
  29. button-down {
  30. label = "Volume Down";
  31. linux,code = <KEY_VOLUMEDOWN>;
  32. press-threshold-microvolt = <1000000>;
  33. };
  34. button-enter {
  35. label = "Enter";
  36. linux,code = <KEY_ENTER>;
  37. press-threshold-microvolt = <500000>;
  38. };
  39. };