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

Commit f3dd4aae authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "platform: qpnp-revid: Add REVID support for PM7250B"

parents 13ba529a 26cc77df
Loading
Loading
Loading
Loading
+124 −0
Original line number Original line Diff line number Diff line
Qualcomm Technologies, Inc. PM8008 Regulator

PM8008 is an I2C based PMIC regulator chip.

=======================
Required Node Structure
=======================

==============================================
PM8008 chip specific device
==============================================
PM8008 chip specific properties:

- compatible:
  Usage: required
  Value type: <string>
  Definition: must be "qcom,pm8008-chip"

- pinctrl-names:
  Usage: required
  Value type: <string>
  Definition: must be "default"

- pinctrl-0:
  Usage: required
  Value type: <phandle>
  Definition: pinctrol handle for chip enable GPIO.

- regulator sub-node:
  Usage: required
  Value type: <child sub node>
  Definition: Chip enable regulator device to control chip enable
		functionality. Must be "qcom,pm8008-chip-en".
Example:
	qcom,pm8008-chip@900 {
		compatible = "qcom,pm8008-chip";
		pinctrl-names = "default";
		pinctrl-0 = <&pincontrol handle>; // chip enable GPIO

		PM8008_EN: qcom,pm8008-chip-en {
			regulator-name = "pm8008-chip-en";
		};
	};


========================================================
PM8008 regulator device
========================================================
PM8008 chip regulator specific properties:

- compatible:
  Usage: required
  Value type: <string>
  Definition: must be "qcom,pm8008-regulator"

- <pin>-supply:
  Usage: optional
  Value type: <phandle>
  Definition: Reference to parent regulator supplying the input pin, as
		described in the data sheet.
		Must be one of the following:
		vdd_l1_l2-supply: supply for LDO1/LDO2 of PM8008
		vdd_l3_l4-supply: supply for LDO3/LDO4 of PM8008
		vdd_l5-supply: supply for LDO5 of PM8008
		vdd_l6-supply: supply for LDO6 of PM8008
		vdd_l7-supply: supply for LDO7 of PM8008

- pm8008_en-supply:
  Usage: required
  Value type: <phandle>
  Definition: Reference to PM8008 chip enable regulator, which manages
		chip enable functionlity of PM8008.

============================================================================
Second Level Nodes - PM8008 regulator peripherals of PM8008 regulator device
============================================================================

- qcom,hpm-min-load:
  Usage: optional
  Value type: <u32>
  Definition: Load current in uA which corresponds to the minimum load
		which requires the regulator to be in high power mode.

- qcom,min-dropout-voltage:
  Usage: optional
  Value type: <u32>
  Definition: Specifies the minimum voltage in microvolts that the parent
		supply regulator must output above the output of this
		regulator.  It is only meaningful if the corresponding parent
		supply property has been specified in the first level node.

- qcom,init-voltage
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the initial voltage in microvolts to for a regulator.

- qcom,strong-pd
  Usage:      optional
  Value type: <bool>
  Definition: Property if present enables strong pull-down.

The content of each sub-node is defined by the standard binding for regulators -
see regulator.txt - with additional custom properties described below:

Example:

	qcom,pm8008-regulator {
		compatible = "qcom,pm8008-regulator";

		pm8008_en-supply = <&PM8008_EN>;
		vdd_l1_l2-supply = <&parent-supply>;
		...

		L1: qcom,pm8008-l1@4000 {
			reg = /bits/ 16 <0x4000>;
			regulator-name = "pm8008_l1";
			regulator-min-microvolt = <2900000>;
			regulator-max-microvolt = <3100000>;
			qcom,min-dropout-voltage = <100000>;
			qcom,hpm-min-load = <10000>;
		}

		.....
	};
+29 −0
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */

#include "pm8150.dtsi"
#include "pm7250b.dtsi"
#include "pm8150l.dtsi"
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>

&pm8150_clkdiv {
	/delete-property/ clocks;
	clocks = <&rpmhcc RPMH_CXO_CLK>;
};

&pm8150l_clkdiv {
	/delete-property/ clocks;
	clocks = <&rpmhcc RPMH_CXO_CLK>;
};

&pm7250b_charger {
	dpdm-supply = <&usb2_phy0>;

	smb5_vbus: qcom,smb5-vbus {
		regulator-name = "smb5-vbus";
	};

	smb5_vconn: qcom,smb5-vconn {
		regulator-name = "smb5-vconn";
	};
};
+759 −357

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Original line Diff line number Diff line
@@ -1656,7 +1656,7 @@
		compatible = "qcom,pil-tz-generic";
		compatible = "qcom,pil-tz-generic";
		reg = <0x3000000 0x00100>;
		reg = <0x3000000 0x00100>;


		vdd_lpi_cx-supply = <&L8A_LEVEL>;
		vdd_lpi_cx-supply = <&L18A_LEVEL>;
		qcom,vdd_cx-uV-uA = <RPMH_REGULATOR_LEVEL_TURBO 0>;
		qcom,vdd_cx-uV-uA = <RPMH_REGULATOR_LEVEL_TURBO 0>;
		vdd_lpi_mx-supply = <&L4A_LEVEL>;
		vdd_lpi_mx-supply = <&L4A_LEVEL>;
		qcom,vdd_mx-uV-uA = <RPMH_REGULATOR_LEVEL_TURBO 0>;
		qcom,vdd_mx-uV-uA = <RPMH_REGULATOR_LEVEL_TURBO 0>;
+277 −0
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2019, The Linux Foundation. All rights reserved. */

#include <dt-bindings/spmi/spmi.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/iio/qcom,spmi-vadc.h>

&spmi_bus {
	#address-cells = <2>;
	#size-cells = <0>;
	interrupt-controller;
	#interrupt-cells = <4>;

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

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

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

		pm7250b_charger: qcom,qpnp-smb5 {
			compatible = "qcom,qpnp-smb5";
			#address-cells = <1>;
			#size-cells = <1>;
			#cooling-cells = <2>;

			qcom,pmic-revid = <&pm7250b_revid>;

			qcom,chgr@1000 {
				reg = <0x1000 0x100>;
				interrupts =
					<0x2 0x10 0x0 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x10 0x1 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x10 0x2 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x10 0x3 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x10 0x4 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x10 0x5 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x10 0x6 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x10 0x7 IRQ_TYPE_EDGE_RISING>;
				interrupt-names = "chgr-error",
						  "chg-state-change",
						  "step-chg-state-change",
						  "step-chg-soc-update-fail",
						  "step-chg-soc-update-req",
						  "fg-fvcal-qualified",
						  "vph-alarm",
						  "vph-drop-prechg";
			};

			qcom,dcdc@1100 {
				reg = <0x1100 0x100>;
				interrupts =
					<0x2 0x11 0x0 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x11 0x1 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x11 0x2 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x11 0x3 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x11 0x4 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x11 0x5 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x11 0x6 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x11 0x7 IRQ_TYPE_EDGE_BOTH>;
				interrupt-names = "otg-fail",
						  "otg-oc-disable-sw",
						  "otg-oc-hiccup",
						  "bsm-active",
						  "high-duty-cycle",
						  "input-current-limiting",
						  "concurrent-mode-disable",
						  "switcher-power-ok";
			};

			qcom,batif@1200 {
				reg = <0x1200 0x100>;
				interrupts =
					<0x2 0x12 0x0 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x12 0x3 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x12 0x4 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x12 0x5 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x12 0x6 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x12 0x7 IRQ_TYPE_EDGE_BOTH>;
				interrupt-names = "bat-temp",
						  "bat-ov",
						  "bat-low",
						  "bat-therm-or-id-missing",
						  "bat-terminal-missing",
						  "buck-oc",
						  "vph-ov";
			};

			qcom,usb@1300 {
				reg = <0x1300 0x100>;
				interrupts =
					<0x2 0x13 0x0 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x13 0x1 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x13 0x2 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x13 0x3 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x13 0x5 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x13 0x6 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x13 0x7 IRQ_TYPE_EDGE_RISING>;
				interrupt-names = "usbin-collapse",
						  "usbin-vashdn",
						  "usbin-uv",
						  "usbin-ov",
						  "usbin-plugin",
						  "usbin-revi-change",
						  "usbin-src-change",
						  "usbin-icl-change";
			};

			qcom,dc@1400 {
				reg = <0x1400 0x100>;
				interrupts =
					<0x2 0x14 0x1 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x14 0x2 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x14 0x3 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x14 0x4 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x14 0x5 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x14 0x6 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x14 0x7 IRQ_TYPE_EDGE_RISING>;
				interrupt-names = "dcin-vashdn",
						  "dcin-uv",
						  "dcin-ov",
						  "dcin-plugin",
						  "dcin-revi",
						  "dcin-pon",
						  "dcin-en";
			};

			qcom,typec@1500 {
				reg = <0x1500 0x100>;
				interrupts =
					<0x2 0x15 0x0 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x15 0x1 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x15 0x2 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x15 0x3 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x15 0x4 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x15 0x5 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x15 0x6 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x15 0x7 IRQ_TYPE_EDGE_RISING>;
				interrupt-names = "typec-or-rid-detect-change",
						  "typec-vpd-detect",
						  "typec-cc-state-change",
						  "typec-vconn-oc",
						  "typec-vbus-change",
						  "typec-attach-detach",
						  "typec-legacy-cable-detect",
						  "typec-try-snk-src-detect";
			};

			qcom,misc@1600 {
				reg = <0x1600 0x100>;
				interrupts =
					<0x2 0x16 0x0 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x16 0x2 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x16 0x3 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x16 0x4 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x16 0x5 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x16 0x6 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x16 0x7 IRQ_TYPE_EDGE_RISING>;
				interrupt-names = "wdog-snarl",
						  "wdog-bark",
						  "aicl-fail",
						  "aicl-done",
						  "smb-en",
						  "imp-trigger",
						  "temp-change",
						  "temp-change-smb";
			};
		};

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

		pm7250b_qg: qpnp,qg {
			compatible = "qcom,qpnp-qg";
			#address-cells = <1>;
			#size-cells = <1>;

			qcom,vbatt-cutoff-mv = <3200>;
			qcom,vbatt-low-mv = <3300>;
			qcom,vbatt-low-cold-mv = <3700>;
			qcom,vbatt-empty-mv = <3000>;
			qcom,vbatt-empty-cold-mv = <3000>;
			qcom,s3-entry-fifo-length = <2>;

			qcom,pmic-revid = <&pm7250b_revid>;

			qcom,qgauge@4800 {
				status = "okay";
				reg = <0x4800 0x100>;
				interrupts =
					<0x2 0x48 0x0 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x48 0x1 IRQ_TYPE_EDGE_BOTH>,
					<0x2 0x48 0x2 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x48 0x3 IRQ_TYPE_EDGE_RISING>,
					<0x2 0x48 0x4 IRQ_TYPE_EDGE_RISING>;
				interrupt-names = "qg-batt-missing",
						  "qg-vbat-low",
						  "qg-vbat-empty",
						  "qg-fifo-done",
						  "qg-good-ocv";
			};

			qcom,qg-sdam@b100 {
				status = "okay";
				reg = <0xb100 0x100>;
			};
		};

		pm7250b_clkdiv: clock-controller@5b00 {
			compatible = "qcom,spmi-clkdiv";
			reg = <0x5b00 0x100>;
			#clodk-cells = <1>;
			qcom,num-clkdivs = <1>;
			clock-output-names = "pm7250b_div_clk1";
			clocks = <&rpmhcc RPMH_CXO_CLK>;
			clock-names = "xo";
			assigned-clocks = <&pm7250b_clkdiv 1>;
			assigned-clock-rates = <19200000>;
		};

		pm7250b_gpios: pinctrl@c000 {
			compatible = "qcom,spmi-gpio";
			reg = <0xc000 0xc00>;
			interrupts = <0x2 0xc0 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc1 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc2 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc3 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc4 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc5 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc6 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc7 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc8 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xc9 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xca 0x0 IRQ_TYPE_NONE>,
				     <0x2 0xcb 0x0 IRQ_TYPE_NONE>;
			interrupt-names = "pm7250b_gpio1", "pm7250b_gpio2",
					"pm7250b_gpio3", "pm7250b_gpio4",
					"pm7250b_gpio5", "pm7250b_gpio6",
					"pm7250b_gpio7", "pm7250b_gpio8",
					"pm7250b_gpio9", "pm7250b_gpio10",
					"pm7250b_gpio11", "pm7250b_gpio12";
			gpio-controller;
			#gpio-cells = <2>;
		};
	};

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

		pm7250b_vib: qcom,vibrator@5300 {
			compatible = "qcom,qpnp-vibrator-ldo";
			reg = <0x5300 0x100>;
			qcom,vib-ldo-volt-uv = <3000000>;
			qcom,disable-overdrive;
		};
	};
};
Loading