]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: use PMC interrupt polarity configuration appropriately
authorLaxman Dewangan <ldewangan@nvidia.com>
Wed, 16 Apr 2014 13:53:15 +0000 (19:23 +0530)
committerSeema Khowala <seemaj@nvidia.com>
Wed, 23 Apr 2014 21:06:52 +0000 (14:06 -0700)
Use the API provided by tegar-pmc driver for configuring the PMC
interrupt polarity at appropriate location for Laguna and Norrin.

Remove extra function calls and macros used locally for achieving this.

Change-Id: Ic5e990453fd9bc2b61f433a7850708a34a4d0fa7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/397149

arch/arm/mach-tegra/board-laguna-power.c
arch/arm/mach-tegra/board-norrin-power.c

index fed82c5dffa6ea0042e417fe074fe1c8d943d933..e3ba1ea0aee3611040bd27596654e5e974b59958 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/regulator/userspace-consumer.h>
 #include <linux/pid_thermal_gov.h>
 #include <linux/power/bq2471x-charger.h>
+#include <linux/tegra-pmc.h>
 
 #include <asm/mach-types.h>
 
@@ -49,9 +50,6 @@
 #include "tegra11_soctherm.h"
 #include "iomap.h"
 
-#define PMC_CTRL               0x0
-#define PMC_CTRL_INTR_LOW      (1 << 17)
-
 struct bq2471x_platform_data laguna_bq2471x_pdata = {
        .charge_broadcast_mode = 1,
        .gpio_active_low = 1,
@@ -65,21 +63,6 @@ static struct i2c_board_info __initdata bq2471x_boardinfo[] = {
        },
 };
 
-int __init laguna_as3722_regulator_init(void)
-{
-       void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
-       u32 pmc_ctrl;
-
-       /* 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);
-
-       return 0;
-}
-
 static struct tegra_suspend_platform_data laguna_suspend_data = {
        .cpu_timer      = 2000,
        .cpu_off_timer  = 2000,
@@ -164,7 +147,7 @@ int __init laguna_regulator_init(void)
 #ifdef CONFIG_ARCH_TEGRA_HAS_CL_DVFS
        laguna_cl_dvfs_init();
 #endif
-       laguna_as3722_regulator_init();
+       tegra_pmc_pmu_interrupt_polarity(true);
 
        if (get_power_supply_type() == POWER_SUPPLY_TYPE_BATTERY)
                i2c_register_board_info(1, bq2471x_boardinfo,
index 02f1ad31cf23bf0d730f329750ad81c62039b676..78709dcf818a8d1ccdec948e9cb72ee317dcb5f1 100644 (file)
 #include "tegra11_soctherm.h"
 #include "iomap.h"
 
-int __init norrin_as3722_regulator_init(void)
-{
-       tegra_pmc_pmu_interrupt_polarity(true);
-       return 0;
-}
-
 static struct tegra_suspend_platform_data norrin_suspend_data = {
        .cpu_timer      = 2000,
        .cpu_off_timer  = 2000,
@@ -152,7 +146,7 @@ int __init norrin_regulator_init(void)
 #ifdef CONFIG_ARCH_TEGRA_HAS_CL_DVFS
        norrin_cl_dvfs_init();
 #endif
-       norrin_as3722_regulator_init();
+       tegra_pmc_pmu_interrupt_polarity(true);
 
        return 0;
 }