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

Commit bbe9ff7b authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Harry Yang
Browse files

ARM: dts: msm: Add SMB1381 DT configuration for sdxpoorwillis



sdxpoorwillis uses SMB1381 in the master mode. Add the i2c, interrupt
and pinctrl configuration for it.

Change-Id: I512bc2e4650ebe771a61058288d3d27763f8fa43
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent c5ac5f82
Loading
Loading
Loading
Loading
+0 −137
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017, 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/interrupt-controller/irq.h>

&i2c_7 {
	status = "okay";
	smb138x: qcom,smb138x@8 {
		compatible = "qcom,i2c-pmic";
		reg = <0x8>;
		#address-cells = <1>;
		#size-cells = <0>;
		interrupt-parent = <&spmi_bus>;
		interrupts = <0x0 0xd1 0x0 IRQ_TYPE_LEVEL_LOW>;
		interrupt_names = "smb138x";
		interrupt-controller;
		#interrupt-cells = <3>;
		qcom,periph-map = <0x10 0x11 0x12 0x13 0x14 0x16 0x36>;

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

		smb138x_tadc: qcom,tadc@3600 {
			compatible = "qcom,tadc";
			reg = <0x3600 0x100>;
			#address-cells = <1>;
			#size-cells = <0>;
			#io-channel-cells = <1>;
			interrupt-parent = <&smb138x>;
			interrupts = <0x36 0x0 IRQ_TYPE_EDGE_BOTH>;
			interrupt-names = "eoc";

			batt_temp@0 {
				reg = <0>;
				qcom,rbias = <68100>;
				qcom,rtherm-at-25degc = <68000>;
				qcom,beta-coefficient = <3450>;
			};

			skin_temp@1 {
				reg = <1>;
				qcom,rbias = <33000>;
				qcom,rtherm-at-25degc = <68000>;
				qcom,beta-coefficient = <3450>;
			};

			die_temp@2 {
				reg = <2>;
				qcom,scale = <(-1306)>;
				qcom,offset = <397904>;
			};

			batt_i@3 {
				reg = <3>;
				qcom,channel = <3>;
				qcom,scale = <(-20000000)>;
			};

			batt_v@4 {
				reg = <4>;
				qcom,scale = <5000000>;
			};

			input_i@5 {
				reg = <5>;
				qcom,scale = <14285714>;
			};

			input_v@6 {
				reg = <6>;
				qcom,scale = <25000000>;
			};

			otg_i@7 {
				reg = <7>;
				qcom,scale = <5714286>;
			};
		};

		smb1381_charger: qcom,smb1381-charger@1000 {
			compatible = "qcom,smb138x-parallel-slave";
			qcom,pmic-revid = <&smb138x_revid>;
			reg = <0x1000 0x700>;
			#address-cells = <1>;
			#size-cells = <1>;
			interrupt-parent = <&smb138x>;
			io-channels =
				<&smb138x_tadc 1>,
				<&smb138x_tadc 2>,
				<&smb138x_tadc 3>,
				<&smb138x_tadc 14>,
				<&smb138x_tadc 15>,
				<&smb138x_tadc 16>,
				<&smb138x_tadc 17>;
			io-channel-names =
				"connector_temp",
				"charger_temp",
				"batt_i",
				"connector_temp_thr1",
				"connector_temp_thr2",
				"connector_temp_thr3",
				"charger_temp_max";

			qcom,chgr@1000 {
				reg = <0x1000 0x100>;
				interrupts = <0x10 0x1 IRQ_TYPE_EDGE_RISING>;
				interrupt-names = "chg-state-change";
			};

			qcom,chgr-misc@1600 {
				reg = <0x1600 0x100>;
				interrupts = <0x16 0x1 IRQ_TYPE_EDGE_RISING>,
					     <0x16 0x6 IRQ_TYPE_EDGE_RISING>;
				interrupt-names = "wdog-bark",
						  "temperature-change";
			};
		};
	};
};

&smb1381_charger {
	smb138x_vbus: qcom,smb138x-vbus {
		status = "disabled";
		regulator-name = "smb138x-vbus";
	};
};
+21 −0
Original line number Diff line number Diff line
@@ -105,3 +105,24 @@
		qcom,vadc-thermal-node;
	};
};

&i2c_3 {
	status = "okay";
	#include "smb138x.dtsi"
};

&smb138x {
	pinctrl-names = "default";
	pinctrl-0 = <&smb_int_default>;
	interrupt-parent = <&tlmm>;
	interrupts = <42 IRQ_TYPE_LEVEL_LOW>;

	smb1381_charger: qcom,smb1381-charger@1000 {
		compatible = "qcom,smb138x-charger";
		qcom,use-extcon;
	};
};

&smb138x_vbus {
	status = "okay";
};
+21 −0
Original line number Diff line number Diff line
@@ -105,3 +105,24 @@
		qcom,vadc-thermal-node;
	};
};

&i2c_3 {
	status = "okay";
	#include "smb138x.dtsi"
};

&smb138x {
	pinctrl-names = "default";
	pinctrl-0 = <&smb_int_default>;
	interrupt-parent = <&tlmm>;
	interrupts = <42 IRQ_TYPE_LEVEL_LOW>;

	smb1381_charger: qcom,smb1381-charger@1000 {
		compatible = "qcom,smb138x-charger";
		qcom,use-extcon;
	};
};

&smb138x_vbus {
	status = "okay";
};
+13 −0
Original line number Diff line number Diff line
@@ -1298,6 +1298,19 @@
				};
			};
		};

		smb_int_default: smb_int_default {
			mux {
				pins = "gpio42";
				function = "gpio";
			};
			config {
				pins = "gpio42";
				drive-strength = <2>;
				bias-pull-up;
				input-enable;
			};
		};
	};
};

+166 −0
Original line number Diff line number Diff line
/* Copyright (c) 2016-2017, 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/interrupt-controller/irq.h>

smb138x: qcom,smb138x@44 {
	compatible = "qcom,i2c-pmic";
	reg = <0x44>;
	#address-cells = <1>;
	#size-cells = <0>;
	interrupt-parent = <&spmi_bus>;
	interrupts = <0x0 0xd1 0x0 IRQ_TYPE_LEVEL_LOW>;
	interrupt_names = "smb138x";
	interrupt-controller;
	#interrupt-cells = <3>;
	qcom,periph-map = <0x10 0x11 0x12 0x13 0x14 0x16 0x36>;

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

	smb138x_tadc: qcom,tadc@3600 {
		compatible = "qcom,tadc";
		reg = <0x3600 0x100>;
		#address-cells = <1>;
		#size-cells = <0>;
		#io-channel-cells = <1>;
		interrupt-parent = <&smb138x>;
		interrupts = <0x36 0x0 IRQ_TYPE_EDGE_BOTH>;
		interrupt-names = "eoc";

		batt_temp@0 {
			reg = <0>;
			qcom,rbias = <68100>;
			qcom,rtherm-at-25degc = <68000>;
			qcom,beta-coefficient = <3450>;
		};

		skin_temp@1 {
			reg = <1>;
			qcom,rbias = <33000>;
			qcom,rtherm-at-25degc = <68000>;
			qcom,beta-coefficient = <3450>;
		};

		die_temp@2 {
			reg = <2>;
			qcom,scale = <(-1306)>;
			qcom,offset = <397904>;
		};

		batt_i@3 {
			reg = <3>;
			qcom,channel = <3>;
			qcom,scale = <(-20000000)>;
		};

		batt_v@4 {
			reg = <4>;
			qcom,scale = <5000000>;
		};

		input_i@5 {
			reg = <5>;
			qcom,scale = <14285714>;
		};

		input_v@6 {
			reg = <6>;
			qcom,scale = <25000000>;
		};

		otg_i@7 {
			reg = <7>;
			qcom,scale = <5714286>;
			};
		};

	smb1381_charger: qcom,smb1381-charger@1000 {
		compatible = "qcom,smb138x-charger";
		qcom,pmic-revid = <&smb138x_revid>;
		reg = <0x1000 0x700>;
		#address-cells = <1>;
		#size-cells = <1>;
		interrupt-parent = <&smb138x>;
		io-channels =
			<&smb138x_tadc 1>,
			<&smb138x_tadc 2>,
			<&smb138x_tadc 3>,
			<&smb138x_tadc 14>,
			<&smb138x_tadc 15>,
			<&smb138x_tadc 16>,
			<&smb138x_tadc 17>;
		io-channel-names =
			"connector_temp",
			"charger_temp",
			"batt_i",
			"connector_temp_thr1",
			"connector_temp_thr2",
			"connector_temp_thr3",
			"charger_temp_max";

		qcom,chgr@1000 {
			reg = <0x1000 0x100>;
			interrupts = <0x10 0x1 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "chg-state-change";
		};

		qcom,otg@1100 {
			reg = <0x1100 0x100>;
			interrupts = <0x11 0x0 IRQ_TYPE_EDGE_BOTH>,
				     <0x11 0x1 IRQ_TYPE_EDGE_BOTH>,
				     <0x11 0x2 IRQ_TYPE_EDGE_BOTH>,
				     <0x11 0x3 IRQ_TYPE_EDGE_BOTH>;

			interrupt-names = "otg-fail",
					  "otg-overcurrent",
					  "otg-oc-dis-sw-sts",
					  "testmode-change-detect";
		};

		qcom,usb-chgpth@1300 {
			reg = <0x1300 0x100>;
			interrupts = <0x13 0x0 IRQ_TYPE_EDGE_BOTH>,
				     <0x13 0x1 IRQ_TYPE_EDGE_BOTH>,
				     <0x13 0x2 IRQ_TYPE_EDGE_BOTH>,
				     <0x13 0x3 IRQ_TYPE_EDGE_BOTH>,
				     <0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
				     <0x13 0x5 IRQ_TYPE_EDGE_RISING>,
				     <0x13 0x6 IRQ_TYPE_EDGE_RISING>,
				     <0x13 0x7 IRQ_TYPE_EDGE_RISING>;

			interrupt-names = "usbin-collapse",
					  "usbin-lt-3p6v",
					  "usbin-uv",
					  "usbin-ov",
					  "usbin-plugin",
					  "usbin-src-change",
					  "usbin-icl-change",
					  "type-c-change";
		};

		qcom,chgr-misc@1600 {
			reg = <0x1600 0x100>;
			interrupts = <0x16 0x1 IRQ_TYPE_EDGE_RISING>,
				     <0x16 0x6 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "wdog-bark",
					  "temperature-change";
		};

		smb138x_vbus: qcom,smb138x-vbus {
			status = "disabled";
			regulator-name = "smb138x-vbus";
		};
	};
};