Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1d9c5ae authored by Kiran Gunda's avatar Kiran Gunda
Browse files

ARM: dts: msm: Add device nodes for pm640 and pm640l



Add the device nodes such as PON, GPIOs, MISC, LCDB,
WLED and other PMIC infra and IO modules for pm640 and pm640l.

Change-Id: I1902efa518b25abc9d559abda65270cac47674ef
Signed-off-by: default avatarKiran Gunda <kgunda@codeaurora.org>
parent 34d61ef0
Loading
Loading
Loading
Loading
+110 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <dt-bindings/input/input.h>
#include <dt-bindings/input/qcom,qpnp-power-on.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

&spmi_bus {
	qcom,pm640@0 {
		compatible = "qcom,spmi-pmic";
		reg = <0x0 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <1>;

		pm640_revid: qcom,revid@100 {
			compatible = "qcom,qpnp-revid";
			reg = <0x100 0x100>;
		};

		qcom,power-on@800 {
			compatible = "qcom,qpnp-power-on";
			reg = <0x800 0x100>;
			interrupts = <0x0 0x8 0x0 IRQ_TYPE_NONE>,
				     <0x0 0x8 0x1 IRQ_TYPE_NONE>;
			interrupt-names = "kpdpwr", "resin";
			qcom,pon-dbc-delay = <15625>;
			qcom,kpdpwr-sw-debounce;
			qcom,system-reset;
			qcom,store-hard-reset-reason;

			qcom,pon_1 {
				qcom,pon-type = <PON_POWER_ON_TYPE_KPDPWR>;
				qcom,pull-up = <1>;
				linux,code = <KEY_POWER>;
			};

			qcom,pon_2 {
				qcom,pon-type = <PON_POWER_ON_TYPE_RESIN>;
				qcom,pull-up = <1>;
				linux,code = <KEY_VOLUMEDOWN>;
			};
		};

		pm640_misc: qcom,misc@900 {
			compatible = "qcom,qpnp-misc";
			reg = <0x900 0x100>;
		};

		pm640_tz: qcom,temp-alarm@2400 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0x2400 0x100>;
			interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
			#thermal-sensor-cells = <0>;
			qcom,temperature-threshold-set = <1>;
		};

		pm640_clkdiv: clock-controller@5b00 {
			compatible = "qcom,spmi-clkdiv";
			reg = <0x5b00 0x100>;
			#clock-cells = <1>;
			qcom,num-clkdivs = <1>;
			clock-output-names = "pm640_div_clk1";
			clocks = <&clock_rpmh RPMH_CXO_CLK>;
			clock-names = "xo";
		};

		pm640_gpios: pinctrl@c000 {
			compatible = "qcom,spmi-gpio";
			reg = <0xc000 0xa00>;
			interrupts = <0x0 0xc0 0 IRQ_TYPE_NONE>,
					<0x0 0xc1 0 IRQ_TYPE_NONE>,
					<0x0 0xc2 0 IRQ_TYPE_NONE>,
					<0x0 0xc3 0 IRQ_TYPE_NONE>,
					<0x0 0xc6 0 IRQ_TYPE_NONE>,
					<0x0 0xc7 0 IRQ_TYPE_NONE>;
			interrupt-names = "pm640_gpio1", "pm640_gpio2",
					"pm640_gpio3", "pm640_gpio4",
					"pm640_gpio7", "pm640_gpio8";
			gpio-controller;
			#gpio-cells = <2>;
			qcom,gpios-disallowed = <5 6 9 10>;
		};
	};

	qcom,pm640@1 {
		compatible ="qcom,spmi-pmic";
		reg = <0x1 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <1>;

		pm640_vib: qcom,vibrator@5300 {
			compatible = "qcom,qpnp-vibrator-ldo";
			reg = <0x5300 0x100>;
			qcom,vib-ldo-volt-uv = <3000000>;
			qcom,vib-overdrive-volt-uv = <3544000>;
		};
	};
};
+267 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#include <dt-bindings/spmi/spmi.h>
#include <dt-bindings/interrupt-controller/irq.h>

&spmi_bus {
	qcom,pm640l@4 {
		compatible = "qcom,spmi-pmic";
		reg = <0x4 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <1>;

		pm640l_revid: qcom,revid@100 {
			compatible = "qcom,qpnp-revid";
			reg = <0x100 0x100>;
		};

		qcom,power-on@800 {
			compatible = "qcom,qpnp-power-on";
			reg = <0x800 0x100>;
		};

		pm640l_tz: qcom,temp-alarm@2400 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0x2400 0x100>;
			interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
			#thermal-sensor-cells = <0>;
			qcom,temperature-threshold-set = <1>;
		};

		pm640l_clkdiv: clock-controller@5b00 {
			compatible = "qcom,spmi-clkdiv";
			reg = <0x5b00 0x100>;
			#clock-cells = <1>;
			qcom,num-clkdivs = <1>;
			clock-output-names = "pm640l_div_clk1";
			clocks = <&clock_rpmh RPMH_CXO_CLK>;
			clock-names = "xo";
		};

		pm640l_gpios: pinctrl@c000 {
			compatible = "qcom,spmi-gpio";
			reg = <0xc000 0xc00>;
			interrupts = <0x4 0xc0 0 IRQ_TYPE_NONE>,
					<0x4 0xc1 0 IRQ_TYPE_NONE>,
					<0x4 0xc2 0 IRQ_TYPE_NONE>,
					<0x4 0xc3 0 IRQ_TYPE_NONE>,
					<0x4 0xc4 0 IRQ_TYPE_NONE>,
					<0x4 0xc5 0 IRQ_TYPE_NONE>,
					<0x4 0xc7 0 IRQ_TYPE_NONE>,
					<0x4 0xc8 0 IRQ_TYPE_NONE>,
					<0x4 0xc9 0 IRQ_TYPE_NONE>,
					<0x4 0xca 0 IRQ_TYPE_NONE>,
					<0x4 0xcb 0 IRQ_TYPE_NONE>;
			interrupt-names = "pm640l_gpio1", "pm640l_gpio2",
					"pm640l_gpio3", "pm640l_gpio4",
					"pm640l_gpio5", "pm640l_gpio6",
					"pm640l_gpio8", "pm640l_gpio9",
					"pm640l_gpio10", "pm640l_gpio11",
					"pm640l_gpio12";
			gpio-controller;
			#gpio-cells = <2>;
			qcom,gpios-disallowed = <7>;
		};
	};

	qcom,pm640l@5 {
		compatible ="qcom,spmi-pmic";
		reg = <0x5 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <1>;

		pm640l_lcdb: qcom,lcdb@ec00 {
			compatible = "qcom,qpnp-lcdb-regulator";
			#address-cells = <1>;
			#size-cells = <1>;
			reg = <0xec00 0x100>;
			interrupts = <0x5 0xec 0x1 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "sc-irq";
			qcom,pmic-revid = <&pm640l_revid>;
			status = "disabled";

			lcdb_ldo_vreg: ldo {
				label = "ldo";
				regulator-name = "lcdb_ldo";
				regulator-min-microvolt = <4000000>;
				regulator-max-microvolt = <6000000>;
			};

			lcdb_ncp_vreg: ncp {
				label = "ncp";
				regulator-name = "lcdb_ncp";
				regulator-min-microvolt = <4000000>;
				regulator-max-microvolt = <6000000>;
			};
		};

		flash_led: qcom,leds@d300 {
			compatible = "qcom,qpnp-flash-led-v2";
			status = "okay";
			reg = <0xd300 0x100>;
			label = "flash";
			interrupts = <0x5 0xd3 0x0 IRQ_TYPE_EDGE_RISING>,
				     <0x5 0xd3 0x3 IRQ_TYPE_EDGE_RISING>,
				     <0x5 0xd3 0x4 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "led-fault-irq",
					  "all-ramp-down-done-irq",
					  "all-ramp-up-done-irq";
			qcom,hdrm-auto-mode;
			qcom,short-circuit-det;
			qcom,open-circuit-det;
			qcom,vph-droop-det;
			qcom,thermal-derate-en;
			qcom,thermal-derate-current = <200 500 1000>;
			qcom,isc-delay = <192>;
			qcom,pmic-revid = <&pm640l_revid>;

			pm640l_flash0: qcom,flash_0 {
				label = "flash";
				qcom,led-name = "led:flash_0";
				qcom,max-current = <1500>;
				qcom,default-led-trigger = "flash0_trigger";
				qcom,id = <0>;
				qcom,current-ma = <1000>;
				qcom,duration-ms = <1280>;
				qcom,ires-ua = <12500>;
				qcom,hdrm-voltage-mv = <325>;
				qcom,hdrm-vol-hi-lo-win-mv = <100>;
			};

			pm640l_flash1: qcom,flash_1 {
				label = "flash";
				qcom,led-name = "led:flash_1";
				qcom,max-current = <1500>;
				qcom,default-led-trigger = "flash1_trigger";
				qcom,id = <1>;
				qcom,current-ma = <1000>;
				qcom,duration-ms = <1280>;
				qcom,ires-ua = <12500>;
				qcom,hdrm-voltage-mv = <325>;
				qcom,hdrm-vol-hi-lo-win-mv = <100>;
			};

			pm640l_flash2: qcom,flash_2 {
				label = "flash";
				qcom,led-name = "led:flash_2";
				qcom,max-current = <750>;
				qcom,default-led-trigger = "flash2_trigger";
				qcom,id = <2>;
				qcom,current-ma = <500>;
				qcom,duration-ms = <1280>;
				qcom,ires-ua = <12500>;
				qcom,hdrm-voltage-mv = <325>;
				qcom,hdrm-vol-hi-lo-win-mv = <100>;
				status = "disabled";
			};

			pm640l_torch0: qcom,torch_0 {
				label = "torch";
				qcom,led-name = "led:torch_0";
				qcom,max-current = <500>;
				qcom,default-led-trigger = "torch0_trigger";
				qcom,id = <0>;
				qcom,current-ma = <300>;
				qcom,ires-ua = <12500>;
				qcom,hdrm-voltage-mv = <325>;
				qcom,hdrm-vol-hi-lo-win-mv = <100>;
			};

			pm640l_torch1: qcom,torch_1 {
				label = "torch";
				qcom,led-name = "led:torch_1";
				qcom,max-current = <500>;
				qcom,default-led-trigger = "torch1_trigger";
				qcom,id = <1>;
				qcom,current-ma = <300>;
				qcom,ires-ua = <12500>;
				qcom,hdrm-voltage-mv = <325>;
				qcom,hdrm-vol-hi-lo-win-mv = <100>;
			};

			pm640l_torch2: qcom,torch_2 {
				label = "torch";
				qcom,led-name = "led:torch_2";
				qcom,max-current = <500>;
				qcom,default-led-trigger = "torch2_trigger";
				qcom,id = <2>;
				qcom,current-ma = <300>;
				qcom,ires-ua = <12500>;
				qcom,hdrm-voltage-mv = <325>;
				qcom,hdrm-vol-hi-lo-win-mv = <100>;
				status = "disabled";
			};

			pm640l_switch0: qcom,led_switch_0 {
				label = "switch";
				qcom,led-name = "led:switch_0";
				qcom,led-mask = <1>;
				qcom,default-led-trigger = "switch0_trigger";
			};

			pm640l_switch1: qcom,led_switch_1 {
				label = "switch";
				qcom,led-name = "led:switch_1";
				qcom,led-mask = <2>;
				qcom,default-led-trigger = "switch1_trigger";
			};

			pm640l_switch2: qcom,led_switch_2 {
				label = "switch";
				qcom,led-name = "led:switch_2";
				qcom,led-mask = <3>;
				qcom,default-led-trigger = "switch2_trigger";
			};
		};

		pm640l_wled: qcom,wled@d800 {
			compatible = "qcom,pm640l-spmi-wled";
			reg = <0xd800 0x100>, <0xd900 0x100>;
			reg-names = "wled-ctrl-base", "wled-sink-base";
			label = "backlight";
			interrupts = <0x5 0xd8 0x1 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "ovp-irq";
			qcom,pmic-revid = <&pm640l_revid>;
			qcom,auto-calibration;
			status = "disabled";
		};

		pm640l_lpg: qcom,pwms@b100 {
			compatible = "qcom,pwm-lpg";
			reg = <0xb100 0x300>;
			reg-names = "lpg-base";
			#pwm-cells = <2>;
		};

		pm640l_rgb_led: qcom,leds@d000 {
			compatible = "qcom,tri-led";
			reg = <0xd000 0x100>;
			red {
				label = "red";
				pwms = <&pm640l_lpg 0 1000000>;
				led-sources = <0>;
			};
			green {
				label = "green";
				pwms = <&pm640l_lpg 1 1000000>;
				led-sources = <1>;
			};
			blue {
				label = "blue";
				pwms = <&pm640l_lpg 2 1000000>;
				led-sources = <2>;
			};
		};
	};
};
+2 −0
Original line number Diff line number Diff line
@@ -1001,6 +1001,8 @@
	};
};

#include "pm640.dtsi"
#include "pm640l.dtsi"
#include "sdm640-pinctrl.dtsi"
#include "sdm640-stub-regulator.dtsi"
#include "sdm640-pm.dtsi"