aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common/sharpsl_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/common/sharpsl_pm.c')
-rw-r--r--arch/arm/common/sharpsl_pm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
index 978d32e82d39..3cd8c9ee4510 100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
@@ -22,6 +22,7 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/leds.h>
25 26
26#include <asm/hardware.h> 27#include <asm/hardware.h>
27#include <asm/mach-types.h> 28#include <asm/mach-types.h>
@@ -75,6 +76,7 @@ static void sharpsl_battery_thread(void *private_);
75struct sharpsl_pm_status sharpsl_pm; 76struct sharpsl_pm_status sharpsl_pm;
76DECLARE_WORK(toggle_charger, sharpsl_charge_toggle, NULL); 77DECLARE_WORK(toggle_charger, sharpsl_charge_toggle, NULL);
77DECLARE_WORK(sharpsl_bat, sharpsl_battery_thread, NULL); 78DECLARE_WORK(sharpsl_bat, sharpsl_battery_thread, NULL);
79DEFINE_LED_TRIGGER(sharpsl_charge_led_trigger);
78 80
79 81
80static int get_percentage(int voltage) 82static int get_percentage(int voltage)
@@ -190,10 +192,10 @@ void sharpsl_pm_led(int val)
190 dev_err(sharpsl_pm.dev, "Charging Error!\n"); 192 dev_err(sharpsl_pm.dev, "Charging Error!\n");
191 } else if (val == SHARPSL_LED_ON) { 193 } else if (val == SHARPSL_LED_ON) {
192 dev_dbg(sharpsl_pm.dev, "Charge LED On\n"); 194 dev_dbg(sharpsl_pm.dev, "Charge LED On\n");
193 195 led_trigger_event(sharpsl_charge_led_trigger, LED_FULL);
194 } else { 196 } else {
195 dev_dbg(sharpsl_pm.dev, "Charge LED Off\n"); 197 dev_dbg(sharpsl_pm.dev, "Charge LED Off\n");
196 198 led_trigger_event(sharpsl_charge_led_trigger, LED_OFF);
197 } 199 }
198} 200}
199 201
@@ -786,6 +788,8 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev)
786 init_timer(&sharpsl_pm.chrg_full_timer); 788 init_timer(&sharpsl_pm.chrg_full_timer);
787 sharpsl_pm.chrg_full_timer.function = sharpsl_chrg_full_timer; 789 sharpsl_pm.chrg_full_timer.function = sharpsl_chrg_full_timer;
788 790
791 led_trigger_register_simple("sharpsl-charge", &sharpsl_charge_led_trigger);
792
789 sharpsl_pm.machinfo->init(); 793 sharpsl_pm.machinfo->init();
790 794
791 device_create_file(&pdev->dev, &dev_attr_battery_percentage); 795 device_create_file(&pdev->dev, &dev_attr_battery_percentage);
@@ -807,6 +811,8 @@ static int sharpsl_pm_remove(struct platform_device *pdev)
807 device_remove_file(&pdev->dev, &dev_attr_battery_percentage); 811 device_remove_file(&pdev->dev, &dev_attr_battery_percentage);
808 device_remove_file(&pdev->dev, &dev_attr_battery_voltage); 812 device_remove_file(&pdev->dev, &dev_attr_battery_voltage);
809 813
814 led_trigger_unregister_simple(sharpsl_charge_led_trigger);
815
810 sharpsl_pm.machinfo->exit(); 816 sharpsl_pm.machinfo->exit();
811 817
812 del_timer_sync(&sharpsl_pm.chrg_full_timer); 818 del_timer_sync(&sharpsl_pm.chrg_full_timer);