diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-10-16 18:34:41 -0400 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2008-10-30 10:10:15 -0400 |
commit | 56e7d85cf982dda4b453c157f3f64aea1478bc4d (patch) | |
tree | e47765d5982ede1b7afb2f19e3f09ab61da68880 /arch | |
parent | 5cbff9603a77d01315859690a8f125f817bed73b (diff) |
[ARM] sharpsl_pm: fix compilation w/o CONFIG_PM
Fix compilation of sharpsl_pm when CONFIG_PM in unselected.
Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/common/sharpsl_pm.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c index db8309161408..780bbf7cb26f 100644 --- a/arch/arm/common/sharpsl_pm.c +++ b/arch/arm/common/sharpsl_pm.c | |||
@@ -54,11 +54,13 @@ | |||
54 | /* | 54 | /* |
55 | * Prototypes | 55 | * Prototypes |
56 | */ | 56 | */ |
57 | #ifdef CONFIG_PM | ||
57 | static int sharpsl_off_charge_battery(void); | 58 | static int sharpsl_off_charge_battery(void); |
58 | static int sharpsl_check_battery_temp(void); | ||
59 | static int sharpsl_check_battery_voltage(void); | 59 | static int sharpsl_check_battery_voltage(void); |
60 | static int sharpsl_ac_check(void); | ||
61 | static int sharpsl_fatal_check(void); | 60 | static int sharpsl_fatal_check(void); |
61 | #endif | ||
62 | static int sharpsl_check_battery_temp(void); | ||
63 | static int sharpsl_ac_check(void); | ||
62 | static int sharpsl_average_value(int ad); | 64 | static int sharpsl_average_value(int ad); |
63 | static void sharpsl_average_clear(void); | 65 | static void sharpsl_average_clear(void); |
64 | static void sharpsl_charge_toggle(struct work_struct *private_); | 66 | static void sharpsl_charge_toggle(struct work_struct *private_); |
@@ -424,6 +426,7 @@ static int sharpsl_check_battery_temp(void) | |||
424 | return 0; | 426 | return 0; |
425 | } | 427 | } |
426 | 428 | ||
429 | #ifdef CONFIG_PM | ||
427 | static int sharpsl_check_battery_voltage(void) | 430 | static int sharpsl_check_battery_voltage(void) |
428 | { | 431 | { |
429 | int val, i, buff[5]; | 432 | int val, i, buff[5]; |
@@ -455,6 +458,7 @@ static int sharpsl_check_battery_voltage(void) | |||
455 | 458 | ||
456 | return 0; | 459 | return 0; |
457 | } | 460 | } |
461 | #endif | ||
458 | 462 | ||
459 | static int sharpsl_ac_check(void) | 463 | static int sharpsl_ac_check(void) |
460 | { | 464 | { |
@@ -586,8 +590,6 @@ static int corgi_pxa_pm_enter(suspend_state_t state) | |||
586 | 590 | ||
587 | return 0; | 591 | return 0; |
588 | } | 592 | } |
589 | #endif | ||
590 | |||
591 | 593 | ||
592 | /* | 594 | /* |
593 | * Check for fatal battery errors | 595 | * Check for fatal battery errors |
@@ -738,7 +740,10 @@ static int sharpsl_off_charge_battery(void) | |||
738 | } | 740 | } |
739 | } | 741 | } |
740 | } | 742 | } |
741 | 743 | #else | |
744 | #define sharpsl_pm_suspend NULL | ||
745 | #define sharpsl_pm_resume NULL | ||
746 | #endif | ||
742 | 747 | ||
743 | static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf) | 748 | static ssize_t battery_percentage_show(struct device *dev, struct device_attribute *attr, char *buf) |
744 | { | 749 | { |
@@ -768,10 +773,12 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info) | |||
768 | info->battery_life = sharpsl_pm.battstat.mainbat_percent; | 773 | info->battery_life = sharpsl_pm.battstat.mainbat_percent; |
769 | } | 774 | } |
770 | 775 | ||
776 | #ifdef CONFIG_PM | ||
771 | static struct platform_suspend_ops sharpsl_pm_ops = { | 777 | static struct platform_suspend_ops sharpsl_pm_ops = { |
772 | .enter = corgi_pxa_pm_enter, | 778 | .enter = corgi_pxa_pm_enter, |
773 | .valid = suspend_valid_only_mem, | 779 | .valid = suspend_valid_only_mem, |
774 | }; | 780 | }; |
781 | #endif | ||
775 | 782 | ||
776 | static int __init sharpsl_pm_probe(struct platform_device *pdev) | 783 | static int __init sharpsl_pm_probe(struct platform_device *pdev) |
777 | { | 784 | { |
@@ -802,7 +809,9 @@ static int __init sharpsl_pm_probe(struct platform_device *pdev) | |||
802 | 809 | ||
803 | apm_get_power_status = sharpsl_apm_get_power_status; | 810 | apm_get_power_status = sharpsl_apm_get_power_status; |
804 | 811 | ||
812 | #ifdef CONFIG_PM | ||
805 | suspend_set_ops(&sharpsl_pm_ops); | 813 | suspend_set_ops(&sharpsl_pm_ops); |
814 | #endif | ||
806 | 815 | ||
807 | mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250)); | 816 | mod_timer(&sharpsl_pm.ac_timer, jiffies + msecs_to_jiffies(250)); |
808 | 817 | ||