aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/zeus.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@misterjones.org>2009-12-26 15:24:13 -0500
committerEric Miao <eric.y.miao@gmail.com>2009-12-29 01:11:32 -0500
commita1916eb0ea142c5ac67289e65a022d5253a8ec92 (patch)
tree911972f93c3ac41c84a76d40eb16f7ea123e2ff0 /arch/arm/mach-pxa/zeus.c
parent5f86cebaa56268f1afa2321e6d424530b1a49a12 (diff)
[ARM] pxa/zeus: provide power-source information when APM is enabled
Signed-off-by: Marc Zyngier <maz@misterjones.org> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/zeus.c')
-rw-r--r--arch/arm/mach-pxa/zeus.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 2f480a2b1531..75f2a37f945d 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/i2c/pca953x.h> 27#include <linux/i2c/pca953x.h>
28#include <linux/apm-emulation.h>
28 29
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
@@ -626,6 +627,25 @@ static void zeus_power_off(void)
626 pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP); 627 pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP);
627} 628}
628 629
630#ifdef CONFIG_APM_EMULATION
631static void zeus_get_power_status(struct apm_power_info *info)
632{
633 /* Power supply is always present */
634 info->ac_line_status = APM_AC_ONLINE;
635 info->battery_status = APM_BATTERY_STATUS_NOT_PRESENT;
636 info->battery_flag = APM_BATTERY_FLAG_NOT_PRESENT;
637}
638
639static inline void zeus_setup_apm(void)
640{
641 apm_get_power_status = zeus_get_power_status;
642}
643#else
644static inline void zeus_setup_apm(void)
645{
646}
647#endif
648
629static int zeus_get_pcb_info(struct i2c_client *client, unsigned gpio, 649static int zeus_get_pcb_info(struct i2c_client *client, unsigned gpio,
630 unsigned ngpio, void *context) 650 unsigned ngpio, void *context)
631{ 651{
@@ -747,6 +767,7 @@ static void __init zeus_init(void)
747 MSC1 = (MSC1 & 0xffff0000) | dm9000_msc; 767 MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
748 768
749 pm_power_off = zeus_power_off; 769 pm_power_off = zeus_power_off;
770 zeus_setup_apm();
750 771
751 pxa2xx_mfp_config(ARRAY_AND_SIZE(zeus_pin_config)); 772 pxa2xx_mfp_config(ARRAY_AND_SIZE(zeus_pin_config));
752 773