1// SPDX-License-Identifier: GPL-2.0-only
2
3/dts-v1/;
4
5#include "msm8916-pm8916.dtsi"
6#include <dt-bindings/gpio/gpio.h>
7#include <dt-bindings/input/input.h>
8#include <dt-bindings/leds/common.h>
9
10/ {
11	model = "Alcatel OneTouch Idol 3 (4.7)";
12	compatible = "alcatel,idol347", "qcom,msm8916";
13	chassis-type = "handset";
14
15	aliases {
16		mmc0 = &sdhc_1; /* eMMC */
17		mmc1 = &sdhc_2; /* SD card */
18		serial0 = &blsp_uart2;
19	};
20
21	chosen {
22		stdout-path = "serial0";
23	};
24
25	gpio-keys {
26		compatible = "gpio-keys";
27
28		pinctrl-names = "default";
29		pinctrl-0 = <&gpio_keys_default>;
30
31		label = "GPIO Buttons";
32
33		button-volume-up {
34			label = "Volume Up";
35			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
36			linux,code = <KEY_VOLUMEUP>;
37		};
38	};
39
40	gpio-leds {
41		compatible = "gpio-leds";
42
43		pinctrl-names = "default";
44		pinctrl-0 = <&gpio_leds_default>;
45
46		led-0 {
47			gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
48			linux,default-trigger = "torch";
49			function = LED_FUNCTION_TORCH;
50		};
51	};
52
53	usb_id: usb-id {
54		compatible = "linux,extcon-usb-gpio";
55		id-gpios = <&tlmm 69 GPIO_ACTIVE_HIGH>;
56		pinctrl-names = "default";
57		pinctrl-0 = <&usb_id_default>;
58	};
59};
60
61&blsp_uart2 {
62	status = "okay";
63};
64
65&blsp_i2c4 {
66	status = "okay";
67
68	touchscreen@26 {
69		compatible = "mstar,msg2638";
70		reg = <0x26>;
71		interrupt-parent = <&tlmm>;
72		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
73		reset-gpios = <&tlmm 100 GPIO_ACTIVE_LOW>;
74		pinctrl-names = "default";
75		pinctrl-0 = <&ts_int_reset_default>;
76		vdd-supply = <&pm8916_l17>;
77		vddio-supply = <&pm8916_l5>;
78		touchscreen-size-x = <2048>;
79		touchscreen-size-y = <2048>;
80	};
81};
82
83&blsp_i2c5 {
84	status = "okay";
85
86	magnetometer@c {
87		compatible = "asahi-kasei,ak09911";
88		reg = <0x0c>;
89		vdd-supply = <&pm8916_l17>;
90		vid-supply = <&pm8916_l6>;
91		reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
92		pinctrl-names = "default";
93		pinctrl-0 = <&mag_reset_default>;
94		mount-matrix = "0", "1", "0",
95			       "-1", "0", "0",
96			       "0", "0", "1";
97	};
98
99	accelerometer@f {
100		compatible = "kionix,kxtj21009";
101		reg = <0x0f>;
102		vdd-supply = <&pm8916_l17>;
103		vddio-supply = <&pm8916_l6>;
104		interrupt-parent = <&tlmm>;
105		interrupts = <31 IRQ_TYPE_EDGE_RISING>;
106		pinctrl-names = "default";
107		pinctrl-0 = <&accel_int_default>;
108		mount-matrix = "-1", "0", "0",
109			       "0", "1", "0",
110			       "0", "0", "-1";
111	};
112
113	proximity@48 {
114		compatible = "sensortek,stk3310";
115		reg = <0x48>;
116		interrupt-parent = <&tlmm>;
117		interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
118		pinctrl-names = "default";
119		pinctrl-0 = <&proximity_int_default>;
120	};
121
122	gyroscope@68 {
123		compatible = "bosch,bmg160";
124		reg = <0x68>;
125		vdd-supply = <&pm8916_l17>;
126		vddio-supply = <&pm8916_l6>;
127		interrupt-parent = <&tlmm>;
128		interrupts = <97 IRQ_TYPE_EDGE_RISING>,
129			     <98 IRQ_TYPE_EDGE_RISING>;
130		pinctrl-names = "default";
131		pinctrl-0 = <&gyro_int_default>;
132	};
133};
134
135&blsp_i2c6 {
136	status = "okay";
137
138	led-controller@68 {
139		compatible = "si-en,sn3190";
140		reg = <0x68>;
141		shutdown-gpios = <&tlmm 89 GPIO_ACTIVE_HIGH>;
142		pinctrl-names = "default";
143		pinctrl-0 = <&led_enable_default &led_shutdown_default>;
144		#address-cells = <1>;
145		#size-cells = <0>;
146
147		led@1 {
148			reg = <1>;
149			led-max-microamp = <5000>;
150			function = LED_FUNCTION_INDICATOR;
151			color = <LED_COLOR_ID_WHITE>;
152		};
153	};
154};
155
156&pm8916_resin {
157	status = "okay";
158	linux,code = <KEY_VOLUMEDOWN>;
159};
160
161&pm8916_rpm_regulators {
162	pm8916_l17: l17 {
163		regulator-min-microvolt = <2850000>;
164		regulator-max-microvolt = <2850000>;
165	};
166};
167
168&pm8916_vib {
169	status = "okay";
170};
171
172&sdhc_1 {
173	status = "okay";
174};
175
176&sdhc_2 {
177	status = "okay";
178
179	pinctrl-names = "default", "sleep";
180	pinctrl-0 = <&sdc2_default &sdc2_cd_default>;
181	pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>;
182
183	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
184};
185
186&usb {
187	status = "okay";
188	extcon = <&usb_id>, <&usb_id>;
189};
190
191&usb_hs_phy {
192	extcon = <&usb_id>;
193};
194
195&wcnss {
196	status = "okay";
197};
198
199&wcnss_iris {
200	compatible = "qcom,wcn3620";
201};
202
203&tlmm {
204	accel_int_default: accel-int-default-state {
205		pins = "gpio31";
206		function = "gpio";
207
208		drive-strength = <2>;
209		bias-disable;
210	};
211
212	gpio_keys_default: gpio-keys-default-state {
213		pins = "gpio107";
214		function = "gpio";
215
216		drive-strength = <2>;
217		bias-pull-up;
218	};
219
220	gpio_leds_default: gpio-leds-default-state {
221		pins = "gpio32";
222		function = "gpio";
223
224		drive-strength = <2>;
225		bias-disable;
226	};
227
228	gyro_int_default: gyro-int-default-state {
229		pins = "gpio97", "gpio98";
230		function = "gpio";
231
232		drive-strength = <2>;
233		bias-disable;
234	};
235
236	/*
237	 * The OEM wired an additional GPIO to be asserted so that
238	 * the si-en,sn3190 LED IC works. Since this GPIO is not
239	 * part of the IC datasheet nor supported by the driver,
240	 * force it asserted here.
241	 */
242	led_enable_default: led-enable-default-state {
243		pins = "gpio102";
244		function = "gpio";
245
246		drive-strength = <2>;
247		bias-disable;
248		output-high;
249	};
250
251	led_shutdown_default: led-shutdown-default-state {
252		pins = "gpio89";
253		function = "gpio";
254
255		drive-strength = <2>;
256		bias-disable;
257	};
258
259	mag_reset_default: mag-reset-default-state {
260		pins = "gpio8";
261		function = "gpio";
262
263		drive-strength = <2>;
264		bias-disable;
265	};
266
267	proximity_int_default: proximity-int-default-state {
268		pins = "gpio12";
269		function = "gpio";
270
271		drive-strength = <6>;
272		bias-pull-up;
273	};
274
275	sdc2_cd_default: sdc2-cd-default-state {
276		pins = "gpio38";
277		function = "gpio";
278		drive-strength = <2>;
279		bias-disable;
280	};
281
282	ts_int_reset_default: ts-int-reset-default-state {
283		pins = "gpio13", "gpio100";
284		function = "gpio";
285
286		drive-strength = <2>;
287		bias-disable;
288	};
289
290	usb_id_default: usb-id-default-state {
291		pins = "gpio69";
292		function = "gpio";
293
294		drive-strength = <8>;
295		bias-pull-up;
296	};
297};
298