summaryrefslogtreecommitdiff
path: root/drivers/power/mxs
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/mxs')
-rw-r--r--drivers/power/mxs/Makefile2
-rw-r--r--drivers/power/mxs/ddi_bc_internal.h3
-rw-r--r--drivers/power/mxs/ddi_power_battery.c4
-rw-r--r--drivers/power/mxs/fiq.S6
-rw-r--r--drivers/power/mxs/linux.c19
5 files changed, 17 insertions, 17 deletions
diff --git a/drivers/power/mxs/Makefile b/drivers/power/mxs/Makefile
index 6662defd9c70..c7675a9ec52b 100644
--- a/drivers/power/mxs/Makefile
+++ b/drivers/power/mxs/Makefile
@@ -5,5 +5,5 @@
obj-$(CONFIG_BATTERY_MXS) += mxs-battery.o
mxs-battery-objs := ddi_bc_api.o ddi_bc_hw.o ddi_bc_init.o \
- ddi_bc_ramp.o ddi_bc_sm.o ddi_power_battery.o linux.o
+ ddi_bc_ramp.o ddi_bc_sm.o ddi_power_battery.o linux.o fiq.o
diff --git a/drivers/power/mxs/ddi_bc_internal.h b/drivers/power/mxs/ddi_bc_internal.h
index a8510d08935c..b5bceeffae98 100644
--- a/drivers/power/mxs/ddi_bc_internal.h
+++ b/drivers/power/mxs/ddi_bc_internal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2010 Freescale Semiconductor, Inc.
*/
/*
@@ -41,6 +41,7 @@
/* Externs */
+#include <linux/kernel.h>
extern bool g_ddi_bc_Configured;
extern ddi_bc_Cfg_t g_ddi_bc_Configuration;
diff --git a/drivers/power/mxs/ddi_power_battery.c b/drivers/power/mxs/ddi_power_battery.c
index 6e2119af1676..762f29bd784e 100644
--- a/drivers/power/mxs/ddi_power_battery.c
+++ b/drivers/power/mxs/ddi_power_battery.c
@@ -1805,9 +1805,11 @@ void ddi_power_enable_vddio_interrupt(bool enable)
}
+
void ddi_power_handle_vddio_brnout(void)
{
- if (ddi_power_GetPmu5vStatus() == new_5v_connection) {
+ if (ddi_power_GetPmu5vStatus() == new_5v_connection ||
+ (ddi_power_GetPmu5vStatus() == new_5v_disconnection)) {
ddi_power_enable_vddio_interrupt(false);
} else {
#ifdef DEBUG_IRQS
diff --git a/drivers/power/mxs/fiq.S b/drivers/power/mxs/fiq.S
index ee71730c85c9..1ad380d07efd 100644
--- a/drivers/power/mxs/fiq.S
+++ b/drivers/power/mxs/fiq.S
@@ -19,11 +19,10 @@
#include <linux/linkage.h>
#include <asm/assembler.h>
-#include <mach/platform.h>
#include <mach/hardware.h>
#include <asm/pgtable-hwdef.h>
#include <mach/regs-power.h>
-#include <mach/regs-clkctrl.h>
+#include <mach/../../regs-clkctrl.h>
#include <mach/regs-timrot.h>
.align 5
@@ -33,7 +32,6 @@
.globl lock_vector_tlb
power_fiq_start:
-
ldr r8,power_reg
ldr r9,[r8,#HW_POWER_CTRL ]
ldr r10,power_off
@@ -101,7 +99,7 @@ check_dcdc4p2:
subs pc,lr, #4
power_reg:
- .long REGS_POWER_BASE
+ .long IO_ADDRESS(POWER_PHYS_ADDR)
power_off:
.long 0x3e770001
power_bo:
diff --git a/drivers/power/mxs/linux.c b/drivers/power/mxs/linux.c
index 6a3172415145..1c2dfc10f7ca 100644
--- a/drivers/power/mxs/linux.c
+++ b/drivers/power/mxs/linux.c
@@ -102,7 +102,7 @@ struct mxs_info {
#define IRQ_DCDC4P2_BRNOUT IRQ_DCDC4P2_BO
#endif
-/* #define POWER_FIQ */
+#define POWER_FIQ
/* #define DEBUG_IRQS */
@@ -129,9 +129,7 @@ void init_protection(struct mxs_info *info)
battery_voltage = ddi_power_GetBattery();
/* InitializeFiqSystem(); */
-#ifdef CONFIG_ARCH_MX23
ddi_power_InitOutputBrownouts();
-#endif
/* if we start the kernel with 4p2 already started
@@ -238,12 +236,12 @@ static void check_and_handle_5v_connection(struct mxs_info *info)
*/
if ((__raw_readl(REGS_POWER_BASE + HW_POWER_5VCTRL)
& BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT) ==
- (0x8 << BP_POWER_5VCTRL_CHARGE_4P2_ILIMIT)) {
+ (0x20 << BP_POWER_5VCTRL_CHARGE_4P2_ILIMIT)) {
dev_info(info->dev, "waiting USB enum done...\r\n");
}
while ((__raw_readl(REGS_POWER_BASE + HW_POWER_5VCTRL)
& BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT)
- == (0x8 << BP_POWER_5VCTRL_CHARGE_4P2_ILIMIT)) {
+ == (0x20 << BP_POWER_5VCTRL_CHARGE_4P2_ILIMIT)) {
msleep(50);
}
#endif
@@ -299,7 +297,7 @@ static void check_and_handle_5v_connection(struct mxs_info *info)
__raw_writel(__raw_readl(REGS_POWER_BASE +
HW_POWER_5VCTRL) &
(~BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT)
- | (0x8 << BP_POWER_5VCTRL_CHARGE_4P2_ILIMIT),
+ | (0x20 << BP_POWER_5VCTRL_CHARGE_4P2_ILIMIT),
REGS_POWER_BASE + HW_POWER_5VCTRL);
}
@@ -659,6 +657,8 @@ static irqreturn_t mxs_irq_batt_brnout(int irq, void *cookie)
#endif
return IRQ_HANDLED;
}
+
+
static irqreturn_t mxs_irq_vddd_brnout(int irq, void *cookie)
{
#ifdef DEBUG_IRQS
@@ -1144,13 +1144,13 @@ static int __init mxs_bat_init(void)
#ifdef CONFIG_MXS_VBUS_CURRENT_DRAW
if (((__raw_readl(REGS_POWER_BASE + HW_POWER_5VCTRL) &
- BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT) == 0x8000)
+ BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT) == 0x20000)
&& ((__raw_readl(REGS_POWER_BASE + HW_POWER_5VCTRL) &
BM_POWER_5VCTRL_PWD_CHARGE_4P2) == 0)) {
#ifdef CONFIG_USB_GADGET
printk(KERN_INFO "USB GADGET exist,wait USB enum done...\r\n");
while (((__raw_readl(REGS_POWER_BASE + HW_POWER_5VCTRL)
- & BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT) == 0x8000) &&
+ & BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT) == 0x20000) &&
((__raw_readl(REGS_POWER_BASE + HW_POWER_5VCTRL) &
BM_POWER_5VCTRL_PWD_CHARGE_4P2) == 0))
;
@@ -1161,8 +1161,7 @@ static int __init mxs_bat_init(void)
}
cpu = clk_get(NULL, "cpu");
pll0 = clk_get(NULL, "ref_cpu");
- if (cpu->set_parent)
- cpu->set_parent(cpu, pll0);
+ clk_set_parent(cpu, pll0);
#endif
return platform_driver_register(&mxs_batdrv);
}