#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include "sun8i-h3-orangepi-pc.dts"

/ {
	model = "Xunlong Orange Pi PC Sapomat";

	sapomat_gpio_keys {
		compatible = "gpio-keys-polled";
		poll-interval = <50>;
		pinctrl-names = "default";
		pinctrl-0 = <&sapomat_btn_pins>;

		red_btn {
			label = "Red Button";
			linux,code = <BTN_4>;
			gpios = <&pio 2 4 GPIO_ACTIVE_LOW>; /* PC4 */
		};

		green_btn {
			label = "Green Button";
			linux,code = <BTN_5>;
			gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */
		};
	};
};

&pio {
	sapomat_btn_pins: btn_pins@0 {
		pins = "PC4", "PC7";
		function = "gpio_in";
		bias-pull-up;
	};
};
