1// SPDX-License-Identifier: GPL-2.0-only
2/dts-v1/;
3
4#include "motorola-mapphone-common.dtsi"
5
6/ {
7	gpio_keys {
8		compatible = "gpio-keys";
9
10		volume_down {
11			label = "Volume Down";
12			gpios = <&gpio5 26 GPIO_ACTIVE_LOW>; /* gpio154 */
13			linux,code = <KEY_VOLUMEDOWN>;
14			linux,can-disable;
15			/* Value above 7.95ms for no GPIO hardware debounce */
16			debounce-interval = <10>;
17		};
18
19		/*
20		 * We use pad 0x4a100116 abe_dmic_din3.gpio_122 as the irq instead
21		 * of the gpio interrupt to avoid lost events in deeper idle states.
22		*/
23		slider {
24			label = "Keypad Slide";
25			interrupts-extended = <&omap4_pmx_core 0xd6>;
26			gpios = <&gpio4 26 GPIO_ACTIVE_HIGH>; /* gpio122 */
27			linux,input-type = <EV_SW>;
28			linux,code = <SW_KEYPAD_SLIDE>;
29			linux,can-disable;
30			/* Value above 7.95ms for no GPIO hardware debounce */
31			debounce-interval = <10>;
32		};
33	};
34};
35
36/ {
37	model = "Motorola Droid 4 XT894";
38	compatible = "motorola,droid4", "ti,omap4430", "ti,omap4";
39};
40
41&keypad {
42	keypad,num-rows = <8>;
43	keypad,num-columns = <8>;
44	linux,keymap = <
45
46	/* Row 1 */
47	MATRIX_KEY(0, 2, KEY_1)
48	MATRIX_KEY(0, 6, KEY_2)
49	MATRIX_KEY(2, 3, KEY_3)
50	MATRIX_KEY(0, 7, KEY_4)
51	MATRIX_KEY(0, 4, KEY_5)
52	MATRIX_KEY(5, 5, KEY_6)
53	MATRIX_KEY(0, 1, KEY_7)
54	MATRIX_KEY(0, 5, KEY_8)
55	MATRIX_KEY(0, 0, KEY_9)
56	MATRIX_KEY(1, 6, KEY_0)
57
58	/* Row 2 */
59	MATRIX_KEY(3, 4, KEY_APOSTROPHE)
60	MATRIX_KEY(7, 6, KEY_Q)
61	MATRIX_KEY(7, 7, KEY_W)
62	MATRIX_KEY(7, 2, KEY_E)
63	MATRIX_KEY(1, 0, KEY_R)
64	MATRIX_KEY(4, 4, KEY_T)
65	MATRIX_KEY(1, 2, KEY_Y)
66	MATRIX_KEY(6, 7, KEY_U)
67	MATRIX_KEY(2, 2, KEY_I)
68	MATRIX_KEY(5, 6, KEY_O)
69	MATRIX_KEY(3, 7, KEY_P)
70	MATRIX_KEY(6, 5, KEY_BACKSPACE)
71
72	/* Row 3 */
73	MATRIX_KEY(5, 4, KEY_TAB)
74	MATRIX_KEY(5, 7, KEY_A)
75	MATRIX_KEY(2, 7, KEY_S)
76	MATRIX_KEY(7, 0, KEY_D)
77	MATRIX_KEY(2, 6, KEY_F)
78	MATRIX_KEY(6, 2, KEY_G)
79	MATRIX_KEY(6, 6, KEY_H)
80	MATRIX_KEY(1, 4, KEY_J)
81	MATRIX_KEY(3, 1, KEY_K)
82	MATRIX_KEY(2, 1, KEY_L)
83	MATRIX_KEY(4, 6, KEY_ENTER)
84
85	/* Row 4 */
86	MATRIX_KEY(3, 6, KEY_LEFTSHIFT)		/* KEY_CAPSLOCK */
87	MATRIX_KEY(6, 1, KEY_Z)
88	MATRIX_KEY(7, 4, KEY_X)
89	MATRIX_KEY(5, 1, KEY_C)
90	MATRIX_KEY(1, 7, KEY_V)
91	MATRIX_KEY(2, 4, KEY_B)
92	MATRIX_KEY(4, 1, KEY_N)
93	MATRIX_KEY(1, 1, KEY_M)
94	MATRIX_KEY(3, 5, KEY_COMMA)
95	MATRIX_KEY(5, 2, KEY_DOT)
96	MATRIX_KEY(6, 3, KEY_UP)
97	MATRIX_KEY(7, 3, KEY_OK)
98
99	/* Row 5 */
100	MATRIX_KEY(2, 5, KEY_LEFTCTRL)		/* KEY_LEFTSHIFT */
101	MATRIX_KEY(4, 5, KEY_LEFTALT)		/* SYM */
102	MATRIX_KEY(6, 0, KEY_MINUS)
103	MATRIX_KEY(4, 7, KEY_EQUAL)
104	MATRIX_KEY(1, 5, KEY_SPACE)
105	MATRIX_KEY(3, 2, KEY_SLASH)
106	MATRIX_KEY(4, 3, KEY_LEFT)
107	MATRIX_KEY(5, 3, KEY_DOWN)
108	MATRIX_KEY(3, 3, KEY_RIGHT)
109
110	/* Side buttons, KEY_VOLUMEDOWN and KEY_PWER are on CPCAP? */
111	MATRIX_KEY(5, 0, KEY_VOLUMEUP)
112	>;
113};
114
115&i2c1 {
116	led-controller@38 {
117		compatible = "ti,lm3532";
118		#address-cells = <1>;
119		#size-cells = <0>;
120		reg = <0x38>;
121
122		enable-gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
123
124		ramp-up-us = <1024>;
125		ramp-down-us = <8193>;
126
127		backlight_led: led@0 {
128			reg = <0>;
129			led-sources = <2>;
130			ti,led-mode = <0>;
131			label = ":backlight";
132		};
133
134		led@1 {
135			reg = <1>;
136			led-sources = <1>;
137			ti,led-mode = <0>;
138			label = ":kbd_backlight";
139		};
140	};
141};
142
143&i2c4 {
144	lis3dh: accelerometer@18 {
145		compatible = "st,lis3dh-accel";
146		reg = <0x18>;
147
148		vdd-supply = <&vhvio>;
149
150		interrupt-parent = <&gpio2>;
151		interrupts = <2 IRQ_TYPE_EDGE_BOTH>; /* gpio34 */
152
153		rotation-matrix = "0", "-1", "0",
154				  "1", "0", "0",
155				  "0", "0", "1";
156	};
157};
158