ARM: tegra: move power mon i2c-mux device registration to DT
Laxman Dewangan [Fri, 10 Jan 2014 14:01:44 +0000 (19:01 +0530)]
Move power monitor i2x mux device registration to DT and remove
the board-file registration.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>

Change-Id: Ia6790690934be8ec87082e0853ce30398f68adce
Reviewed-on: http://git-master/r/354257
GVS: Gerrit_Virtual_Submit
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>

17 files changed:
arch/arm/boot/dts/tegra124-ardbeg-a03-00.dts
arch/arm/boot/dts/tegra124-ardbeg.dts
arch/arm/boot/dts/tegra124-ardbeg_sata.dts
arch/arm/boot/dts/tegra124-e1782_sku1100.dts
arch/arm/boot/dts/tegra124-e1791.dts
arch/arm/boot/dts/tegra124-e1922.dts
arch/arm/boot/dts/tegra124-e1923.dts
arch/arm/boot/dts/tegra124-platforms/tegra124-e1780-powermon.dtsi [new file with mode: 0644]
arch/arm/boot/dts/tegra124-tn8-a03-00-battery.dts
arch/arm/boot/dts/tegra124-tn8-a03-00.dts
arch/arm/boot/dts/tegra124-tn8-a03-01-battery.dts
arch/arm/boot/dts/tegra124-tn8-a03-01.dts
arch/arm/boot/dts/tegra124-tn8-aio.dts
arch/arm/boot/dts/tegra124-tn8-battery.dts
arch/arm/boot/dts/tegra124-tn8.dts
arch/arm/mach-tegra/board-ardbeg-power.c
arch/arm/mach-tegra/board-ardbeg-powermon.c

index fb99aaf..2cfb366 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124-ardbeg-a03.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
 #include "tegra124-platforms/tegra124-e1780-pinmux.dtsi"
 #include "tegra124-platforms/tegra124-e1780-keys.dtsi"
index 2aeeabd..bc9cf71 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
 #include "tegra124-platforms/tegra124-e1780-pinmux.dtsi"
 #include "tegra124-platforms/tegra124-e1780-keys.dtsi"
index 6aac8e0..9668668 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
 #include "tegra124-platforms/tegra124-e1780-pinmux.dtsi"
 
index b6124ba..f0c189b 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
        i2c@7000c400 {
                status = "okay";
                clock-frequency = <100000>;
+
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
        };
 
        i2c@7000c500 {
index f4b77a9..dcbd3dd 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-e1791-e1736-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
        i2c@7000c400 {
                status = "okay";
                clock-frequency = <100000>;
+
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
        };
 
        i2c@7000c500 {
index c672de2..a1630c7 100644 (file)
@@ -3,6 +3,7 @@
 #include "tegra124.dtsi"
 #include "tegra124-platforms/tegra124-tn8-io.dtsi"
 #include "tegra124-platforms/tegra124-e1922-emc.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1936-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1936-fixed.dtsi"
 #include "tegra124-platforms/tegra124-tn8-sensors.dtsi"
                linux,initrd-end = <0x851bc400>;
        };
 
+       i2c@7000c400 {
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
+       };
+
        i2c@7000d000 {
                palmas: tps65913 {
                        pmic {
index 78bf743..5116294 100644 (file)
@@ -1,6 +1,7 @@
 /dts-v1/;
 
 #include "tegra124.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
 #include "tegra124-platforms/tegra124-e1780-pinmux.dtsi"
 #include "tegra124-platforms/tegra124-e1780-keys.dtsi"
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-e1780-powermon.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-e1780-powermon.dtsi
new file mode 100644 (file)
index 0000000..91729c5
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014, NVIDIA CORPORATION.  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 as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+/ {
+       aliases {
+               i2c6 = &pca9546_i2c0;
+               i2c7 = &pca9546_i2c1;
+               i2c8 = &pca9546_i2c2;
+               i2c9 = &pca9546_i2c3;
+       };
+
+       i2c@7000c400 {
+               pca9546@71 {
+                       compatible = "nxp,pca9546";
+                       reg = <0x71>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       pca9546_i2c0: i2c@0 {
+                               reg = <0>;
+                               i2c-mux,deselect-on-exit;
+                       };
+
+                       pca9546_i2c1: i2c@1 {
+                               reg = <1>;
+                               i2c-mux,deselect-on-exit;
+                       };
+
+                       pca9546_i2c2: i2c@2 {
+                               reg = <2>;
+                               i2c-mux,deselect-on-exit;
+                       };
+
+                       pca9546_i2c3: i2c@3 {
+                               reg = <3>;
+                               i2c-mux,deselect-on-exit;
+                       };
+               };
+       };
+};
index 410cc83..8b08c50 100644 (file)
@@ -3,6 +3,7 @@
 #include "tegra124.dtsi"
 #include "tegra124-platforms/tegra124-tn8-io.dtsi"
 #include "tegra124-platforms/tegra124-tn8-emc.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
                        };
                };
        };
+
+       i2c@7000c400 {
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
+       };
 };
 
index b85849e..1d877e5 100644 (file)
@@ -22,6 +22,7 @@
 #include "tegra124.dtsi"
 #include "tegra124-platforms/tegra124-tn8-io.dtsi"
 #include "tegra124-platforms/tegra124-tn8-emc.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
                        };
                };
        };
+
+       i2c@7000c400 {
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
+       };
 };
 
index 4b260e5..fbc4749 100644 (file)
@@ -3,6 +3,7 @@
 #include "tegra124.dtsi"
 #include "tegra124-platforms/tegra124-tn8-io.dtsi"
 #include "tegra124-platforms/tegra124-tn8-emc.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1769-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1769-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
                };
        };
 
+       i2c@7000c400 {
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
+       };
+
        gps {
                compatible = "mtk,mt3332";
                force-on-gpios = <&gpio TEGRA_GPIO(H, 5) GPIO_ACTIVE_HIGH>;
index 292f604..d7f5bd1 100644 (file)
@@ -22,6 +22,7 @@
 #include "tegra124.dtsi"
 #include "tegra124-platforms/tegra124-tn8-io.dtsi"
 #include "tegra124-platforms/tegra124-tn8-emc.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1769-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1769-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
                };
        };
 
+       i2c@7000c400 {
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
+       };
+
        gps {
                compatible = "mtk,mt3332";
                force-on-gpios = <&gpio TEGRA_GPIO(H, 5) GPIO_ACTIVE_HIGH>;
index 9dca3d2..84c9230 100644 (file)
@@ -3,6 +3,7 @@
 #include "tegra124.dtsi"
 #include "tegra124-platforms/tegra124-tn8-io.dtsi"
 #include "tegra124-platforms/tegra124-tn8-emc.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
                linux,initrd-end = <0x851bc400>;
        };
 
+       i2c@7000c400 {
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
+       };
+
        i2c@7000c000 {
                tps65913 {
                        pmic {
index 2cdc633..9229d0e 100644 (file)
@@ -3,6 +3,7 @@
 #include "tegra124.dtsi"
 #include "tegra124-platforms/tegra124-tn8-io.dtsi"
 #include "tegra124-platforms/tegra124-tn8-emc.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
                        };
                };
        };
+
+       i2c@7000c400 {
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
+       };
 };
 
index 3c53f5c..dc48856 100644 (file)
@@ -3,6 +3,7 @@
 #include "tegra124.dtsi"
 #include "tegra124-platforms/tegra124-tn8-io.dtsi"
 #include "tegra124-platforms/tegra124-tn8-emc.dtsi"
+#include "tegra124-platforms/tegra124-e1780-powermon.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-pmic.dtsi"
 #include "tegra124-platforms/tegra124-tn8-e1736-fixed.dtsi"
 #include "tegra124-platforms/tegra124-e1780-gpio-default.dtsi"
                linux,initrd-start = <0x85000000>;
                linux,initrd-end = <0x851bc400>;
        };
+
+       i2c@7000c400 {
+               pca9546@71 {
+                       vcc-supply = <&palmas_smps9>;
+               };
+       };
 };
 
index 859d8db..b8b6b39 100644 (file)
@@ -396,6 +396,7 @@ static struct regulator_consumer_supply palmas_ti913_regen1_supply[] = {
        REGULATOR_SUPPLY("hvdd_sata", "tegra-sata.0"),
        REGULATOR_SUPPLY("vdd", "1-004c"),
        REGULATOR_SUPPLY("vdd", "1-004d"),
+       REGULATOR_SUPPLY("vcc", "1-0071"),
 };
 
 PALMAS_REGS_PDATA(ti913_smps123, 650, 1400, NULL, 0, 1, 1, NORMAL,
index 4b4b5dc..f6f6713 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <linux/i2c.h>
 #include <linux/platform_data/ina230.h>
-#include <linux/i2c/pca954x.h>
 
 #include "board.h"
 #include "board-ardbeg.h"
@@ -791,25 +790,6 @@ static struct i2c_board_info ardbeg_A01_i2c2_2_ina230_board_info[] = {
        },
 };
 
-static struct pca954x_platform_mode ardbeg_pca954x_modes[] = {
-       { .adap_id = PCA954x_I2C_BUS0, .deselect_on_exit = true, },
-       { .adap_id = PCA954x_I2C_BUS1, .deselect_on_exit = true, },
-       { .adap_id = PCA954x_I2C_BUS2, .deselect_on_exit = true, },
-       { .adap_id = PCA954x_I2C_BUS3, .deselect_on_exit = true, },
-};
-
-static struct pca954x_platform_data ardbeg_pca954x_data = {
-       .modes    = ardbeg_pca954x_modes,
-       .num_modes      = ARRAY_SIZE(ardbeg_pca954x_modes),
-};
-
-static const struct i2c_board_info ardbeg_i2c2_board_info[] = {
-       {
-               I2C_BOARD_INFO("pca9546", 0x71),
-               .platform_data = &ardbeg_pca954x_data,
-       },
-};
-
 static void __init register_devices_ardbeg_A01(void)
 {
        i2c_register_board_info(PCA954x_I2C_BUS1,
@@ -907,9 +887,6 @@ int __init ardbeg_pmon_init(void)
        if (bi.sku == 1100)
                modify_tn8_rail_data();
 
-       i2c_register_board_info(1, ardbeg_i2c2_board_info,
-               ARRAY_SIZE(ardbeg_i2c2_board_info));
-
        i2c_register_board_info(PCA954x_I2C_BUS0,
                        ardbeg_i2c2_0_ina230_board_info,
                        ARRAY_SIZE(ardbeg_i2c2_0_ina230_board_info));