Skip to content

Instantly share code, notes, and snippets.

@pklazy
Last active August 8, 2018 15:54
Show Gist options
  • Save pklazy/7543a9af16d1062c08019ce1504abc07 to your computer and use it in GitHub Desktop.
Save pklazy/7543a9af16d1062c08019ce1504abc07 to your computer and use it in GitHub Desktop.
/dts-v1/;
/plugin/;
#include <dt-bindings/input/input.h>
/{
compatible = "brcm,bcm2708";
fragment@0 {
target = <&i2c1>;
__overlay__{
#address-cells = <1>;
#size-cells = <0>;
tca8418@34 {
compatible = "ti,tca8418";
reg = <0x34>;
interrupt-parent = <&gpio>;
interrupts = <4 2>;
keypad,num-rows = <8>;
keypad,num-columns = <8>;
linux,keymap = <
MATRIX_KEY(0, 0, KEY_2)
MATRIX_KEY(0, 1, KEY_Q)
MATRIX_KEY(0, 2, KEY_W)
MATRIX_KEY(0, 3, KEY_S)
MATRIX_KEY(0, 4, KEY_A)
MATRIX_KEY(0, 5, KEY_Z)
MATRIX_KEY(0, 6, KEY_X)
MATRIX_KEY(0, 7, KEY_C)
MATRIX_KEY(1, 0, KEY_3)
MATRIX_KEY(1, 1, KEY_4)
MATRIX_KEY(1, 2, KEY_R)
MATRIX_KEY(1, 3, KEY_E)
MATRIX_KEY(1, 4, KEY_D)
MATRIX_KEY(1, 5, KEY_F)
MATRIX_KEY(1, 6, KEY_V)
MATRIX_KEY(1, 7, KEY_B)
MATRIX_KEY(2, 0, KEY_5)
MATRIX_KEY(2, 1, KEY_6)
MATRIX_KEY(2, 2, KEY_Y)
MATRIX_KEY(2, 3, KEY_T)
MATRIX_KEY(2, 4, KEY_G)
MATRIX_KEY(2, 5, KEY_H)
MATRIX_KEY(2, 6, KEY_N)
MATRIX_KEY(3, 0, KEY_1)
MATRIX_KEY(3, 1, KEY_ESC)
MATRIX_KEY(3, 2, KEY_TAB)
MATRIX_KEY(3, 3, KEY_LEFTCTRL)
MATRIX_KEY(3, 4, KEY_LEFTSHIFT)
MATRIX_KEY(3, 5, KEY_LEFTALT)
MATRIX_KEY(3, 6, KEY_LEFTMETA)
MATRIX_KEY(3, 7, KEY_SPACE)
MATRIX_KEY(4, 0, KEY_7)
MATRIX_KEY(4, 1, KEY_8)
MATRIX_KEY(4, 2, KEY_U)
MATRIX_KEY(4, 3, KEY_I)
MATRIX_KEY(4, 4, KEY_K)
MATRIX_KEY(4, 5, KEY_J)
MATRIX_KEY(4, 6, KEY_M)
MATRIX_KEY(5, 0, KEY_BACKSLASH)
MATRIX_KEY(5, 1, KEY_GRAVE)
MATRIX_KEY(5, 2, KEY_BACKSPACE)
MATRIX_KEY(5, 3, KEY_ENTER)
MATRIX_KEY(5, 4, KEY_FN)
MATRIX_KEY(5, 5, KEY_RIGHTSHIFT)
MATRIX_KEY(5, 6, KEY_RIGHTALT)
MATRIX_KEY(5, 7, KEY_RIGHTMETA)
MATRIX_KEY(6, 0, KEY_9)
MATRIX_KEY(6, 1, KEY_0)
MATRIX_KEY(6, 2, KEY_O)
MATRIX_KEY(6, 3, KEY_P)
MATRIX_KEY(6, 4, KEY_SEMICOLON)
MATRIX_KEY(6, 5, KEY_L)
MATRIX_KEY(6, 6, KEY_COMMA)
MATRIX_KEY(7, 0, KEY_MINUS)
MATRIX_KEY(7, 1, KEY_EQUAL)
MATRIX_KEY(7, 2, KEY_LEFTBRACE)
MATRIX_KEY(7, 3, KEY_RIGHTBRACE)
MATRIX_KEY(7, 4, KEY_APOSTROPHE)
MATRIX_KEY(7, 5, KEY_SLASH)
MATRIX_KEY(7, 6, KEY_DOT)
>;
};
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment