OSDN Git Service

ARM: dts: msm: refactor smb138x device to its own dtsi
authorNicholas Troast <ntroast@codeaurora.org>
Wed, 30 Nov 2016 22:45:45 +0000 (14:45 -0800)
committerNicholas Troast <ntroast@codeaurora.org>
Fri, 2 Dec 2016 17:24:31 +0000 (09:24 -0800)
The smb138x device has been duplicated across many board level files.
Refactor the smb138x device to a separate dtsi file so it can be
included in any board level files.

Change-Id: I9520595f2a40e197ad2227a8391bed79412b19f8
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
arch/arm/boot/dts/qcom/msm-smb138x.dtsi [new file with mode: 0644]
arch/arm/boot/dts/qcom/msm8998-cdp.dtsi
arch/arm/boot/dts/qcom/msm8998-interposer-msmfalcon-cdp.dtsi
arch/arm/boot/dts/qcom/msm8998-interposer-msmfalcon-mtp.dtsi
arch/arm/boot/dts/qcom/msm8998-interposer-msmfalcon.dtsi
arch/arm/boot/dts/qcom/msm8998-mtp.dtsi
arch/arm/boot/dts/qcom/msm8998-qrd.dtsi
arch/arm/boot/dts/qcom/msm8998.dtsi

diff --git a/arch/arm/boot/dts/qcom/msm-smb138x.dtsi b/arch/arm/boot/dts/qcom/msm-smb138x.dtsi
new file mode 100644 (file)
index 0000000..b8c721e
--- /dev/null
@@ -0,0 +1,103 @@
+/* Copyright (c) 2016, 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";
+       qcom,smb138x@8 {
+               compatible = "qcom,i2c-pmic";
+               reg = <0x8>;
+               #address-cells = <2>;
+               #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>;
+                       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 = <(-1032)>;
+                               qcom,offset = <344125>;
+                       };
+
+                       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>;
+                       };
+               };
+
+               smb138x_parallel_slave: qcom,smb138x-parallel-slave@1000 {
+                       compatible = "qcom,smb138x-parallel-slave";
+                       qcom,pmic-revid = <&smb138x_revid>;
+                       reg = <0x1000 0x700>;
+
+                       io-channels = <&smb138x_tadc 2>,
+                                     <&smb138x_tadc 12>,
+                                     <&smb138x_tadc 3>;
+                       io-channel-names = "charger_temp",
+                                          "charger_temp_max",
+                                          "batt_i";
+               };
+       };
+};
index ec57ab6..605f156 100644 (file)
        };
 };
 
-&i2c_7 {
-       status = "okay";
-       qcom,smb138x@8 {
-               compatible = "qcom,i2c-pmic";
-               reg = <0x8>;
-               #address-cells = <2>;
-               #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_tadc: qcom,tadc@3600 {
-                       compatible = "qcom,tadc";
-                       reg = <0x3600 0x100>;
-
-                       interrupts = <0x36 0x0 IRQ_TYPE_EDGE_BOTH>;
-                       interrupt-names = "eoc";
-
-                       batt_therm {
-                               qcom,rbias = <68100>;
-                               qcom,rtherm-at-25degc = <68000>;
-                               qcom,beta-coefficient = <3450>;
-                       };
-
-                       skin_temp {
-                               qcom,rbias = <33000>;
-                               qcom,rtherm-at-25degc = <68000>;
-                               qcom,beta-coefficient = <3450>;
-                       };
-
-                       die_temp {
-                               qcom,scale = <(-1032)>;
-                               qcom,offset = <344125>;
-                       };
-
-                       batt_i {
-                               qcom,channel = <3>;
-                               qcom,scale = <20000000>;
-                       };
-
-                       batt_v {
-                               qcom,scale = <5000000>;
-                       };
-
-                       input_i {
-                               qcom,scale = <14285714>;
-                       };
-
-                       input_v {
-                               qcom,scale = <25000000>;
-                       };
-
-                       otg_i {
-                               qcom,scale = <5714286>;
-                       };
-               };
-       };
-};
-
 &mdss_mdp {
        qcom,mdss-pref-prim-intf = "dsi";
 };
index 32f9dcd..05893cc 100644 (file)
        };
 };
 
-&i2c_7 {
-       status = "okay";
-       qcom,smb138x@8 {
-               compatible = "qcom,i2c-pmic";
-               reg = <0x8>;
-               #address-cells = <2>;
-               #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_tadc: qcom,tadc@3600 {
-                       compatible = "qcom,tadc";
-                       reg = <0x3600 0x100>;
-
-                       interrupts = <0x36 0x0 IRQ_TYPE_EDGE_BOTH>;
-                       interrupt-names = "eoc";
-
-                       batt_therm {
-                               qcom,rbias = <68100>;
-                               qcom,rtherm-at-25degc = <68000>;
-                               qcom,beta-coefficient = <3450>;
-                       };
-
-                       skin_temp {
-                               qcom,rbias = <33000>;
-                               qcom,rtherm-at-25degc = <68000>;
-                               qcom,beta-coefficient = <3450>;
-                       };
-
-                       die_temp {
-                               qcom,scale = <(-1032)>;
-                               qcom,offset = <344125>;
-                       };
-
-                       batt_i {
-                               qcom,channel = <3>;
-                               qcom,scale = <20000000>;
-                       };
-
-                       batt_v {
-                               qcom,scale = <5000000>;
-                       };
-
-                       input_i {
-                               qcom,scale = <14285714>;
-                       };
-
-                       input_v {
-                               qcom,scale = <25000000>;
-                       };
-
-                       otg_i {
-                               qcom,scale = <5714286>;
-                       };
-               };
-       };
-};
-
 &mdss_mdp {
        qcom,mdss-pref-prim-intf = "dsi";
 };
index e73ffc8..09d12ea 100644 (file)
        };
 };
 
-&i2c_7 {
-       status = "okay";
-       qcom,smb138x@8 {
-               compatible = "qcom,i2c-pmic";
-               reg = <0x8>;
-               #address-cells = <2>;
-               #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>;
-                       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 = <(-1032)>;
-                               qcom,offset = <344125>;
-                       };
-
-                       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>;
-                       };
-               };
-
-               smb138x_parallel_slave: qcom,smb138x-parallel-slave@1000 {
-                       compatible = "qcom,smb138x-parallel-slave";
-                       qcom,pmic-revid = <&smb138x_revid>;
-                       reg = <0x1000 0x700>;
-
-                       io-channels = <&smb138x_tadc 2>,
-                                     <&smb138x_tadc 12>,
-                                     <&smb138x_tadc 3>;
-                       io-channel-names = "charger_temp",
-                                          "charger_temp_max",
-                                          "batt_i";
-               };
-       };
-};
-
 &mdss_hdmi_tx {
        pinctrl-names = "hdmi_hpd_active", "hdmi_ddc_active", "hdmi_cec_active",
                                "hdmi_active", "hdmi_sleep";
index 1ca5ce6..d690026 100644 (file)
 #include "msm8998-blsp.dtsi"
 #include "msm-audio.dtsi"
 #include "msmfalcon-audio.dtsi"
+#include "msm-smb138x.dtsi"
 
 /* GPU overrides */
 &msm_gpu {
index 45d6398..9193fbe 100644 (file)
        };
 };
 
-&i2c_7 {
-       status = "okay";
-       qcom,smb138x@8 {
-               compatible = "qcom,i2c-pmic";
-               reg = <0x8>;
-               #address-cells = <2>;
-               #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>;
-                       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 = <(-1032)>;
-                               qcom,offset = <344125>;
-                       };
-
-                       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>;
-                       };
-               };
-
-               smb138x_parallel_slave: qcom,smb138x-parallel-slave@1000 {
-                       compatible = "qcom,smb138x-parallel-slave";
-                       qcom,pmic-revid = <&smb138x_revid>;
-                       reg = <0x1000 0x700>;
-
-                       io-channels = <&smb138x_tadc 2>,
-                                     <&smb138x_tadc 12>,
-                                     <&smb138x_tadc 3>;
-                       io-channel-names = "charger_temp",
-                                          "charger_temp_max",
-                                          "batt_i";
-               };
-       };
-};
-
 &mdss_hdmi_tx {
        pinctrl-names = "hdmi_hpd_active", "hdmi_ddc_active", "hdmi_cec_active",
                                "hdmi_active", "hdmi_sleep";
index 0a011b3..150194a 100644 (file)
        qcom,5v-boost-gpio = <&tlmm 51 0>;
 };
 
-&i2c_7 {
-       status = "okay";
-       qcom,smb138x@8 {
-               compatible = "qcom,i2c-pmic";
-               reg = <0x8>;
-               #address-cells = <2>;
-               #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_parallel_slave: qcom,smb138x-parallel-slave@1000 {
-                       compatible = "qcom,smb138x-parallel-slave";
-                       reg = <0x1000 0x700>;
-               };
-       };
-};
-
 &pmi8998_haptics {
        status = "okay";
 };
                /delete-property/ qcom,us-euro-gpios;
        };
 };
-
index ef488bb..0b54647 100644 (file)
 #include "msm-rdbg.dtsi"
 #include "msm8998-blsp.dtsi"
 #include "msm8998-audio.dtsi"
+#include "msm-smb138x.dtsi"