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	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
139	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
140	pinctrl-names = "default", "sleep";
141
142	status = "okay";
143};
144
145&sdhc_2 {
146	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
147	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
148	pinctrl-names = "default", "sleep";
149
150	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
151
152	status = "okay";
153};
154
155&usb {
156	dr_mode = "peripheral";
157	extcon = <&pm8916_usbin>;
158
159	status = "okay";
160};
161
162&usb_hs_phy {
163	extcon = <&pm8916_usbin>;
164};
165
166&wcnss {
167	status = "okay";
168};
169
170&wcnss_iris {
171	compatible = "qcom,wcn3660b";
172};
173
174&tlmm {
175	accel_int_default: accel-int-default-state {
176		pins = "gpio115";
177		function = "gpio";
178		drive-strength = <2>;
179		bias-disable;
180	};
181
182	fuelgauge_int_default: fuelgauge-int-default-state {
183		pins = "gpio121";
184		function = "gpio";
185		drive-strength = <2>;
186		bias-disable;
187	};
188
189	gpio_keys_default: gpio-keys-default-state {
190		pins = "gpio107", "gpio109";
191		function = "gpio";
192		drive-strength = <2>;
193		bias-pull-up;
194	};
195
196	gpio_hall_sensor_default: gpio-hall-sensor-default-state {
197		pins = "gpio52";
198		function = "gpio";
199		drive-strength = <2>;
200		bias-disable;
201	};
202};
203