/dts-v1/; /plugin/; #include #include #include / { compatible = "ti,beaglebone", "ti,beaglebone-black"; /* identification */ part-number = "gpio-keypad-ao2"; version = "00A0"; // resources this cape uses exclusive-use = "P8.07", "P8.08", "P8.09", "P8.10", "P8.26", "P9.15"; fragment@0 { target = <&am33xx_pinmux>; __overlay__ { keypad_pins: pinmux_gpio_pins{ pinctrl-single,pins = < BONE_P8_07 (PIN_INPUT_PULLUP | MUX_MODE7) BONE_P8_08 (PIN_INPUT_PULLUP | MUX_MODE7) BONE_P8_09 (PIN_INPUT_PULLUP | MUX_MODE7) BONE_P8_10 (PIN_INPUT_PULLUP | MUX_MODE7) BONE_P8_26 (PIN_INPUT_PULLUP | MUX_MODE7) BONE_P9_15 (PIN_INPUT_PULLUP | MUX_MODE7) >; }; }; }; fragment@1 { target-path = "/"; __overlay__ { gpio_keys { compatible = "gpio-keys"; autorepeat; pinctrl-names = "default"; pinctrl-0 = <&keypad_pins>; up { label = "GPIO Key UP"; linux,code = <103>; gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; debounce_interval = <50>; }; left { label = "GPIO Key LEFT"; linux,code = <105>; gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; debounce_interval = <50>; }; right { label = "GPIO Key RIGHT"; linux,code = <106>; gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; debounce_interval = <50>; }; down { label = "GPIO Key DOWN"; linux,code = <108>; gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; debounce_interval = <50>; }; enter { label = "GPIO Key ENTER"; linux,code = <28>; gpios = <&gpio1 29 GPIO_ACTIVE_LOW>; debounce_interval = <50>; }; esc { label = "GPIO Key ESC"; linux,code = <1>; gpios = <&gpio1 16 GPIO_ACTIVE_LOW>; debounce_interval = <50>; }; }; }; }; };