regulator: tps6591x: Masking all interrupts
Laxman Dewangan [Tue, 8 Mar 2011 14:44:01 +0000 (19:44 +0530)]
Masking all interrupts from tps6591x by default and configuring
the PMU interrupt to active low.

Original-Change-Id: I2a40bb5f50d7f749debe1a8a478680acf69767a4
Reviewed-on: http://git-master/r/22066
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com>
Original-Change-Id: I676785668026e4ef02a076f70bdb9d292263b346

Rebase-Id: R0ebed78730c865c22e23932008326bf927a102eb

arch/arm/mach-tegra/board-cardhu-power.c

index ed0b4a3..01b5967 100755 (executable)
@@ -38,6 +38,9 @@
 #include "power.h"
 #include "wakeups-t3.h"
 
+#define PMC_CTRL               0x0
+#define PMC_CTRL_INTR_LOW      (1 << 17)
+
 #ifdef CONFIG_MFD_TPS6591X
 static struct regulator_consumer_supply tps6591x_vdd1_supply[] = {
        REGULATOR_SUPPLY("vdd_core", NULL),
@@ -254,6 +257,12 @@ static struct i2c_board_info __initdata cardhu_regulators[] = {
 
 int __init cardhu_regulator_init(void)
 {
+       void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
+       u32 pmc_ctrl;
+       /* configure the power management controller to trigger PMU
+        * interrupts when low */
+       pmc_ctrl = readl(pmc + PMC_CTRL);
+       writel(pmc_ctrl | PMC_CTRL_INTR_LOW, pmc + PMC_CTRL);
        i2c_register_board_info(4, cardhu_regulators, 1);
        return 0;
 }