diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-02-02 01:57:53 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2009-02-02 04:40:16 -0500 |
commit | 9f055c49c6a1afe6e8b75a2622ac29f3a4290b9d (patch) | |
tree | dd378e0fe20d160719e9cde868ac1db612930ef0 /arch/arm/mach-pxa/em-x270.c | |
parent | 432adf1898381bac5a9ef90262d8a91e16823b11 (diff) |
[ARM] pxa/em-x270: add battery charger
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm/mach-pxa/em-x270.c')
-rw-r--r-- | arch/arm/mach-pxa/em-x270.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index 7d056cb2334e..20ed10c67c6c 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/regulator/machine.h> | 24 | #include <linux/regulator/machine.h> |
25 | #include <linux/spi/spi.h> | 25 | #include <linux/spi/spi.h> |
26 | #include <linux/spi/tdo24m.h> | 26 | #include <linux/spi/tdo24m.h> |
27 | #include <linux/power_supply.h> | ||
28 | #include <linux/apm-emulation.h> | ||
27 | 29 | ||
28 | #include <media/soc_camera.h> | 30 | #include <media/soc_camera.h> |
29 | 31 | ||
@@ -824,6 +826,49 @@ struct led_info em_x270_led_info = { | |||
824 | .default_trigger = "battery-charging-or-full", | 826 | .default_trigger = "battery-charging-or-full", |
825 | }; | 827 | }; |
826 | 828 | ||
829 | struct power_supply_info em_x270_psy_info = { | ||
830 | .name = "LP555597P6H-FPS", | ||
831 | .technology = POWER_SUPPLY_TECHNOLOGY_LIPO, | ||
832 | .voltage_max_design = 4200000, | ||
833 | .voltage_min_design = 3000000, | ||
834 | .use_for_apm = 1, | ||
835 | }; | ||
836 | |||
837 | static void em_x270_battery_low(void) | ||
838 | { | ||
839 | apm_queue_event(APM_LOW_BATTERY); | ||
840 | } | ||
841 | |||
842 | static void em_x270_battery_critical(void) | ||
843 | { | ||
844 | apm_queue_event(APM_CRITICAL_SUSPEND); | ||
845 | } | ||
846 | |||
847 | struct da9030_battery_info em_x270_batterty_info = { | ||
848 | .battery_info = &em_x270_psy_info, | ||
849 | |||
850 | .charge_milliamp = 1000, | ||
851 | .charge_millivolt = 4200, | ||
852 | |||
853 | .vbat_low = 3600, | ||
854 | .vbat_crit = 3400, | ||
855 | .vbat_charge_start = 4100, | ||
856 | .vbat_charge_stop = 4200, | ||
857 | .vbat_charge_restart = 4000, | ||
858 | |||
859 | .vcharge_min = 3200, | ||
860 | .vcharge_max = 5500, | ||
861 | |||
862 | .tbat_low = 197, | ||
863 | .tbat_high = 78, | ||
864 | .tbat_restart = 100, | ||
865 | |||
866 | .batmon_interval = 0, | ||
867 | |||
868 | .battery_low = em_x270_battery_low, | ||
869 | .battery_critical = em_x270_battery_critical, | ||
870 | }; | ||
871 | |||
827 | #define DA9030_SUBDEV(_name, _id, _pdata) \ | 872 | #define DA9030_SUBDEV(_name, _id, _pdata) \ |
828 | { \ | 873 | { \ |
829 | .name = "da903x-" #_name, \ | 874 | .name = "da903x-" #_name, \ |
@@ -842,6 +887,7 @@ struct da903x_subdev_info em_x270_da9030_subdevs[] = { | |||
842 | 887 | ||
843 | DA9030_SUBDEV(led, LED_PC, &em_x270_led_info), | 888 | DA9030_SUBDEV(led, LED_PC, &em_x270_led_info), |
844 | DA9030_SUBDEV(backlight, WLED, &em_x270_led_info), | 889 | DA9030_SUBDEV(backlight, WLED, &em_x270_led_info), |
890 | DA9030_SUBDEV(battery, BAT, &em_x270_batterty_info), | ||
845 | }; | 891 | }; |
846 | 892 | ||
847 | static struct da903x_platform_data em_x270_da9030_info = { | 893 | static struct da903x_platform_data em_x270_da9030_info = { |