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