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/interrupt-controller/irq.h>
9
10/ {
11	aliases {
12		mmc0 = &sdhc_1; /* eMMC */
13		mmc1 = &sdhc_2; /* SD card */
14		serial0 = &blsp_uart2;
15	};
16
17	chosen {
18		stdout-path = "serial0";
19	};
20
21	reserved-memory {
22		/* Additional memory used by Samsung firmware modifications */
23		tz-apps@85500000 {
24			reg = <0x0 0x85500000 0x0 0xb00000>;
25			no-map;
26		};
27	};
28
29	gpio-keys {
30		compatible = "gpio-keys";
31
32		pinctrl-0 = <&gpio_keys_default>;
33		pinctrl-names = "default";
34
35		label = "GPIO Buttons";
36
37		volume-up-button {
38			label = "Volume Up";
39			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
40			linux,code = <KEY_VOLUMEUP>;
41		};
42
43		home-button {
44			label = "Home";
45			gpios = <&tlmm 109 GPIO_ACTIVE_LOW>;
46			linux,code = <KEY_HOMEPAGE>;
47		};
48	};
49
50	gpio-hall-sensor {
51		compatible = "gpio-keys";
52
53		pinctrl-0 = <&gpio_hall_sensor_default>;
54		pinctrl-names = "default";
55
56		label = "GPIO Hall Effect Sensor";
57
58		hall-sensor-switch {
59			label = "Hall Effect Sensor";
60			gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
61			linux,input-type = <EV_SW>;
62			linux,code = <SW_LID>;
63			linux,can-disable;
64		};
65	};
66};
67
68&blsp_i2c4 {
69	status = "okay";
70
71	fuelgauge@36 {
72		compatible = "maxim,max77849-battery";
73		reg = <0x36>;
74
75		maxim,rsns-microohm = <10000>;
76		maxim,over-heat-temp = <600>;
77		maxim,over-volt = <4400>;
78
79		interrupt-parent = <&tlmm>;
80		interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
81
82		pinctrl-0 = <&fuelgauge_int_default>;
83		pinctrl-names = "default";
84	};
85};
86
87&blsp_i2c2 {
88	status = "okay";
89
90	light-sensor@10 {
91		compatible = "capella,cm3323";
92		reg = <0x10>;
93	};
94
95	accelerometer@1d {
96		compatible = "st,lis2hh12";
97		reg = <0x1d>;
98
99		vdd-supply = <&pm8916_l17>;
100		vddio-supply = <&pm8916_l5>;
101
102		interrupt-parent = <&tlmm>;
103		interrupts = <115 IRQ_TYPE_LEVEL_HIGH>;
104		interrupt-names = "INT1";
105
106		st,drdy-int-pin = <1>;
107		mount-matrix = "0", "1", "0",
108			      "-1", "0", "0",
109			       "0", "0", "1";
110
111		pinctrl-0 = <&accel_int_default>;
112		pinctrl-names = "default";
113	};
114};
115
116&blsp_uart2 {
117	status = "okay";
118};
119
120&pm8916_resin {
121	linux,code = <KEY_VOLUMEDOWN>;
122	status = "okay";
123};
124
125&pm8916_rpm_regulators {
126	pm8916_l17: l17 {
127		regulator-min-microvolt = <2850000>;
128		regulator-max-microvolt = <2850000>;
129	};
130};
131
132/* FIXME: Replace with MAX77849 MUIC when driver is available */
133&pm8916_usbin {
134	status = "okay";
135};
136
137&sdhc_1 {
138	status = "okay";
139};
140
141&sdhc_2 {
142	pinctrl-0 = <&sdc2_default &sdc2_cd_default>;
143	pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>;
144	pinctrl-names = "default", "sleep";
145
146	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
147
148	status = "okay";
149};
150
151&usb {
152	dr_mode = "peripheral";
153	extcon = <&pm8916_usbin>;
154
155	status = "okay";
156};
157
158&usb_hs_phy {
159	extcon = <&pm8916_usbin>;
160};
161
162&wcnss {
163	status = "okay";
164};
165
166&wcnss_iris {
167	compatible = "qcom,wcn3660b";
168};
169
170&tlmm {
171	accel_int_default: accel-int-default-state {
172		pins = "gpio115";
173		function = "gpio";
174		drive-strength = <2>;
175		bias-disable;
176	};
177
178	fuelgauge_int_default: fuelgauge-int-default-state {
179		pins = "gpio121";
180		function = "gpio";
181		drive-strength = <2>;
182		bias-disable;
183	};
184
185	gpio_keys_default: gpio-keys-default-state {
186		pins = "gpio107", "gpio109";
187		function = "gpio";
188		drive-strength = <2>;
189		bias-pull-up;
190	};
191
192	gpio_hall_sensor_default: gpio-hall-sensor-default-state {
193		pins = "gpio52";
194		function = "gpio";
195		drive-strength = <2>;
196		bias-disable;
197	};
198
199	sdc2_cd_default: sdc2-cd-default-state {
200		pins = "gpio38";
201		function = "gpio";
202		drive-strength = <2>;
203		bias-disable;
204	};
205};
206