diff options
author | Johnny Qiu <joqiu@nvidia.com> | 2012-02-02 16:01:15 +0800 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-02-10 13:25:16 -0800 |
commit | f54bbef35a4e4ef385c087f05080bf5924e6ec80 (patch) | |
tree | a73299297277ae00a25da7d2724edd40ba11e4c4 | |
parent | 37d3adaccf1c3551afffacaba8ed5477a16fede7 (diff) |
arm: tegra: kai: use subsys_initcall_sync to initialize fixed regulators
Initialization of fixed regulators should be in subsys_initcall_sync;
otherwise some PMU GPIO based regulators will fail to be registered
since PMU is not registered at this time.
Bug 932578
Signed-off-by: Johnny Qiu <joqiu@nvidia.com>
Reviewed-on: http://git-master/r/78945
(cherry picked from commit e6bc3ad1d54240725b082cc18ad4141d76b9a4b7)
Change-Id: I4527ddbc9ddee0576c894b7c55b0413e93513c68
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/82700
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-kai-power.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/board-kai-power.c b/arch/arm/mach-tegra/board-kai-power.c index 4b141de8dd78..b974f17ee7c4 100644 --- a/arch/arm/mach-tegra/board-kai-power.c +++ b/arch/arm/mach-tegra/board-kai-power.c @@ -46,6 +46,8 @@ #define PMC_CTRL 0x0 #define PMC_CTRL_INTR_LOW (1 << 17) +static bool is_kai_machine = false; + static struct regulator_consumer_supply max77663_sd0_supply[] = { REGULATOR_SUPPLY("vdd_cpu", NULL), }; @@ -477,10 +479,13 @@ static struct platform_device *fixed_reg_devs[] = { E1565_FIXED_REG }; -static int __init kai_max77663_gpio_switch_regulator_init(void) +static int __init kai_fixed_regulator_init(void) { int i; + if (!is_kai_machine) + return 0; + for (i = 0; i < ARRAY_SIZE(fixed_reg_devs); ++i) { int gpio_nr; struct fixed_voltage_config *fixed_reg_pdata = @@ -493,6 +498,7 @@ static int __init kai_max77663_gpio_switch_regulator_init(void) return platform_add_devices(fixed_reg_devs, ARRAY_SIZE(fixed_reg_devs)); } +subsys_initcall_sync(kai_fixed_regulator_init); int __init kai_regulator_init(void) { @@ -510,7 +516,8 @@ int __init kai_regulator_init(void) if (ret < 0) return ret; - return kai_max77663_gpio_switch_regulator_init(); + is_kai_machine = true; + return 0; } static void kai_board_suspend(int lp_state, enum suspend_stage stg) |