GPIO leds class (outputs) but which class is for inputs?

Hi all,
Linux kernel 5.x.x leds class and device tree node.
I have an GPIO output that controls a relay. The output is put in the device tree as a ‘leds’ node.
Snippet from my device tree.

  led1 {
    label = "board:none:relay0";
    gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
    default-state = "off";
  };

  user_leds_s0: user_leds_s0 {
    pinctrl-single,pins = <
    AM33XX_IOPAD(0x85c, PIN_OUTPUT_PULLUP | MUX_MODE7) /* (T15) gpmc_a7.gpio1[23] relay0 */
    >;
  };

  gpio1_pins_default: pinmux_gpio1_pins {
    pinctrl-single,pins = <
      AM33XX_IOPAD(0x830, PIN_INPUT_PULLUP | MUX_MODE7)  /* (T12) gpmc_ad12.gpio1[12] button0 */
    >;
  };

I have a pinmux for the relay0 (output) and button0 (input).
I can control the relay thru the command line,
echo “1” > /sys/class/leds/board:none:relay0/brightness
My app can control the output using /dev/mem and mmap (I know that mmap() is not recommended).

The push button will also be read using mmap().

If ‘leds’ are outputs then what class/device tree node is inputs?
Can you provide example of an ‘inputs’ node in the device tree?
How to check the state of the ‘input’ class from the command line?

Thank you,

gpio-key:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/input/gpio-keys.yaml

Regards,

The kernel CONFIG_LEDS_CLASS option enables the LED sysfs class in /sys/class/leds.

Is there a kernel setting to allow gpio-keys to show up is sysfs?
After adding gpio-keys to the device tree, what directory/folder do gpio-keys show up in?

Thank you,

KEYBOARD_GPIO

There is a good writeup for this.

http://www.armadeus.org/wiki/index.php?title=GPIO_keys

Regards,

For setting the active_low (or active_low) of an input in the configuration register (bit 0).
Is or-ing GPIO_ACTIVE_LOW allowed in the device tree?

  gpio1_pins_default: pinmux_gpio1_pins {
    pinctrl-single,pins = <
      AM33XX_IOPAD(0x830, PIN_INPUT_PULLUP | GPIO_ACTIVE_LOW | MUX_MODE7)  /* (T12) gpmc_ad12.gpio1[12] button0 */
    >;
  };

Thank you,

No, you set GPIO_ACTIVE_LOW in gpio_keys node:

Regards,