Home | History | Annotate | Line # | Download | only in qcom
      1 // SPDX-License-Identifier: GPL-2.0-only
      2 
      3 #include "msm8916-pm8916.dtsi"
      4 #include <dt-bindings/gpio/gpio.h>
      5 #include <dt-bindings/input/input.h>
      6 #include <dt-bindings/interrupt-controller/irq.h>
      7 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
      8 
      9 / {
     10 	aliases {
     11 		serial0 = &blsp1_uart2;
     12 	};
     13 
     14 	chosen {
     15 		stdout-path = "serial0";
     16 	};
     17 
     18 	reserved-memory {
     19 		/* Additional memory used by Samsung firmware modifications */
     20 		tz-apps@85500000 {
     21 			reg = <0x0 0x85500000 0x0 0xb00000>;
     22 			no-map;
     23 		};
     24 	};
     25 
     26 	gpio-keys {
     27 		compatible = "gpio-keys";
     28 
     29 		pinctrl-names = "default";
     30 		pinctrl-0 = <&gpio_keys_default>;
     31 
     32 		label = "GPIO Buttons";
     33 
     34 		volume-up {
     35 			label = "Volume Up";
     36 			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
     37 			linux,code = <KEY_VOLUMEUP>;
     38 		};
     39 
     40 		home {
     41 			label = "Home";
     42 			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
     43 			linux,code = <KEY_HOMEPAGE>;
     44 		};
     45 	};
     46 
     47 	gpio-hall-sensor {
     48 		compatible = "gpio-keys";
     49 
     50 		pinctrl-names = "default";
     51 		pinctrl-0 = <&gpio_hall_sensor_default>;
     52 
     53 		label = "GPIO Hall Effect Sensor";
     54 
     55 		hall-sensor {
     56 			label = "Hall Effect Sensor";
     57 			gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
     58 			linux,input-type = <EV_SW>;
     59 			linux,code = <SW_LID>;
     60 			linux,can-disable;
     61 		};
     62 	};
     63 
     64 	reg_vdd_tsp: regulator-vdd-tsp {
     65 		compatible = "regulator-fixed";
     66 		regulator-name = "vdd_tsp";
     67 		regulator-min-microvolt = <3300000>;
     68 		regulator-max-microvolt = <3300000>;
     69 
     70 		gpio = <&msmgpio 73 GPIO_ACTIVE_HIGH>;
     71 		enable-active-high;
     72 
     73 		pinctrl-names = "default";
     74 		pinctrl-0 = <&tsp_en_default>;
     75 	};
     76 
     77 	i2c-muic {
     78 		compatible = "i2c-gpio";
     79 		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
     80 		scl-gpios = <&msmgpio 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
     81 
     82 		pinctrl-names = "default";
     83 		pinctrl-0 = <&muic_i2c_default>;
     84 
     85 		#address-cells = <1>;
     86 		#size-cells = <0>;
     87 
     88 		muic: extcon@25 {
     89 			compatible = "siliconmitus,sm5502-muic";
     90 
     91 			reg = <0x25>;
     92 			interrupt-parent = <&msmgpio>;
     93 			interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
     94 
     95 			pinctrl-names = "default";
     96 			pinctrl-0 = <&muic_int_default>;
     97 		};
     98 	};
     99 
    100 	i2c-tkey {
    101 		compatible = "i2c-gpio";
    102 		sda-gpios = <&msmgpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
    103 		scl-gpios = <&msmgpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
    104 
    105 		pinctrl-names = "default";
    106 		pinctrl-0 = <&tkey_i2c_default>;
    107 
    108 		#address-cells = <1>;
    109 		#size-cells = <0>;
    110 
    111 		touchkey: touchkey@20 {
    112 			/* Note: Actually an ABOV MCU that implements same interface */
    113 			compatible = "coreriver,tc360-touchkey";
    114 			reg = <0x20>;
    115 
    116 			interrupt-parent = <&msmgpio>;
    117 			interrupts = <98 IRQ_TYPE_EDGE_FALLING>;
    118 
    119 			/* vcc/vdd-supply are board-specific */
    120 			vddio-supply = <&pm8916_l6>;
    121 
    122 			linux,keycodes = <KEY_APPSELECT KEY_BACK>;
    123 
    124 			pinctrl-names = "default";
    125 			pinctrl-0 = <&tkey_default>;
    126 		};
    127 	};
    128 
    129 	i2c-nfc {
    130 		compatible = "i2c-gpio";
    131 		sda-gpios = <&msmgpio 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
    132 		scl-gpios = <&msmgpio 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
    133 
    134 		pinctrl-names = "default";
    135 		pinctrl-0 = <&nfc_i2c_default>;
    136 
    137 		#address-cells = <1>;
    138 		#size-cells = <0>;
    139 
    140 		nfc@27 {
    141 			compatible = "samsung,s3fwrn5-i2c";
    142 			reg = <0x27>;
    143 
    144 			interrupt-parent = <&msmgpio>;
    145 			interrupts = <21 IRQ_TYPE_EDGE_RISING>;
    146 
    147 			en-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>;
    148 			wake-gpios = <&msmgpio 49 GPIO_ACTIVE_HIGH>;
    149 
    150 			clocks = <&rpmcc RPM_SMD_BB_CLK2_PIN>;
    151 
    152 			pinctrl-names = "default";
    153 			pinctrl-0 = <&nfc_default &nfc_clk_req>;
    154 		};
    155 	};
    156 };
    157 
    158 &blsp_i2c2 {
    159 	status = "okay";
    160 
    161 	accelerometer: accelerometer@10 {
    162 		compatible = "bosch,bmc150_accel";
    163 		reg = <0x10>;
    164 		interrupt-parent = <&msmgpio>;
    165 		interrupts = <115 IRQ_TYPE_EDGE_RISING>;
    166 
    167 		vdd-supply = <&pm8916_l17>;
    168 		vddio-supply = <&pm8916_l5>;
    169 
    170 		pinctrl-names = "default";
    171 		pinctrl-0 = <&accel_int_default>;
    172 	};
    173 
    174 	magnetometer@12 {
    175 		compatible = "bosch,bmc150_magn";
    176 		reg = <0x12>;
    177 
    178 		vdd-supply = <&pm8916_l17>;
    179 		vddio-supply = <&pm8916_l5>;
    180 	};
    181 };
    182 
    183 &blsp_i2c4 {
    184 	status = "okay";
    185 
    186 	battery@35 {
    187 		compatible = "richtek,rt5033-battery";
    188 		reg = <0x35>;
    189 		interrupt-parent = <&msmgpio>;
    190 		interrupts = <121 IRQ_TYPE_EDGE_BOTH>;
    191 
    192 		pinctrl-names = "default";
    193 		pinctrl-0 = <&fg_alert_default>;
    194 	};
    195 };
    196 
    197 &blsp1_uart2 {
    198 	status = "okay";
    199 };
    200 
    201 &dsi0 {
    202 	pinctrl-names = "default", "sleep";
    203 	pinctrl-0 = <&mdss_default>;
    204 	pinctrl-1 = <&mdss_sleep>;
    205 };
    206 
    207 &mdss {
    208 	status = "okay";
    209 };
    210 
    211 &pm8916_resin {
    212 	status = "okay";
    213 	linux,code = <KEY_VOLUMEDOWN>;
    214 };
    215 
    216 &pronto {
    217 	status = "okay";
    218 };
    219 
    220 &sdhc_1 {
    221 	status = "okay";
    222 
    223 	pinctrl-names = "default", "sleep";
    224 	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
    225 	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
    226 };
    227 
    228 &sdhc_2 {
    229 	status = "okay";
    230 
    231 	pinctrl-names = "default", "sleep";
    232 	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
    233 	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
    234 
    235 	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
    236 };
    237 
    238 &usb {
    239 	status = "okay";
    240 	extcon = <&muic>, <&muic>;
    241 };
    242 
    243 &usb_hs_phy {
    244 	extcon = <&muic>;
    245 };
    246 
    247 &smd_rpm_regulators {
    248 	vdd_l1_l2_l3-supply = <&pm8916_s3>;
    249 	vdd_l4_l5_l6-supply = <&pm8916_s4>;
    250 	vdd_l7-supply = <&pm8916_s4>;
    251 
    252 	s3 {
    253 		regulator-min-microvolt = <1200000>;
    254 		regulator-max-microvolt = <1300000>;
    255 	};
    256 
    257 	s4 {
    258 		regulator-min-microvolt = <1800000>;
    259 		regulator-max-microvolt = <2100000>;
    260 	};
    261 
    262 	l1 {
    263 		regulator-min-microvolt = <1225000>;
    264 		regulator-max-microvolt = <1225000>;
    265 	};
    266 
    267 	l2 {
    268 		regulator-min-microvolt = <1200000>;
    269 		regulator-max-microvolt = <1200000>;
    270 	};
    271 
    272 	l4 {
    273 		regulator-min-microvolt = <2050000>;
    274 		regulator-max-microvolt = <2050000>;
    275 	};
    276 
    277 	l5 {
    278 		regulator-min-microvolt = <1800000>;
    279 		regulator-max-microvolt = <1800000>;
    280 	};
    281 
    282 	l6 {
    283 		regulator-min-microvolt = <1800000>;
    284 		regulator-max-microvolt = <1800000>;
    285 	};
    286 
    287 	l7 {
    288 		regulator-min-microvolt = <1800000>;
    289 		regulator-max-microvolt = <1800000>;
    290 	};
    291 
    292 	l8 {
    293 		regulator-min-microvolt = <2850000>;
    294 		regulator-max-microvolt = <2900000>;
    295 	};
    296 
    297 	l9 {
    298 		regulator-min-microvolt = <3300000>;
    299 		regulator-max-microvolt = <3300000>;
    300 	};
    301 
    302 	l10 {
    303 		regulator-min-microvolt = <2700000>;
    304 		regulator-max-microvolt = <2800000>;
    305 	};
    306 
    307 	l11 {
    308 		regulator-min-microvolt = <1800000>;
    309 		regulator-max-microvolt = <2950000>;
    310 		regulator-allow-set-load;
    311 		regulator-system-load = <200000>;
    312 	};
    313 
    314 	l12 {
    315 		regulator-min-microvolt = <1800000>;
    316 		regulator-max-microvolt = <2950000>;
    317 	};
    318 
    319 	l13 {
    320 		regulator-min-microvolt = <3075000>;
    321 		regulator-max-microvolt = <3075000>;
    322 	};
    323 
    324 	l14 {
    325 		regulator-min-microvolt = <1800000>;
    326 		regulator-max-microvolt = <3300000>;
    327 	};
    328 
    329 	l15 {
    330 		regulator-min-microvolt = <1800000>;
    331 		regulator-max-microvolt = <3300000>;
    332 	};
    333 
    334 	l16 {
    335 		regulator-min-microvolt = <1800000>;
    336 		regulator-max-microvolt = <3300000>;
    337 	};
    338 
    339 	l17 {
    340 		regulator-min-microvolt = <2850000>;
    341 		regulator-max-microvolt = <2850000>;
    342 	};
    343 
    344 	l18 {
    345 		regulator-min-microvolt = <2700000>;
    346 		regulator-max-microvolt = <2700000>;
    347 	};
    348 };
    349 
    350 &msmgpio {
    351 	accel_int_default: accel-int-default {
    352 		pins = "gpio115";
    353 		function = "gpio";
    354 
    355 		drive-strength = <2>;
    356 		bias-disable;
    357 	};
    358 
    359 	fg_alert_default: fg-alert-default {
    360 		pins = "gpio121";
    361 		function = "gpio";
    362 
    363 		drive-strength = <2>;
    364 		bias-disable;
    365 	};
    366 
    367 	gpio_keys_default: gpio-keys-default {
    368 		pins = "gpio107", "gpio109";
    369 		function = "gpio";
    370 
    371 		drive-strength = <2>;
    372 		bias-pull-up;
    373 	};
    374 
    375 	gpio_hall_sensor_default: gpio-hall-sensor-default {
    376 		pins = "gpio52";
    377 		function = "gpio";
    378 
    379 		drive-strength = <2>;
    380 		bias-disable;
    381 	};
    382 
    383 	mdss {
    384 		mdss_default: mdss-default {
    385 			pins = "gpio25";
    386 			function = "gpio";
    387 
    388 			drive-strength = <8>;
    389 			bias-disable;
    390 		};
    391 		mdss_sleep: mdss-sleep {
    392 			pins = "gpio25";
    393 			function = "gpio";
    394 
    395 			drive-strength = <2>;
    396 			bias-pull-down;
    397 		};
    398 	};
    399 
    400 	muic_i2c_default: muic-i2c-default {
    401 		pins = "gpio105", "gpio106";
    402 		function = "gpio";
    403 
    404 		drive-strength = <2>;
    405 		bias-disable;
    406 	};
    407 
    408 	muic_int_default: muic-int-default {
    409 		pins = "gpio12";
    410 		function = "gpio";
    411 
    412 		drive-strength = <2>;
    413 		bias-disable;
    414 	};
    415 
    416 	nfc_default: nfc-default {
    417 		pins = "gpio20", "gpio49";
    418 		function = "gpio";
    419 
    420 		drive-strength = <2>;
    421 		bias-disable;
    422 
    423 		irq {
    424 			pins = "gpio21";
    425 			function = "gpio";
    426 
    427 			drive-strength = <2>;
    428 			bias-pull-down;
    429 		};
    430 	};
    431 
    432 	nfc_i2c_default: nfc-i2c-default {
    433 		pins = "gpio0", "gpio1";
    434 		function = "gpio";
    435 
    436 		drive-strength = <2>;
    437 		bias-disable;
    438 	};
    439 
    440 	tkey_default: tkey-default {
    441 		pins = "gpio98";
    442 		function = "gpio";
    443 
    444 		drive-strength = <2>;
    445 		bias-disable;
    446 	};
    447 
    448 	tkey_i2c_default: tkey-i2c-default {
    449 		pins = "gpio16", "gpio17";
    450 		function = "gpio";
    451 
    452 		drive-strength = <2>;
    453 		bias-disable;
    454 	};
    455 
    456 	tsp_en_default: tsp-en-default {
    457 		pins = "gpio73";
    458 		function = "gpio";
    459 
    460 		drive-strength = <2>;
    461 		bias-disable;
    462 	};
    463 };
    464 
    465 &pm8916_gpios {
    466 	nfc_clk_req: nfc-clk-req {
    467 		pins = "gpio2";
    468 		function = "func1";
    469 
    470 		input-enable;
    471 		bias-disable;
    472 		power-source = <PM8916_GPIO_L2>;
    473 	};
    474 };
    475