ARM: tegra: move power tree of Norrin to DT
Laxman Dewangan [Mon, 24 Mar 2014 14:32:07 +0000 (19:32 +0530)]
Move Norrin power tree to DT and remove duplicate code from
board files for power tree.

Change-Id: Id789854f885fd68cc5aa0d931996b1dc9e5ed893
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/385728
GVS: Gerrit_Virtual_Submit

arch/arm/boot/dts/tegra124-norrin-pm374-0001-a00-00.dts
arch/arm/boot/dts/tegra124-norrin-pm374-0001-a01-00.dts
arch/arm/boot/dts/tegra124-norrin-pm374-0001-common.dtsi
arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-fixed-pm374-0000-a00.dtsi [new file with mode: 0644]
arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-pmic-pm374-0000-a00.dtsi [new file with mode: 0644]
arch/arm/mach-tegra/board-norrin-power.c
arch/arm64/boot/dts/tegra132-norrin-pm374-0001-a00-00.dts
arch/arm64/boot/dts/tegra132-norrin-pm374-0001-a01-00.dts
arch/arm64/boot/dts/tegra132-norrin-pm374-0001-common.dtsi

index d6b7def..0d51796 100644 (file)
@@ -6,4 +6,11 @@
        nvidia,boardids = "374:0001:00";
        nvidia,dtsfilename = __FILE__;
        nvidia,proc-boardid = "374:0001:00";
+
+       i2c@7000d000 {
+               as3722@40 {
+                       ams,major-rev = <1>;
+                       ams,minor-rev = <1>;
+               };
+       };
 };
\ No newline at end of file
index 367bae7..1aea353 100644 (file)
@@ -6,4 +6,11 @@
        nvidia,boardids = "374:0001:01";
        nvidia,dtsfilename = __FILE__;
        nvidia,proc-boardid = "374:0001:01";
+
+       i2c@7000d000 {
+               as3722@40 {
+                       ams,major-rev = <1>;
+                       ams,minor-rev = <2>;
+               };
+       };
 };
\ No newline at end of file
index eb0ce4b..e4c2508 100644 (file)
@@ -2,6 +2,8 @@
 #include "tegra124-platforms/tegra124-pm374-gpio-default.dtsi"
 #include "tegra124-platforms/tegra124-pm374-pinmux.dtsi"
 #include "tegra124-platforms/tegra124-norrin-keys-pm374-0000-a00.dtsi"
+#include "tegra124-platforms/tegra124-norrin-fixed-pm374-0000-a00.dtsi"
+#include "tegra124-platforms/tegra124-norrin-pmic-pm374-0000-a00.dtsi"
 
 / {
        model = "NVIDIA Tegra124 Norrin";
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-fixed-pm374-0000-a00.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-fixed-pm374-0000-a00.dtsi
new file mode 100644 (file)
index 0000000..867c5e8
--- /dev/null
@@ -0,0 +1,550 @@
+#include <dt-bindings/gpio/tegra-gpio.h>
+
+/ {
+       regulators {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               vdd_ac_bat: regulator@0 {
+                       compatible = "regulator-fixed";
+                       reg = <0>;
+                       regulator-name = "vdd-ac-bat";
+                       regulator-min-microvolt = <8400000>;
+                       regulator-max-microvolt = <8400000>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_sys_bl";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "vddio_pex_sata";
+                                       regulator-consumer-device = "tegra-sata.0";
+                               };
+                       };
+               };
+
+               vdd_aon_1v8: regulator@1 {
+                       compatible = "regulator-fixed";
+                       reg = <1>;
+                       regulator-name = "vdd-aon-1v8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_1v8_emmc";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "vdd_1v8b_com_f";
+                               };
+                               c2 {
+                                       regulator-consumer-supply = "vdd_1v8b_gps_f";
+                               };
+                               c3 {
+                                       regulator-consumer-supply = "vdd";
+                                       regulator-consumer-device = "0-004c";
+                               };
+                       };
+               };
+
+               vdd_aon_3v3: regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "vdd-aon-3v3";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_3v3_emmc";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "vdd_com_3v3";
+                               };
+                       };
+               };
+
+               vdd_aon_1v2: regulator@3 {
+                       compatible = "regulator-fixed";
+                       reg = <3>;
+                       regulator-name = "vdd-aon-1v2";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_1v2_bb_hsic";
+                               };
+                       };
+               };
+
+               vdd_hdmi_5v0: regulator@4 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <4>;
+                       regulator-name = "vdd_hdmi_5v0";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio TEGRA_GPIO(K, 6) 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_hdmi_5v0";
+                                       regulator-consumer-device = "tegradc.1";
+                               };
+                       };
+               };
+
+               vdd_hdmi: regulator@5 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <5>;
+                       regulator-name = "vdd_hdmi";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio TEGRA_GPIO(H, 7) 0>;
+                       vin-supply = <&as3722_sd4>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "avdd_hdmi_pll";
+                                       regulator-consumer-device = "tegradc.1";
+                               };
+                       };
+               };
+
+               vdd_lcd_bl: regulator@6 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <6>;
+                       regulator-name = "vdd_lcd_bl";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio TEGRA_GPIO(P, 2) 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_lcd_bl";
+                               };
+                       };
+               };
+
+               lcd_bl_en: regulator@7 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <7>;
+                       regulator-name = "lcd_bl_en";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio TEGRA_GPIO(H, 2) 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_lcd_bl_en";
+                               };
+                       };
+               };
+
+               vdd_3v3: regulator@8 {
+                       compatible = "regulator-fixed";
+                       reg = <8>;
+                       regulator-name = "vdd_3v3";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "hvdd_pex";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "hvdd_pex_pll";
+                               };
+                               c2 {
+                                       regulator-consumer-supply = "vdd_sys_cam_3v3";
+                               };
+                               c3 {
+                                       regulator-consumer-supply = "micvdd";
+                                       regulator-consumer-device = "tegra-snd-rt5645.0";
+                               };
+                               c4 {
+                                       regulator-consumer-supply = "micvdd";
+                                       regulator-consumer-device = "tegra-snd-rt5639.0";
+                               };
+                               c5 {
+                                       regulator-consumer-supply = "vdd_gps_3v3";
+                               };
+                               c6 {
+                                       regulator-consumer-supply = "vdd_nfc_3v3";
+                               };
+                               c7 {
+                                       regulator-consumer-supply = "vdd_3v3_sensor";
+                               };
+                               c8 {
+                                       regulator-consumer-supply = "vdd_kp_3v3";
+                               };
+                               c9 {
+                                       regulator-consumer-supply = "vdd_tp_3v3";
+                               };
+                               c10 {
+                                       regulator-consumer-supply = "vdd_dtv_3v3";
+                               };
+                               c11 {
+                                       regulator-consumer-supply = "vdd_modem_3v3";
+                               };
+                               c12 {
+                                       regulator-consumer-supply = "vdd";
+                                       regulator-consumer-device = "0-0048";
+                               };
+                               c13 {
+                                       regulator-consumer-supply = "vdd";
+                                       regulator-consumer-device = "0-0069";
+                               };
+                               c14 {
+                                       regulator-consumer-supply = "vdd";
+                                       regulator-consumer-device = "0-000c";
+                               };
+                               c15 {
+                                       regulator-consumer-supply = "vdd";
+                                       regulator-consumer-device = "0-0077";
+                               };
+                               c16 {
+                                       regulator-consumer-supply = "vin";
+                                       regulator-consumer-device = "2-0030";
+                               };
+                       };
+               };
+
+               vdd_5v0: regulator@9 {
+                       compatible = "regulator-fixed";
+                       reg = <9>;
+                       regulator-name = "vdd_5v0";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "spkvdd";
+                                       regulator-consumer-device = "tegra-snd-rt5645.0";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "spkvdd";
+                                       regulator-consumer-device = "tegra-snd-rt5639.0";
+                               };
+                               c2 {
+                                       regulator-consumer-supply = "vdd_5v0_sensor";
+                               };
+                       };
+               };
+
+               dcdc_1v8: regulator@10 {
+                       compatible = "regulator-fixed";
+                       reg = <10>;
+                       regulator-name = "dcdc_1v8";
+                       regulator-min-microvolt = <1800000>;
+                       regulator-max-microvolt = <1800000>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "avdd_lvds0_pll";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "dvdd_lcd";
+                               };
+                               c2 {
+                                       regulator-consumer-supply = "vdd_ds_1v8";
+                               };
+                               c3 {
+                                       regulator-consumer-supply = "avdd";
+                                       regulator-consumer-device = "tegra-snd-rt5645.0";
+                               };
+                               c4 {
+                                       regulator-consumer-supply = "dbvdd";
+                                       regulator-consumer-device = "tegra-snd-rt5645.0";
+                               };
+                               c5 {
+                                       regulator-consumer-supply = "avdd";
+                                       regulator-consumer-device = "tegra-snd-rt5639.0";
+                               };
+                               c6 {
+                                       regulator-consumer-supply = "dbvdd";
+                                       regulator-consumer-device = "tegra-snd-rt5639.0";
+                               };
+                               c7 {
+                                       regulator-consumer-supply = "dmicvdd";
+                                       regulator-consumer-device = "tegra-snd-rt5639.0";
+                               };
+                               c8 {
+                                       regulator-consumer-supply = "dmicvdd";
+                                       regulator-consumer-device = "tegra-snd-rt5645.0";
+                               };
+                               c9 {
+                                       regulator-consumer-supply = "vdd_1v8b_nfc";
+                               };
+                               c10 {
+                                       regulator-consumer-supply = "vdd_1v8_sensor";
+                               };
+                               c11 {
+                                       regulator-consumer-supply = "vdd_1v8_sdmmc";
+                               };
+                               c12 {
+                                       regulator-consumer-supply = "vdd_kp_1v8";
+                               };
+                               c13 {
+                                       regulator-consumer-supply = "vdd_tp_1v8";
+                               };
+                               c14 {
+                                       regulator-consumer-supply = "vdd_modem_1v8";
+                               };
+                               c15 {
+                                       regulator-consumer-supply = "vdd_1v8b";
+                                       regulator-consumer-device = "0-0048";
+                               };
+                               c16 {
+                                       regulator-consumer-supply = "dvdd";
+                                       regulator-consumer-device = "spi0.0";
+                               };
+                               c17 {
+                                       regulator-consumer-supply = "dvdd";
+                                       regulator-consumer-device = "spi2.1";
+                               };
+                               c18 {
+                                       regulator-consumer-supply = "vlogic";
+                                       regulator-consumer-device = "0-0069";
+                               };
+                               c19 {
+                                       regulator-consumer-supply = "vid";
+                                       regulator-consumer-device = "0-000c";
+                               };
+                               c20 {
+                                       regulator-consumer-supply = "vddio";
+                                       regulator-consumer-device = "0-0077";
+                               };
+                               c21 {
+                                       regulator-consumer-supply = "avdd_pll_utmip";
+                                       regulator-consumer-device = "tegra-udc.0";
+                               };
+                               c22 {
+                                       regulator-consumer-supply = "avdd_pll_utmip";
+                                       regulator-consumer-device = "tegra-ehci.0";
+                               };
+                               c23 {
+                                       regulator-consumer-supply = "avdd_pll_utmip";
+                                       regulator-consumer-device = "tegra-ehci.1";
+                               };
+                               c24 {
+                                       regulator-consumer-supply = "avdd_pll_utmip";
+                                       regulator-consumer-device = "tegra-ehci.2";
+                               };
+                               c25 {
+                                       regulator-consumer-supply = "avdd_pll_utmip";
+                                       regulator-consumer-device = "tegra-xhci";
+                               };
+                       };
+               };
+
+               as3722_gpio2: regulator@11 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <11>;
+                       regulator-name = "as3722_gpio2";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-boot-on;
+                       gpio = <&as3722 2 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "avdd_usb";
+                                       regulator-consumer-device = "tegra-udc.0";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "avdd_usb";
+                                       regulator-consumer-device = "tegra-ehci.0";
+                               };
+                               c2 {
+                                       regulator-consumer-supply = "avdd_usb";
+                                       regulator-consumer-device = "tegra-ehci.1";
+                               };
+                               c3 {
+                                       regulator-consumer-supply = "avdd_usb";
+                                       regulator-consumer-device = "tegra-ehci.2";
+                               };
+                               c4 {
+                                       regulator-consumer-supply = "hvdd_usb";
+                                       regulator-consumer-device = "tegra-xhci";
+                               };
+                               c5 {
+                                       regulator-consumer-supply = "vddio_hv";
+                                       regulator-consumer-device = "tegradc.1";
+                               };
+                               c6 {
+                                       regulator-consumer-supply = "pwrdet_hv";
+                               };
+                               c7 {
+                                       regulator-consumer-supply = "hvdd_sata";
+                               };
+                       };
+               };
+
+               lcd: regulator@12 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <12>;
+                       regulator-name = "lcd";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&as3722 4 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "avdd_lcd";
+                               };
+                       };
+               };
+
+               vdd_sdmmc_en: regulator@13 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <13>;
+                       regulator-name = "vdd_sdmmc_en";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&gpio TEGRA_GPIO(R, 0) 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vddio_sd_slot";
+                                       regulator-consumer-device = "sdhci-tegra.1";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "vddio_sd_slot";
+                                       regulator-consumer-device = "sdhci-tegra.2";
+                               };
+                       };
+               };
+
+               usb0_vbus: regulator@14 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <14>;
+                       regulator-name = "usb0_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio TEGRA_GPIO(N, 4) 0>;
+                       enable-active-high;
+                       gpio-open-drain;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "usb_vbus";
+                                       regulator-consumer-device = "tegra-ehci.0";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "usb_vbus";
+                                       regulator-consumer-device = "tegra-otg";
+                               };
+                               c2 {
+                                       regulator-consumer-supply = "usb_vbus0";
+                                       regulator-consumer-device = "tegra-xhci";
+                               };
+                       };
+               };
+
+               usb1_usb2_vbus: regulator@15 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <15>;
+                       regulator-name = "usb1_usb2_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio TEGRA_GPIO(N, 5) 0>;
+                       enable-active-high;
+                       gpio-open-drain;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "usb_vbus";
+                                       regulator-consumer-device = "tegra-ehci.1";
+                               };
+                               c1 {
+                                       regulator-consumer-supply = "usb_vbus1";
+                                       regulator-consumer-device = "tegra-xhci";
+                               };
+                               c2 {
+                                       regulator-consumer-supply = "usb_vbus";
+                                       regulator-consumer-device = "tegra-ehci.2";
+                               };
+                               c3 {
+                                       regulator-consumer-supply = "usb_vbus2";
+                                       regulator-consumer-device = "tegra-xhci";
+                               };
+                       };
+               };
+
+               dcdc_1v2: regulator@16 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <16>;
+                       regulator-name = "dcdc_1v2";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       gpio = <&tca6416 0 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_1v2_en";
+                               };
+                       };
+               };
+
+               vdd_cdc_1v2_aud: regulator@17 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <17>;
+                       regulator-name = "vdd_cdc_1v2_aud";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       gpio = <&tca6416 2 0>;
+                       enable-active-high;
+                       startup-delay-us = <250000>;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "ldoen";
+                                       regulator-consumer-device = "tegra-snd-rt5639.0";
+                               };
+                       };
+               };
+
+               vdd_amp_shut_aud: regulator@18 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <18>;
+                       regulator-name = "vdd_amp_shut_aud";
+                       regulator-min-microvolt = <1200000>;
+                       regulator-max-microvolt = <1200000>;
+                       gpio = <&tca6416 3 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "epamp";
+                                       regulator-consumer-device = "tegra-snd-rt5645.0";
+                               };
+                       };
+               };
+
+               vdd_dsi_mux: regulator@19 {
+                       compatible = "regulator-fixed-sync";
+                       reg = <19>;
+                       regulator-name = "vdd_dsi_mux";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       gpio = <&tca6416 13 0>;
+                       enable-active-high;
+
+                       consumers {
+                               c0 {
+                                       regulator-consumer-supply = "vdd_3v3_dsi";
+                                       regulator-consumer-device = "NULL";
+                               };
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-pmic-pm374-0000-a00.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-norrin-pmic-pm374-0000-a00.dtsi
new file mode 100644 (file)
index 0000000..3e996a0
--- /dev/null
@@ -0,0 +1,508 @@
+#include <dt-bindings/mfd/as3722.h>
+
+/ {
+       i2c@7000d000 {
+               as3722: as3722@40 {
+                       compatible = "ams,as3722";
+                       reg = <0x40>;
+                       interrupts = <0 86 IRQ_TYPE_NONE>;
+
+                       #interrupt-cells = <2>;
+                       interrupt-controller;
+
+                       gpio-controller;
+                       #gpio-cells = <2>;
+
+                       ams,major-rev = <1>;
+                       ams,minor-rev = <1>;
+                       ams,system-power-controller;
+                       ams,extcon-name = "as3722-extcon";
+                       ams,enable-adc1-continuous-mode;
+                       ams,enable-low-voltage-range;
+                       ams,adc-channel = <12>;
+                       ams,hi-threshold = <256>;
+                       ams,low-threshold = <128>;
+                       ams,enable-clock32k-out;
+
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&as3722_default>;
+
+                       as3722_default: pinmux@0 {
+                               gpio0 {
+                                       pins = "gpio0";
+                                       function = "gpio";
+                                       output-low;
+                               };
+
+                               gpio1_2_4_7 {
+                                       pins = "gpio1", "gpio2", "gpio4", "gpio7";
+                                       function = "gpio";
+                                       output-high;
+                               };
+
+                               gpio3_6 {
+                                       pins = "gpio3", "gpio6";
+                                       function = "gpio";
+                                       bias-high-impedance;
+                               };
+
+                               gpio5 {
+                                       pins = "gpio5";
+                                       function = "clk32k-out";
+                               };
+                       };
+
+                       regulators {
+                               compatible = "ams,as3722";
+                               ldo0-in-supply = <&as3722_sd2>;
+                               ldo2-in-supply = <&as3722_sd5>;
+                               ldo5-in-supply = <&as3722_sd5>;
+                               ldo7-in-supply = <&as3722_sd5>;
+
+                               as3722_sd0: sd0 {
+                                   regulator-name = "vdd-cpu";
+                                   regulator-min-microvolt = <700000>;
+                                   regulator-max-microvolt = <1400000>;
+                                   regulator-min-microamp = <3500000>;
+                                   regulator-max-microamp = <3500000>;
+                                   regulator-always-on;
+                                   regulator-boot-on;
+                                   ams,ext-control = <AS3722_EXT_CONTROL_ENABLE2>;
+                                   consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vdd_cpu";
+                                       };
+                                   };
+                               };
+
+                               as3722_sd1: sd1 {
+                                   regulator-name = "vdd-core";
+                                   regulator-min-microvolt = <700000>;
+                                   regulator-max-microvolt = <1350000>;
+                                   regulator-min-microamp = <2500000>;
+                                   regulator-max-microamp = <2500000>;
+                                   regulator-always-on;
+                                   regulator-boot-on;
+                                   ams,ext-control = <AS3722_EXT_CONTROL_ENABLE1>;
+                                   consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vdd_core";
+                                       };
+                                   };
+                               };
+
+                               as3722_sd2: sd2 {
+                                    regulator-name = "vddio-ddr";
+                                    regulator-always-on;
+                                    regulator-boot-on;
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vddio_ddr";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "vddio_ddr_mclk";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "vddio_ddr3";
+                                       };
+                                       c3 {
+                                            regulator-consumer-supply = "vcore1_ddr3";
+                                       };
+                                    };
+                               };
+
+                               as3722_sd4: sd4 {
+                                   regulator-name = "avdd-pll-pex";
+                                   regulator-always-on;
+                                   regulator-boot-on;
+                                   ams,ext-control = <AS3722_EXT_CONTROL_ENABLE1>;
+                                   consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "avdd_pex_pll";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "avddio_pex_pll";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "dvddio_pex";
+                                       };
+                                       c3 {
+                                            regulator-consumer-supply = "pwrdet_pex_ctl";
+                                       };
+                                       c4 {
+                                            regulator-consumer-supply = "avdd_sata";
+                                       };
+                                       c5 {
+                                            regulator-consumer-supply = "vdd_sata";
+                                       };
+                                       c6 {
+                                            regulator-consumer-supply = "avdd_sata_pll";
+                                       };
+                                       c7 {
+                                            regulator-consumer-supply = "avddio_usb";
+                                            regulator-consumer-device = "tegra-xhci";
+                                       };
+                                       c8 {
+                                            regulator-consumer-supply = "avdd_hdmi";
+                                            regulator-consumer-device = "tegradc.1";
+                                       };
+                                   };
+                               };
+
+                               as3722_sd5: sd5 {
+                                   regulator-name = "vdd-1v8";
+                                   regulator-always-on;
+                                   regulator-boot-on;
+                                   consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vddio_sys";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "vddio_sys_2";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "vddio_audio";
+                                       };
+                                       c3 {
+                                            regulator-consumer-supply = "pwrdet_audio";
+                                       };
+                                       c4 {
+                                            regulator-consumer-supply = "vddio_sdmmc";
+                                            regulator-consumer-device = "sdhci-tegra.0";
+                                       };
+                                       c5 {
+                                            regulator-consumer-supply = "pwrdet_sdmmc1";
+                                       };
+                                       c6 {
+                                            regulator-consumer-supply = "vddio_sdmmc";
+                                            regulator-consumer-device = "sdhci-tegra.3";
+                                       };
+                                       c7 {
+                                            regulator-consumer-supply = "pwrdet_sdmmc4";
+                                       };
+                                       c8 {
+                                            regulator-consumer-supply = "vddio_uart";
+                                       };
+                                       c9 {
+                                            regulator-consumer-supply = "pwrdet_uart";
+                                       };
+                                       c10 {
+                                            regulator-consumer-supply = "vddio_bb";
+                                       };
+                                       c11 {
+                                            regulator-consumer-supply = "pwrdet_bb";
+                                       };
+                                       c12 {
+                                            regulator-consumer-supply = "vddio_gmi";
+                                       };
+                                       c13 {
+                                            regulator-consumer-supply = "pwrdet_nand";
+                                       };
+                                       c14 {
+                                            regulator-consumer-supply = "avdd_osc";
+                                       };
+                                   };
+                               };
+
+                               as3722_sd6: sd6 {
+                                   regulator-name = "vdd-gpu";
+                                   regulator-min-microvolt = <650000>;
+                                   regulator-max-microvolt = <1200000>;
+                                   regulator-min-microamp = <3500000>;
+                                   regulator-max-microamp = <3500000>;
+                                   regulator-init-microvolt = <1000000>;
+                                   regulator-boot-on;
+
+                                   consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vdd_gpu";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo0: ldo0 {
+                                    regulator-name = "avdd-pll";
+                                    regulator-always-on;
+                                    regulator-boot-on;
+                                    ams,ext-control = <AS3722_EXT_CONTROL_ENABLE1>;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "avdd_pll_m";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "avdd_pll_ap_c2_c3";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "avdd_pll_cud2dpd";
+                                       };
+                                       c3 {
+                                            regulator-consumer-supply = "avdd_pll_c4";
+                                       };
+                                       c4 {
+                                            regulator-consumer-supply = "avdd_lvds0_io";
+                                       };
+                                       c5 {
+                                            regulator-consumer-supply = "vddio_ddr_hs";
+                                       };
+                                       c6 {
+                                            regulator-consumer-supply = "avdd_pll_erefe";
+                                       };
+                                       c7 {
+                                            regulator-consumer-supply = "avdd_pll_x";
+                                       };
+                                       c8 {
+                                            regulator-consumer-supply = "avdd_pll_cg";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo1: ldo1 {
+                                    regulator-name = "vdd-cam";
+                                    regulator-min-microvolt = <1800000>;
+                                    regulator-max-microvolt = <1800000>;
+                                    regulator-boot-on;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vddio_cam";
+                                            regulator-consumer-device = "vi";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "pwrdet_cam";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "vdd_cam_1v8_cam";
+                                       };
+                                       c3 {
+                                            regulator-consumer-supply = "vif";
+                                            regulator-consumer-device = "2-0010";
+                                       };
+                                       c4 {
+                                            regulator-consumer-supply = "vdd_i2c";
+                                            regulator-consumer-device = "2-000e";
+                                       };
+                                       c5 {
+                                            regulator-consumer-supply = "vif";
+                                            regulator-consumer-device = "2-0036";
+                                       };
+                                       c6 {
+                                            regulator-consumer-supply = "vdd_i2c";
+                                            regulator-consumer-device = "2-000c";
+                                       };
+                                       c7 {
+                                            regulator-consumer-supply = "vi2c";
+                                            regulator-consumer-device = "2-0030";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo2: ldo2 {
+                                    regulator-name = "avdd-dsi-csi";
+                                    regulator-boot-on;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "avdd_dsi_csi";
+                                            regulator-consumer-device = "tegradc.0";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "avdd_dsi_csi";
+                                            regulator-consumer-device = "tegradc.1";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "avdd_dsi_csi";
+                                            regulator-consumer-device = "vi.0";
+                                       };
+                                       c3 {
+                                            regulator-consumer-supply = "avdd_dsi_csi";
+                                            regulator-consumer-device = "vi.1";
+                                       };
+                                       c4 {
+                                            regulator-consumer-supply = "pwrdet_mipi";
+                                       };
+                                       c5 {
+                                            regulator-consumer-supply = "avdd_hsic_com";
+                                       };
+                                       c6 {
+                                            regulator-consumer-supply = "avdd_hsic_mdm";
+                                       };
+                                       c7 {
+                                            regulator-consumer-supply = "vddio_hsic";
+                                            regulator-consumer-device = "tegra-ehci.1";
+                                       };
+                                       c8 {
+                                            regulator-consumer-supply = "vddio_hsic";
+                                            regulator-consumer-device = "tegra-ehci.2";
+                                       };
+                                       c9 {
+                                            regulator-consumer-supply = "vddio_hsic";
+                                            regulator-consumer-device = "tegra-xhci";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo3: ldo3 {
+                                    regulator-name = "vdd-rtc";
+                                    regulator-min-microvolt = <800000>;
+                                    regulator-max-microvolt = <800000>;
+                                    regulator-always-on;
+                                    regulator-boot-on;
+                                    ams,enable-tracking;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vdd_rtc";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo4: ldo4 {
+                                    regulator-name = "avdd-cam";
+                                    regulator-min-microvolt = <2700000>;
+                                    regulator-max-microvolt = <2700000>;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vdd_2v7_hv";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "avdd_cam2_cam";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "vana";
+                                            regulator-consumer-device = "2-0010";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo5: ldo5 {
+                                    regulator-name = "vdd-1v2-cam";
+                                    regulator-min-microvolt = <1200000>;
+                                    regulator-max-microvolt = <1200000>;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vdd_1v2_cam";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "vdig";
+                                            regulator-consumer-device = "2-0010";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "vdig";
+                                            regulator-consumer-device = "2-0036";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo6: ldo6 {
+                                    regulator-name = "vddio-sdmmc2";
+                                    regulator-min-microvolt = <1800000>;
+                                    regulator-max-microvolt = <3300000>;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vddio_sdmmc";
+                                            regulator-consumer-device = "sdhci-tegra.2";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "pwrdet_sdmmc3";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo7: ldo7 {
+                                    regulator-name = "vdd-v1275-cam";
+                                    regulator-min-microvolt = <1275000>;
+                                    regulator-max-microvolt = <1275000>;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "vdd_cam_1v1_cam";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "imx135_reg2";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "vdig_lv";
+                                            regulator-consumer-device = "2-0010";
+                                       };
+                                       c3 {
+                                            regulator-consumer-supply = "dvdd";
+                                            regulator-consumer-device = "2-0010";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo9: ldo9 {
+                                    regulator-name = "avdd-spi";
+                                    regulator-min-microvolt = <3300000>;
+                                    regulator-max-microvolt = <3300000>;
+                                    regulator-boot-on;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "avdd";
+                                            regulator-consumer-device = "spi0.0";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "avdd";
+                                            regulator-consumer-device = "spi2.1";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo10: ldo10 {
+                                     regulator-name = "vdd-2v7-cam";
+                                     regulator-min-microvolt = <2700000>;
+                                     regulator-max-microvolt = <2700000>;
+
+                                    consumers {
+                                       c0 {
+                                            regulator-consumer-supply = "avdd_af1_cam";
+                                       };
+                                       c1 {
+                                            regulator-consumer-supply = "avdd_cam1_cam";
+                                       };
+                                       c2 {
+                                            regulator-consumer-supply = "imx135_reg1";
+                                       };
+                                       c3 {
+                                            regulator-consumer-supply = "vdd";
+                                            regulator-consumer-device = "2-000e";
+                                       };
+                                       c4 {
+                                            regulator-consumer-supply = "vana";
+                                            regulator-consumer-device = "2-0036";
+                                       };
+                                       c5 {
+                                            regulator-consumer-supply = "vdd";
+                                            regulator-consumer-device = "2-000c";
+                                       };
+                                   };
+                               };
+
+                               as3722_ldo11: ldo11 {
+                                     regulator-name = "vpp-fuse";
+                                     regulator-min-microvolt = <1800000>;
+                                     regulator-max-microvolt = <1800000>;
+                               };
+                       };
+               };
+       };
+
+       i2c@7000c000 {
+               tca6416: gpio@20 {
+                        compatible = "ti,tca6416";
+                        reg = <0x20>;
+                        gpio-controller;
+                       #gpio-cells = <2>;
+                };
+       };
+
+       /* Populate fuse supply */
+       efuse@7000f800 {
+               vpp_fuse-supply = <&as3722_ldo11>;
+       };
+};
index 60216a3..9e7eab0 100644 (file)
 #include <linux/platform_device.h>
 #include <linux/resource.h>
 #include <linux/io.h>
-#include <linux/regulator/machine.h>
-#include <linux/regulator/driver.h>
-#include <linux/regulator/fixed.h>
-#include <linux/mfd/as3722-plat.h>
 #include <linux/gpio.h>
-#include <linux/regulator/userspace-consumer.h>
 #include <linux/pid_thermal_gov.h>
 #include <linux/tegra-fuse.h>
 
 
 #include "cpu-tegra.h"
 #include "pm.h"
+#include "pmc.h"
 #include "tegra-board-id.h"
 #include "board.h"
 #include "gpio-names.h"
 #include "board-common.h"
-#include "board-pmu-defines.h"
 #include "board-ardbeg.h"
 #include "tegra_cl_dvfs.h"
 #include "devices.h"
 #include "iomap.h"
 #include "tegra3_tsensor.h"
 
-#define PMC_CTRL               0x0
-#define PMC_CTRL_INTR_LOW      (1 << 17)
-#define AS3722_SUPPLY(_name)   "as3722_"#_name
-
-static struct regulator_consumer_supply as3722_ldo0_supply[] = {
-       REGULATOR_SUPPLY("avdd_pll_m", NULL),
-       REGULATOR_SUPPLY("avdd_pll_ap_c2_c3", NULL),
-       REGULATOR_SUPPLY("avdd_pll_cud2dpd", NULL),
-       REGULATOR_SUPPLY("avdd_pll_c4", NULL),
-       REGULATOR_SUPPLY("avdd_lvds0_io", NULL),
-       REGULATOR_SUPPLY("vddio_ddr_hs", NULL),
-       REGULATOR_SUPPLY("avdd_pll_erefe", NULL),
-       REGULATOR_SUPPLY("avdd_pll_x", NULL),
-       REGULATOR_SUPPLY("avdd_pll_cg", NULL),
-};
-
-static struct regulator_consumer_supply as3722_ldo1_supply[] = {
-       REGULATOR_SUPPLY("vddio_cam", "vi"),
-       REGULATOR_SUPPLY("pwrdet_cam", NULL),
-       REGULATOR_SUPPLY("vdd_cam_1v8_cam", NULL),
-       REGULATOR_SUPPLY("vif", "2-0010"),
-       REGULATOR_SUPPLY("vdd_i2c", "2-000e"),
-       REGULATOR_SUPPLY("vif", "2-0036"),
-       REGULATOR_SUPPLY("vdd_i2c", "2-000c"),
-       REGULATOR_SUPPLY("vi2c", "2-0030"),
-};
-
-static struct regulator_consumer_supply as3722_ldo2_supply[] = {
-       REGULATOR_SUPPLY("avdd_dsi_csi", "tegradc.0"),
-       REGULATOR_SUPPLY("avdd_dsi_csi", "tegradc.1"),
-       REGULATOR_SUPPLY("avdd_dsi_csi", "vi.0"),
-       REGULATOR_SUPPLY("avdd_dsi_csi", "vi.1"),
-       REGULATOR_SUPPLY("pwrdet_mipi", NULL),
-       REGULATOR_SUPPLY("avdd_hsic_com", NULL),
-       REGULATOR_SUPPLY("avdd_hsic_mdm", NULL),
-       REGULATOR_SUPPLY("vddio_hsic", "tegra-ehci.1"),
-       REGULATOR_SUPPLY("vddio_hsic", "tegra-ehci.2"),
-       REGULATOR_SUPPLY("vddio_hsic", "tegra-xhci"),
-};
-
-static struct regulator_consumer_supply as3722_ldo3_supply[] = {
-       REGULATOR_SUPPLY("vdd_rtc", NULL),
-};
-
-static struct regulator_consumer_supply as3722_ldo4_supply[] = {
-       REGULATOR_SUPPLY("vdd_2v7_hv", NULL),
-       REGULATOR_SUPPLY("avdd_cam2_cam", NULL),
-       REGULATOR_SUPPLY("vana", "2-0010"),
-};
-
-static struct regulator_consumer_supply as3722_ldo5_supply[] = {
-       REGULATOR_SUPPLY("vdd_1v2_cam", NULL),
-       REGULATOR_SUPPLY("vdig", "2-0010"),
-       REGULATOR_SUPPLY("vdig", "2-0036"),
-};
-
-static struct regulator_consumer_supply as3722_ldo6_supply[] = {
-       REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.2"),
-       REGULATOR_SUPPLY("pwrdet_sdmmc3", NULL),
-};
-
-static struct regulator_consumer_supply as3722_ldo7_supply[] = {
-       REGULATOR_SUPPLY("vdd_cam_1v1_cam", NULL),
-       REGULATOR_SUPPLY("imx135_reg2", NULL),
-       REGULATOR_SUPPLY("vdig_lv", "2-0010"),
-       REGULATOR_SUPPLY("dvdd", "2-0010"),
-};
-
-static struct regulator_consumer_supply as3722_ldo9_supply[] = {
-       REGULATOR_SUPPLY("avdd", "spi0.0"),
-       REGULATOR_SUPPLY("avdd", "spi2.1"),
-};
-
-static struct regulator_consumer_supply as3722_ldo10_supply[] = {
-       REGULATOR_SUPPLY("avdd_af1_cam", NULL),
-       REGULATOR_SUPPLY("avdd_cam1_cam", NULL),
-       REGULATOR_SUPPLY("imx135_reg1", NULL),
-       REGULATOR_SUPPLY("vdd", "2-000e"),
-       REGULATOR_SUPPLY("vana", "2-0036"),
-       REGULATOR_SUPPLY("vdd", "2-000c"),
-};
-
-static struct regulator_consumer_supply as3722_ldo11_supply[] = {
-       REGULATOR_SUPPLY("vpp_fuse", NULL),
-};
-
-static struct regulator_consumer_supply as3722_sd0_supply[] = {
-       REGULATOR_SUPPLY("vdd_cpu", NULL),
-};
-
-static struct regulator_consumer_supply as3722_sd1_supply[] = {
-       REGULATOR_SUPPLY("vdd_core", NULL),
-};
-
-static struct regulator_consumer_supply as3722_sd2_supply[] = {
-       REGULATOR_SUPPLY("vddio_ddr", NULL),
-       REGULATOR_SUPPLY("vddio_ddr_mclk", NULL),
-       REGULATOR_SUPPLY("vddio_ddr3", NULL),
-       REGULATOR_SUPPLY("vcore1_ddr3", NULL),
-};
-
-static struct regulator_consumer_supply as3722_sd4_supply[] = {
-       REGULATOR_SUPPLY("avdd_pex_pll", NULL),
-       REGULATOR_SUPPLY("avddio_pex_pll", NULL),
-       REGULATOR_SUPPLY("dvddio_pex", NULL),
-       REGULATOR_SUPPLY("pwrdet_pex_ctl", NULL),
-       REGULATOR_SUPPLY("avdd_sata", NULL),
-       REGULATOR_SUPPLY("vdd_sata", NULL),
-       REGULATOR_SUPPLY("avdd_sata_pll", NULL),
-       REGULATOR_SUPPLY("avddio_usb", "tegra-xhci"),
-       REGULATOR_SUPPLY("avdd_hdmi", "tegradc.1"),
-};
-
-static struct regulator_consumer_supply as3722_sd5_supply[] = {
-       REGULATOR_SUPPLY("vddio_sys", NULL),
-       REGULATOR_SUPPLY("vddio_sys_2", NULL),
-       REGULATOR_SUPPLY("vddio_audio", NULL),
-       REGULATOR_SUPPLY("pwrdet_audio", NULL),
-       REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.0"),
-       REGULATOR_SUPPLY("pwrdet_sdmmc1", NULL),
-       REGULATOR_SUPPLY("vddio_sdmmc", "sdhci-tegra.3"),
-       REGULATOR_SUPPLY("pwrdet_sdmmc4", NULL),
-       REGULATOR_SUPPLY("vddio_uart", NULL),
-       REGULATOR_SUPPLY("pwrdet_uart", NULL),
-       REGULATOR_SUPPLY("vddio_bb", NULL),
-       REGULATOR_SUPPLY("pwrdet_bb", NULL),
-       REGULATOR_SUPPLY("vddio_gmi", NULL),
-       REGULATOR_SUPPLY("pwrdet_nand", NULL),
-       REGULATOR_SUPPLY("avdd_osc", NULL),
-       /* emmc 1.8v misssing
-       keyboard & touchpad 1.8v missing */
-};
-
-static struct regulator_consumer_supply as3722_sd6_supply[] = {
-       REGULATOR_SUPPLY("vdd_gpu", NULL),
-};
-
-AMS_PDATA_INIT(sd0, NULL, 700000, 1400000, 1, 1, 1,
-              AS3722_EXT_CONTROL_ENABLE2);
-AMS_PDATA_INIT(sd1, NULL, 700000, 1350000, 1, 1, 1,
-              AS3722_EXT_CONTROL_ENABLE1);
-AMS_PDATA_INIT(sd2, NULL, 1350000, 1350000, 1, 1, 1, 0);
-AMS_PDATA_INIT(sd4, NULL, 1050000, 1050000, 1, 1, 1,
-              AS3722_EXT_CONTROL_ENABLE1);
-AMS_PDATA_INIT(sd5, NULL, 1800000, 1800000, 1, 1, 1, 0);
-AMS_PDATA_INIT(sd6, NULL, 650000, 1200000, 0, 1, 1, 0);
-AMS_PDATA_INIT(ldo0, AS3722_SUPPLY(sd2), 1050000, 1250000, 1, 1, 1,
-              AS3722_EXT_CONTROL_ENABLE1);
-AMS_PDATA_INIT(ldo1, NULL, 1800000, 1800000, 0, 1, 1, 0);
-AMS_PDATA_INIT(ldo2, AS3722_SUPPLY(sd5), 1200000, 1200000, 0, 1, 1, 0);
-AMS_PDATA_INIT(ldo3, NULL, 800000, 800000, 1, 1, 1, 0);
-AMS_PDATA_INIT(ldo4, NULL, 2700000, 2700000, 0, 0, 1, 0);
-AMS_PDATA_INIT(ldo5, AS3722_SUPPLY(sd5), 1200000, 1200000, 0, 0, 1, 0);
-AMS_PDATA_INIT(ldo6, NULL, 1800000, 3300000, 0, 0, 1, 0);
-AMS_PDATA_INIT(ldo7, AS3722_SUPPLY(sd5), 1275000, 1275000, 0, 0, 1, 0);
-AMS_PDATA_INIT(ldo9, NULL, 3300000, 3300000, 0, 1, 1, 0);
-AMS_PDATA_INIT(ldo10, NULL, 2700000, 2700000, 0, 0, 1, 0);
-AMS_PDATA_INIT(ldo11, NULL, 1800000, 1800000, 0, 0, 1, 0);
-
-static struct as3722_pinctrl_platform_data as3722_pctrl_pdata[] = {
-       AS3722_PIN_CONTROL("gpio0", "gpio", NULL, NULL, NULL, "output-low"),
-       AS3722_PIN_CONTROL("gpio1", "gpio", NULL, NULL, NULL, "output-high"),
-       AS3722_PIN_CONTROL("gpio2", "gpio", NULL, NULL, NULL, "output-high"),
-       AS3722_PIN_CONTROL("gpio3", "gpio", NULL, NULL, "enabled", NULL),
-       AS3722_PIN_CONTROL("gpio4", "gpio", NULL, NULL, NULL, "output-high"),
-       AS3722_PIN_CONTROL("gpio5", "clk32k-out", NULL, NULL, NULL, NULL),
-       AS3722_PIN_CONTROL("gpio6", "gpio", NULL, NULL, "enabled", NULL),
-       AS3722_PIN_CONTROL("gpio7", "gpio", NULL, NULL, NULL, "output-high"),
-};
-
-static struct as3722_adc_extcon_platform_data as3722_adc_extcon_pdata = {
-       .connection_name = "as3722-extcon",
-       .enable_adc1_continuous_mode = true,
-       .enable_low_voltage_range = true,
-       .adc_channel = 12,
-       .hi_threshold =  0x100,
-       .low_threshold = 0x80,
-};
-
-static struct as3722_platform_data as3722_pdata = {
-       .reg_pdata[AS3722_LDO0] = &as3722_ldo0_reg_pdata,
-       .reg_pdata[AS3722_LDO1] = &as3722_ldo1_reg_pdata,
-       .reg_pdata[AS3722_LDO2] = &as3722_ldo2_reg_pdata,
-       .reg_pdata[AS3722_LDO3] = &as3722_ldo3_reg_pdata,
-       .reg_pdata[AS3722_LDO4] = &as3722_ldo4_reg_pdata,
-       .reg_pdata[AS3722_LDO5] = &as3722_ldo5_reg_pdata,
-       .reg_pdata[AS3722_LDO6] = &as3722_ldo6_reg_pdata,
-       .reg_pdata[AS3722_LDO7] = &as3722_ldo7_reg_pdata,
-       .reg_pdata[AS3722_LDO9] = &as3722_ldo9_reg_pdata,
-       .reg_pdata[AS3722_LDO10] = &as3722_ldo10_reg_pdata,
-       .reg_pdata[AS3722_LDO11] = &as3722_ldo11_reg_pdata,
-
-       .reg_pdata[AS3722_SD0] = &as3722_sd0_reg_pdata,
-       .reg_pdata[AS3722_SD1] = &as3722_sd1_reg_pdata,
-       .reg_pdata[AS3722_SD2] = &as3722_sd2_reg_pdata,
-       .reg_pdata[AS3722_SD4] = &as3722_sd4_reg_pdata,
-       .reg_pdata[AS3722_SD5] = &as3722_sd5_reg_pdata,
-       .reg_pdata[AS3722_SD6] = &as3722_sd6_reg_pdata,
-
-       .gpio_base = AS3722_GPIO_BASE,
-       .irq_base = AS3722_IRQ_BASE,
-       .use_internal_int_pullup = 0,
-       .use_internal_i2c_pullup = 0,
-       .pinctrl_pdata = as3722_pctrl_pdata,
-       .num_pinctrl = ARRAY_SIZE(as3722_pctrl_pdata),
-       .enable_clk32k_out = true,
-       .use_power_off = true,
-       .extcon_pdata = &as3722_adc_extcon_pdata,
-       .major_rev = 1,
-       .minor_rev = 1,
-};
-
-static struct i2c_board_info __initdata as3722_regulators[] = {
-       {
-               I2C_BOARD_INFO("as3722", 0x40),
-               .flags = I2C_CLIENT_WAKE,
-               .irq = INT_EXTERNAL_PMU,
-               .platform_data = &as3722_pdata,
-       },
-};
-
 int __init norrin_as3722_regulator_init(void)
 {
-       void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
-       u32 pmc_ctrl;
-       struct board_info board_info;
-
-       tegra_get_board_info(&board_info);
-
-       /* AS3722: Normal state of INT request line is LOW.
-        * configure the power management controller to trigger PMU
-        * interrupts when HIGH.
-        */
-       pmc_ctrl = readl(pmc + PMC_CTRL);
-       writel(pmc_ctrl | PMC_CTRL_INTR_LOW, pmc + PMC_CTRL);
-       regulator_has_full_constraints();
-       /* Set vdd_gpu init uV to 1V */
-       as3722_sd6_reg_idata.constraints.init_uV = 1000000;
-
-       /* Set overcurrent of rails. */
-       as3722_sd6_reg_idata.constraints.min_uA = 3500000;
-       as3722_sd6_reg_idata.constraints.max_uA = 3500000;
-
-       as3722_sd0_reg_idata.constraints.min_uA = 3500000;
-       as3722_sd0_reg_idata.constraints.max_uA = 3500000;
-
-       as3722_sd1_reg_idata.constraints.min_uA = 2500000;
-       as3722_sd1_reg_idata.constraints.max_uA = 2500000;
-
-       as3722_ldo3_reg_pdata.enable_tracking = true;
-       as3722_ldo3_reg_pdata.disable_tracking_suspend = true;
-
-       if ((board_info.board_id == BOARD_PM374) &&
-                               (board_info.fab == BOARD_FAB_B))
-               as3722_pdata.minor_rev = 2;
-       pr_info("%s: i2c_register_board_info\n", __func__);
-       i2c_register_board_info(4, as3722_regulators,
-                       ARRAY_SIZE(as3722_regulators));
+       tegra_pmc_pmu_interrupt_polarity(true);
        return 0;
 }
 
@@ -408,315 +148,6 @@ static int __init norrin_cl_dvfs_init(void)
 }
 #endif
 
-/* Always ON /Battery regulator */
-static struct regulator_consumer_supply fixed_reg_battery_supply[] = {
-       REGULATOR_SUPPLY("vdd_sys_bl", NULL),
-       REGULATOR_SUPPLY("vddio_pex_sata", "tegra-sata.0"),
-};
-
-/* Always ON 1.8v */
-static struct regulator_consumer_supply fixed_reg_aon_1v8_supply[] = {
-       REGULATOR_SUPPLY("vdd_1v8_emmc", NULL),
-       REGULATOR_SUPPLY("vdd_1v8b_com_f", NULL),
-       REGULATOR_SUPPLY("vdd_1v8b_gps_f", NULL),
-       REGULATOR_SUPPLY("vdd", "0-004c"),
-};
-
-/* Always ON 3.3v */
-static struct regulator_consumer_supply fixed_reg_aon_3v3_supply[] = {
-       REGULATOR_SUPPLY("vdd_3v3_emmc", NULL),
-       REGULATOR_SUPPLY("vdd_com_3v3", NULL),
-};
-
-/* Always ON 1v2 */
-static struct regulator_consumer_supply fixed_reg_aon_1v2_supply[] = {
-       REGULATOR_SUPPLY("vdd_1v2_bb_hsic", NULL),
-};
-
-/* EN_USB0_VBUS From TEGRA GPIO PN4 */
-static struct regulator_consumer_supply fixed_reg_usb0_vbus_supply[] = {
-       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.0"),
-       REGULATOR_SUPPLY("usb_vbus", "tegra-otg"),
-       REGULATOR_SUPPLY("usb_vbus0", "tegra-xhci"),
-};
-
-/* EN_USB1_USB2_VBUS From TEGRA GPIO PN5 */
-static struct regulator_consumer_supply fixed_reg_usb1_usb2_vbus_supply[] = {
-       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.1"),
-       REGULATOR_SUPPLY("usb_vbus1", "tegra-xhci"),
-       REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.2"),
-       REGULATOR_SUPPLY("usb_vbus2", "tegra-xhci"),
-};
-
-/* Gated by GPIO_PK6 */
-static struct regulator_consumer_supply fixed_reg_vdd_hdmi_5v0_supply[] = {
-       REGULATOR_SUPPLY("vdd_hdmi_5v0", "tegradc.1"),
-};
-
-/* Gated by GPIO_PH7 */
-static struct regulator_consumer_supply fixed_reg_vdd_hdmi_supply[] = {
-       REGULATOR_SUPPLY("avdd_hdmi_pll", "tegradc.1"),
-};
-
-/* VDD_LCD_BL DAP3_DOUT */
-static struct regulator_consumer_supply fixed_reg_vdd_lcd_bl_supply[] = {
-       REGULATOR_SUPPLY("vdd_lcd_bl", NULL),
-};
-
-/* LCD_BL_EN GMI_AD10 */
-static struct regulator_consumer_supply fixed_reg_lcd_bl_en_supply[] = {
-       REGULATOR_SUPPLY("vdd_lcd_bl_en", NULL),
-};
-
-/* AS3722 GPIO1*/
-static struct regulator_consumer_supply fixed_reg_3v3_supply[] = {
-       REGULATOR_SUPPLY("hvdd_pex", NULL),
-       REGULATOR_SUPPLY("hvdd_pex_pll", NULL),
-       REGULATOR_SUPPLY("vdd_sys_cam_3v3", NULL),
-       REGULATOR_SUPPLY("micvdd", "tegra-snd-rt5645.0"),
-       REGULATOR_SUPPLY("micvdd", "tegra-snd-rt5639.0"),
-       REGULATOR_SUPPLY("vdd_gps_3v3", NULL),
-       REGULATOR_SUPPLY("vdd_nfc_3v3", NULL),
-       REGULATOR_SUPPLY("vdd_3v3_sensor", NULL),
-       REGULATOR_SUPPLY("vdd_kp_3v3", NULL),
-       REGULATOR_SUPPLY("vdd_tp_3v3", NULL),
-       REGULATOR_SUPPLY("vdd_dtv_3v3", NULL),
-       REGULATOR_SUPPLY("vdd_modem_3v3", NULL),
-       REGULATOR_SUPPLY("vdd", "0-0048"),
-       REGULATOR_SUPPLY("vdd", "0-0069"),
-       REGULATOR_SUPPLY("vdd", "0-000c"),
-       REGULATOR_SUPPLY("vdd", "0-0077"),
-       REGULATOR_SUPPLY("vin", "2-0030"),
-};
-
-/* AS3722 GPIO1*/
-static struct regulator_consumer_supply fixed_reg_5v0_supply[] = {
-       REGULATOR_SUPPLY("spkvdd", "tegra-snd-rt5645.0"),
-       REGULATOR_SUPPLY("spkvdd", "tegra-snd-rt5639.0"),
-       REGULATOR_SUPPLY("vdd_5v0_sensor", NULL),
-};
-
-static struct regulator_consumer_supply fixed_reg_dcdc_1v8_supply[] = {
-       REGULATOR_SUPPLY("avdd_lvds0_pll", NULL),
-       REGULATOR_SUPPLY("dvdd_lcd", NULL),
-       REGULATOR_SUPPLY("vdd_ds_1v8", NULL),
-       REGULATOR_SUPPLY("avdd", "tegra-snd-rt5645.0"),
-       REGULATOR_SUPPLY("dbvdd", "tegra-snd-rt5645.0"),
-       REGULATOR_SUPPLY("avdd", "tegra-snd-rt5639.0"),
-       REGULATOR_SUPPLY("dbvdd", "tegra-snd-rt5639.0"),
-       REGULATOR_SUPPLY("dmicvdd", "tegra-snd-rt5639.0"),
-       REGULATOR_SUPPLY("dmicvdd", "tegra-snd-rt5645.0"),
-       REGULATOR_SUPPLY("vdd_1v8b_nfc", NULL),
-       REGULATOR_SUPPLY("vdd_1v8_sensor", NULL),
-       REGULATOR_SUPPLY("vdd_1v8_sdmmc", NULL),
-       REGULATOR_SUPPLY("vdd_kp_1v8", NULL),
-       REGULATOR_SUPPLY("vdd_tp_1v8", NULL),
-       REGULATOR_SUPPLY("vdd_modem_1v8", NULL),
-       REGULATOR_SUPPLY("vdd_1v8b", "0-0048"),
-       REGULATOR_SUPPLY("dvdd", "spi0.0"),
-       REGULATOR_SUPPLY("dvdd", "spi2.1"),
-       REGULATOR_SUPPLY("vlogic", "0-0069"),
-       REGULATOR_SUPPLY("vid", "0-000c"),
-       REGULATOR_SUPPLY("vddio", "0-0077"),
-       REGULATOR_SUPPLY("avdd_pll_utmip", "tegra-udc.0"),
-       REGULATOR_SUPPLY("avdd_pll_utmip", "tegra-ehci.0"),
-       REGULATOR_SUPPLY("avdd_pll_utmip", "tegra-ehci.1"),
-       REGULATOR_SUPPLY("avdd_pll_utmip", "tegra-ehci.2"),
-       REGULATOR_SUPPLY("avdd_pll_utmip", "tegra-xhci"),
-};
-
-/* gated by TCA6416 GPIO EXP GPIO0 */
-static struct regulator_consumer_supply fixed_reg_dcdc_1v2_supply[] = {
-       REGULATOR_SUPPLY("vdd_1v2_en", NULL),
-};
-
-/* AMS GPIO2 */
-static struct regulator_consumer_supply fixed_reg_as3722_gpio2_supply[] = {
-       REGULATOR_SUPPLY("avdd_usb", "tegra-udc.0"),
-       REGULATOR_SUPPLY("avdd_usb", "tegra-ehci.0"),
-       REGULATOR_SUPPLY("avdd_usb", "tegra-ehci.1"),
-       REGULATOR_SUPPLY("avdd_usb", "tegra-ehci.2"),
-       REGULATOR_SUPPLY("hvdd_usb", "tegra-xhci"),
-       REGULATOR_SUPPLY("vddio_hv", "tegradc.1"),
-       REGULATOR_SUPPLY("pwrdet_hv", NULL),
-       REGULATOR_SUPPLY("hvdd_sata", NULL),
-};
-
-/* gated by AS3722 GPIO4 */
-static struct regulator_consumer_supply fixed_reg_lcd_supply[] = {
-       REGULATOR_SUPPLY("avdd_lcd", NULL),
-};
-
-/* gated by GPIO_PR0 */
-static struct regulator_consumer_supply fixed_reg_sdmmc_en_supply[] = {
-       REGULATOR_SUPPLY("vddio_sd_slot", "sdhci-tegra.1"),
-       REGULATOR_SUPPLY("vddio_sd_slot", "sdhci-tegra.2"),
-};
-
-static struct regulator_consumer_supply fixed_reg_vdd_cdc_1v2_aud_supply[] = {
-       REGULATOR_SUPPLY("ldoen", "tegra-snd-rt5639.0"),
-};
-
-static struct regulator_consumer_supply fixed_reg_vdd_amp_shut_aud_supply[] = {
-       REGULATOR_SUPPLY("epamp", "tegra-snd-rt5645.0"),
-};
-
-static struct regulator_consumer_supply fixed_reg_vdd_dsi_mux_supply[] = {
-       REGULATOR_SUPPLY("vdd_3v3_dsi", "NULL"),
-};
-
-/* Macro for defining fixed regulator sub device data */
-#define FIXED_SUPPLY(_name) "fixed_reg_"#_name
-#define FIXED_REG(_id, _var, _name, _in_supply,                        \
-       _always_on, _boot_on, _gpio_nr, _open_drain,            \
-       _active_high, _boot_state, _millivolts, _sdelay)        \
-static struct regulator_init_data ri_data_##_var =             \
-{                                                              \
-       .supply_regulator = _in_supply,                         \
-       .num_consumer_supplies =                                \
-       ARRAY_SIZE(fixed_reg_##_name##_supply),                 \
-       .consumer_supplies = fixed_reg_##_name##_supply,        \
-       .constraints = {                                        \
-               .valid_modes_mask = (REGULATOR_MODE_NORMAL |    \
-                               REGULATOR_MODE_STANDBY),        \
-               .valid_ops_mask = (REGULATOR_CHANGE_MODE |      \
-                               REGULATOR_CHANGE_STATUS |       \
-                               REGULATOR_CHANGE_VOLTAGE),      \
-               .always_on = _always_on,                        \
-               .boot_on = _boot_on,                            \
-       },                                                      \
-};                                                             \
-static struct fixed_voltage_config fixed_reg_##_var##_pdata =  \
-{                                                              \
-       .supply_name = FIXED_SUPPLY(_name),                     \
-       .microvolts = _millivolts * 1000,                       \
-       .gpio = _gpio_nr,                                       \
-       .gpio_is_open_drain = _open_drain,                      \
-       .enable_high = _active_high,                            \
-       .enabled_at_boot = _boot_state,                         \
-       .init_data = &ri_data_##_var,                           \
-       .startup_delay = _sdelay,                               \
-};                                                             \
-static struct platform_device fixed_reg_##_var##_dev = {       \
-       .name = "reg-fixed-voltage",                            \
-       .id = _id,                                              \
-       .dev = {                                                \
-               .platform_data = &fixed_reg_##_var##_pdata,     \
-       },                                                      \
-}
-
-FIXED_REG(0,   battery,        battery,        NULL,   0,      0,
-               -1,     false, true,    0,      8400,   0);
-
-FIXED_REG(1,   aon_1v8,        aon_1v8,        NULL,   0,      0,
-               -1,     false, true,    0,      1800,   0);
-
-FIXED_REG(2,   aon_3v3,        aon_3v3,        NULL,   0,      0,
-               -1,     false, true,    0,      3300,   0);
-
-FIXED_REG(3,   aon_1v2,        aon_1v2,        NULL,   0,      0,
-               -1,     false, true,    0,      1200,   0);
-
-FIXED_REG(4,   vdd_hdmi_5v0,   vdd_hdmi_5v0,   NULL,   0,      0,
-               TEGRA_GPIO_PK6, false,  true,   0,      5000,   5000);
-
-FIXED_REG(5,   vdd_hdmi,       vdd_hdmi,       AS3722_SUPPLY(sd4),
-               0,      0,
-               TEGRA_GPIO_PH7, false,  false,  0,      3300,   0);
-
-FIXED_REG(6,   usb0_vbus,      usb0_vbus,      NULL,   0,      0,
-               TEGRA_GPIO_PN4, true,   true,   0,      5000,   0);
-
-FIXED_REG(7,   usb1_usb2_vbus, usb1_usb2_vbus, NULL,   0,      0,
-               TEGRA_GPIO_PN5, true,   true,   0,      5000, 0);
-
-FIXED_REG(8,   vdd_lcd_bl,     vdd_lcd_bl,     NULL,   0,      0,
-               TEGRA_GPIO_PP2, false,  true,   0,      3300, 0);
-
-FIXED_REG(9,   lcd_bl_en,      lcd_bl_en,      NULL,   0,      0,
-               TEGRA_GPIO_PH2, false,  true,   0,      5000,   0);
-
-FIXED_REG(10,  3v3,            3v3,            NULL,   0,      0,
-               -1,     false,  true,   0,      3300,   0);
-
-FIXED_REG(11,  5v0,            5v0,            NULL,   0,      0,
-               -1,     false,  true,   0,      5000,   0);
-
-FIXED_REG(12,  dcdc_1v8,       dcdc_1v8,       NULL,   0,      0,
-               -1,     false,  true,   0,      1800,   0);
-
-FIXED_REG(13,   dcdc_1v2,      dcdc_1v2,       NULL,   0,      0,
-               PMU_TCA6416_GPIO_BASE,  false,  true,   0,      1200,
-               0);
-
-FIXED_REG(14,  as3722_gpio2,   as3722_gpio2,           NULL,   0,      true,
-               AS3722_GPIO_BASE + AS3722_GPIO2,        false,  true,   true,
-               3300,   0);
-
-FIXED_REG(15,  lcd,            lcd,            NULL,   0,      0,
-               AS3722_GPIO_BASE + AS3722_GPIO4,        false,  true,   0,
-               3300,   0);
-
-FIXED_REG(16,  sdmmc_en,       sdmmc_en,       NULL,   0,      0,
-               TEGRA_GPIO_PR0, false,  true,   0,      3300,   0);
-
-FIXED_REG(17,  vdd_cdc_1v2_aud,        vdd_cdc_1v2_aud,        NULL,   0,
-               0,      PMU_TCA6416_GPIO(2),    false,  true,   0,
-               1200,   250000);
-
-FIXED_REG(18,  vdd_amp_shut_aud,       vdd_amp_shut_aud,       NULL,   0,
-               0,      PMU_TCA6416_GPIO(3),    false,  true,   0,
-               1200,   0);
-
-FIXED_REG(19,  vdd_dsi_mux,            vdd_dsi_mux,    NULL,   0,      0,
-               PMU_TCA6416_GPIO(13),   false,  true,   0,      3300,   0);
-
-/*
- * Creating the fixed regulator device tables
- */
-
-#define ADD_FIXED_REG(_name)    (&fixed_reg_##_name##_dev)
-
-#define NORRIN_COMMON_FIXED_REG                        \
-       ADD_FIXED_REG(battery),                 \
-       ADD_FIXED_REG(aon_1v8),                 \
-       ADD_FIXED_REG(aon_3v3),                 \
-       ADD_FIXED_REG(aon_1v2),                 \
-       ADD_FIXED_REG(vdd_hdmi_5v0),            \
-       ADD_FIXED_REG(vdd_hdmi),                \
-       ADD_FIXED_REG(vdd_lcd_bl),              \
-       ADD_FIXED_REG(lcd_bl_en),               \
-       ADD_FIXED_REG(3v3),                     \
-       ADD_FIXED_REG(5v0),                     \
-       ADD_FIXED_REG(dcdc_1v8),                \
-       ADD_FIXED_REG(as3722_gpio2),            \
-       ADD_FIXED_REG(lcd),                     \
-       ADD_FIXED_REG(sdmmc_en),                \
-       ADD_FIXED_REG(usb0_vbus),               \
-       ADD_FIXED_REG(usb1_usb2_vbus),          \
-       ADD_FIXED_REG(dcdc_1v2),                \
-       ADD_FIXED_REG(vdd_cdc_1v2_aud),         \
-       ADD_FIXED_REG(vdd_amp_shut_aud),        \
-       ADD_FIXED_REG(vdd_dsi_mux)
-
-/* Gpio switch regulator platform data for Norrin ERS*/
-static struct platform_device *fixed_reg_devs[] = {
-       NORRIN_COMMON_FIXED_REG,
-};
-
-static int __init norrin_fixed_regulator_init(void)
-{
-       if (!of_machine_is_compatible("nvidia,norrin"))
-               return 0;
-
-       return platform_add_devices(fixed_reg_devs,
-                       ARRAY_SIZE(fixed_reg_devs));
-
-       return 0;
-}
-
-subsys_initcall_sync(norrin_fixed_regulator_init);
-
 int __init norrin_regulator_init(void)
 {
 
index 8cfc3cf..88cc65a 100644 (file)
@@ -6,4 +6,11 @@
        nvidia,boardids = "374:0001:00";
        nvidia,dtsfilename = __FILE__;
        nvidia,proc-boardid = "374:0001:00";
+
+       i2c@7000d000 {
+               as3722@40 {
+                       ams,major-rev = <1>;
+                       ams,minor-rev = <1>;
+               };
+       };
 };
\ No newline at end of file
index bf45430..37a86ee 100644 (file)
@@ -6,4 +6,11 @@
        nvidia,boardids = "374:0001:01";
        nvidia,dtsfilename = __FILE__;
        nvidia,proc-boardid = "374:0001:01";
+
+       i2c@7000d000 {
+               as3722@40 {
+                       ams,major-rev = <1>;
+                       ams,minor-rev = <2>;
+               };
+       };
 };
\ No newline at end of file
index f4c07e7..dbd5244 100644 (file)
@@ -2,6 +2,8 @@
 #include "tegra124-platforms/tegra124-pm374-gpio-default.dtsi"
 #include "tegra124-platforms/tegra124-pm374-pinmux.dtsi"
 #include "tegra124-platforms/tegra124-norrin-keys-pm374-0000-a00.dtsi"
+#include "tegra124-platforms/tegra124-norrin-fixed-pm374-0000-a00.dtsi"
+#include "tegra124-platforms/tegra124-norrin-pmic-pm374-0000-a00.dtsi"
 
 / {
        model = "norrin";