Commit a1916eb0 authored by Marc Zyngier's avatar Marc Zyngier Committed by Eric Miao

[ARM] pxa/zeus: provide power-source information when APM is enabled

Signed-off-by: default avatarMarc Zyngier <maz@misterjones.org>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 5f86ceba
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/i2c/pca953x.h> #include <linux/i2c/pca953x.h>
#include <linux/apm-emulation.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
...@@ -626,6 +627,25 @@ static void zeus_power_off(void) ...@@ -626,6 +627,25 @@ static void zeus_power_off(void)
pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP); pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP);
} }
#ifdef CONFIG_APM_EMULATION
static void zeus_get_power_status(struct apm_power_info *info)
{
/* Power supply is always present */
info->ac_line_status = APM_AC_ONLINE;
info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT;
info->battery_flag = APM_BATTERY_FLAG_NOT_PRESENT;
}
static inline void zeus_setup_apm(void)
{
apm_get_power_status = zeus_get_power_status;
}
#else
static inline void zeus_setup_apm(void)
{
}
#endif
static int zeus_get_pcb_info(struct i2c_client *client, unsigned gpio, static int zeus_get_pcb_info(struct i2c_client *client, unsigned gpio,
unsigned ngpio, void *context) unsigned ngpio, void *context)
{ {
...@@ -747,6 +767,7 @@ static void __init zeus_init(void) ...@@ -747,6 +767,7 @@ static void __init zeus_init(void)
MSC1 = (MSC1 & 0xffff0000) | dm9000_msc; MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
pm_power_off = zeus_power_off; pm_power_off = zeus_power_off;
zeus_setup_apm();
pxa2xx_mfp_config(ARRAY_AND_SIZE(zeus_pin_config)); pxa2xx_mfp_config(ARRAY_AND_SIZE(zeus_pin_config));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment