diff options
author | Len Brown <len.brown@intel.com> | 2006-10-14 02:25:48 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-10-14 02:25:48 -0400 |
commit | 1d5b30fc339fe2865599c70486abccc18200317d (patch) | |
tree | 5a7e84ca1da7aec17789c1e348b157ac943584eb /drivers/acpi | |
parent | c92fd49c547c607e23b2687f0f65f762b7210035 (diff) | |
parent | 34c4415ab857dc6d51db08d62bcd45d4b8513bb6 (diff) |
Pull battery into test branch
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/battery.c | 14 | ||||
-rw-r--r-- | drivers/acpi/sbs.c | 20 |
2 files changed, 27 insertions, 7 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 9810e2a55d0a..026e40755cdd 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -64,6 +64,7 @@ extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); | |||
64 | 64 | ||
65 | static int acpi_battery_add(struct acpi_device *device); | 65 | static int acpi_battery_add(struct acpi_device *device); |
66 | static int acpi_battery_remove(struct acpi_device *device, int type); | 66 | static int acpi_battery_remove(struct acpi_device *device, int type); |
67 | static int acpi_battery_resume(struct acpi_device *device, int status); | ||
67 | 68 | ||
68 | static struct acpi_driver acpi_battery_driver = { | 69 | static struct acpi_driver acpi_battery_driver = { |
69 | .name = ACPI_BATTERY_DRIVER_NAME, | 70 | .name = ACPI_BATTERY_DRIVER_NAME, |
@@ -71,6 +72,7 @@ static struct acpi_driver acpi_battery_driver = { | |||
71 | .ids = ACPI_BATTERY_HID, | 72 | .ids = ACPI_BATTERY_HID, |
72 | .ops = { | 73 | .ops = { |
73 | .add = acpi_battery_add, | 74 | .add = acpi_battery_add, |
75 | .resume = acpi_battery_resume, | ||
74 | .remove = acpi_battery_remove, | 76 | .remove = acpi_battery_remove, |
75 | }, | 77 | }, |
76 | }; | 78 | }; |
@@ -753,6 +755,18 @@ static int acpi_battery_remove(struct acpi_device *device, int type) | |||
753 | return 0; | 755 | return 0; |
754 | } | 756 | } |
755 | 757 | ||
758 | /* this is needed to learn about changes made in suspended state */ | ||
759 | static int acpi_battery_resume(struct acpi_device *device, int state) | ||
760 | { | ||
761 | struct acpi_battery *battery; | ||
762 | |||
763 | if (!device) | ||
764 | return -EINVAL; | ||
765 | |||
766 | battery = device->driver_data; | ||
767 | return acpi_battery_check(battery); | ||
768 | } | ||
769 | |||
756 | static int __init acpi_battery_init(void) | 770 | static int __init acpi_battery_init(void) |
757 | { | 771 | { |
758 | int result; | 772 | int result; |
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index 62bef0b3b614..8908a975e575 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -98,11 +98,11 @@ static int update_info_mode = UPDATE_INFO_MODE; | |||
98 | static int update_time = UPDATE_TIME; | 98 | static int update_time = UPDATE_TIME; |
99 | static int update_time2 = UPDATE_TIME2; | 99 | static int update_time2 = UPDATE_TIME2; |
100 | 100 | ||
101 | module_param(capacity_mode, int, CAPACITY_UNIT); | 101 | module_param(capacity_mode, int, 0); |
102 | module_param(update_mode, int, UPDATE_MODE); | 102 | module_param(update_mode, int, 0); |
103 | module_param(update_info_mode, int, UPDATE_INFO_MODE); | 103 | module_param(update_info_mode, int, 0); |
104 | module_param(update_time, int, UPDATE_TIME); | 104 | module_param(update_time, int, 0); |
105 | module_param(update_time2, int, UPDATE_TIME2); | 105 | module_param(update_time2, int, 0); |
106 | 106 | ||
107 | static int acpi_sbs_add(struct acpi_device *device); | 107 | static int acpi_sbs_add(struct acpi_device *device); |
108 | static int acpi_sbs_remove(struct acpi_device *device, int type); | 108 | static int acpi_sbs_remove(struct acpi_device *device, int type); |
@@ -1685,10 +1685,16 @@ static int acpi_sbs_add(struct acpi_device *device) | |||
1685 | 1685 | ||
1686 | int acpi_sbs_remove(struct acpi_device *device, int type) | 1686 | int acpi_sbs_remove(struct acpi_device *device, int type) |
1687 | { | 1687 | { |
1688 | struct acpi_sbs *sbs = (struct acpi_sbs *)acpi_driver_data(device); | 1688 | struct acpi_sbs *sbs = NULL; |
1689 | int id; | 1689 | int id; |
1690 | 1690 | ||
1691 | if (!device || !sbs) { | 1691 | if (!device) { |
1692 | return -EINVAL; | ||
1693 | } | ||
1694 | |||
1695 | sbs = (struct acpi_sbs *)acpi_driver_data(device); | ||
1696 | |||
1697 | if (!sbs) { | ||
1692 | return -EINVAL; | 1698 | return -EINVAL; |
1693 | } | 1699 | } |
1694 | 1700 | ||