ARM: tegra: add machine check for fix reg init
Bibek Basu [Mon, 27 May 2013 23:10:50 +0000 (16:10 -0700)]
add machine check before registering the
fixed regulator for various boards

Bug 1275005

Change-Id: Id0a1ed53c8db02ad61f2933fe9067d83106cebed
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/236376
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Tested-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Chao Xu <cxu@nvidia.com>

arch/arm/mach-tegra/board-ardbeg-power.c
arch/arm/mach-tegra/board-dalmore-power.c
arch/arm/mach-tegra/board-laguna-power.c
arch/arm/mach-tegra/board-macallan-power.c
arch/arm/mach-tegra/board-pluto-power.c

index 6e93563..a6987af 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "pm.h"
 #include "board.h"
+#include "tegra-board-id.h"
 #include "board-common.h"
 #include "board-ardbeg.h"
 #include "board-pmu-defines.h"
@@ -681,8 +682,15 @@ int __init ardbeg_regulator_init(void)
 
 static int __init ardbeg_fixed_regulator_init(void)
 {
-       return platform_add_devices(pfixed_reg_devs,
-                       ARRAY_SIZE(pfixed_reg_devs));
+       struct board_info board_info;
+
+       if (!of_machine_is_compatible("nvidia,ardbeg"))
+               return 0;
+
+       tegra_get_board_info(&board_info);
+       if (board_info.board_id == BOARD_E1780)
+               return platform_add_devices(pfixed_reg_devs,
+                               ARRAY_SIZE(pfixed_reg_devs));
 }
 
 subsys_initcall_sync(ardbeg_fixed_regulator_init);
index 9b12b5d..3acf156 100644 (file)
@@ -1193,7 +1193,7 @@ static int __init dalmore_fixed_regulator_init(void)
        struct board_info board_info;
        u8 power_config;
 
-       if (!machine_is_dalmore())
+       if (!of_machine_is_compatible("nvidia,dalmore"))
                return 0;
 
        power_config = get_power_config();
index 1f59a74..42583a8 100644 (file)
@@ -817,12 +817,17 @@ static struct platform_device *fixed_reg_devs_pm360[] = {
 
 static int __init laguna_fixed_regulator_init(void)
 {
+       struct board_info board_info;
 
        if (!of_machine_is_compatible("nvidia,ardbeg"))
                return 0;
 
-       return platform_add_devices(fixed_reg_devs_pm360,
-                       ARRAY_SIZE(fixed_reg_devs_pm360));
+       tegra_get_board_info(&board_info);
+       if (board_info.board_id == BOARD_PM359 ||
+                       board_info.board_id == BOARD_PM358 ||
+                       board_info.board_id == BOARD_PM363)
+               return platform_add_devices(fixed_reg_devs_pm360,
+                               ARRAY_SIZE(fixed_reg_devs_pm360));
 }
 
 subsys_initcall_sync(laguna_fixed_regulator_init);
index 9ebbf3a..0a9d8a7 100644 (file)
@@ -656,7 +656,7 @@ static int __init macallan_cl_dvfs_init(void)
 
 static int __init macallan_fixed_regulator_init(void)
 {
-       if (!machine_is_macallan())
+       if (!of_machine_is_compatible("nvidia,macallan"))
                return 0;
 
        return platform_add_devices(fixed_reg_devs,
index c0060c6..9bab074 100644 (file)
@@ -723,7 +723,7 @@ int __init pluto_regulator_init(void)
 
 static int __init pluto_fixed_regulator_init(void)
 {
-       if (!machine_is_tegra_pluto())
+       if (!of_machine_is_compatible("nvidia,pluto"))
                return 0;
 
        return platform_add_devices(pfixed_reg_devs,