aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@linux.intel.com>2008-10-10 02:22:59 -0400
committerLen Brown <len.brown@intel.com>2008-10-11 02:47:33 -0400
commit27663c5855b10af9ec67bc7dfba001426ba21222 (patch)
tree2b8c520bb57a792045d7d072398a4d840fada6c0 /drivers/acpi
parent3fa8749e584b55f1180411ab1b51117190bac1e5 (diff)
ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit kernels
As of version 2.0, ACPI can return 64-bit integers. The current acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms. Change the argument to take a pointer to an acpi_integer so we support 64-bit integers on all platforms. lenb: replaced use of "acpi_integer" with "unsigned long long" lenb: fixed bug in acpi_thermal_trips_update() Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ac.c2
-rw-r--r--drivers/acpi/acpi_memhotplug.c5
-rw-r--r--drivers/acpi/asus_acpi.c2
-rw-r--r--drivers/acpi/bay.c2
-rw-r--r--drivers/acpi/bus.c4
-rw-r--r--drivers/acpi/button.c4
-rw-r--r--drivers/acpi/container.c2
-rw-r--r--drivers/acpi/dock.c6
-rw-r--r--drivers/acpi/ec.c7
-rw-r--r--drivers/acpi/numa.c2
-rw-r--r--drivers/acpi/osl.c5
-rw-r--r--drivers/acpi/pci_root.c2
-rw-r--r--drivers/acpi/pci_slot.c10
-rw-r--r--drivers/acpi/power.c2
-rw-r--r--drivers/acpi/processor_core.c4
-rw-r--r--drivers/acpi/processor_perflib.c2
-rw-r--r--drivers/acpi/processor_throttling.c2
-rw-r--r--drivers/acpi/sbshc.c2
-rw-r--r--drivers/acpi/sleep/main.c2
-rw-r--r--drivers/acpi/thermal.c43
-rw-r--r--drivers/acpi/utils.c4
-rw-r--r--drivers/acpi/video.c42
22 files changed, 84 insertions, 72 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 831883b7d6c9..5e57a80c6cf1 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -85,7 +85,7 @@ struct acpi_ac {
85 struct power_supply charger; 85 struct power_supply charger;
86#endif 86#endif
87 struct acpi_device * device; 87 struct acpi_device * device;
88 unsigned long state; 88 unsigned long long state;
89}; 89};
90 90
91#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger); 91#define to_acpi_ac(x) container_of(x, struct acpi_ac, charger);
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 5f1127ad5a95..2b773160e9c2 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -194,8 +194,7 @@ acpi_memory_get_device(acpi_handle handle,
194 194
195static int acpi_memory_check_device(struct acpi_memory_device *mem_device) 195static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
196{ 196{
197 unsigned long current_status; 197 unsigned long long current_status;
198
199 198
200 /* Get device present/absent information from the _STA */ 199 /* Get device present/absent information from the _STA */
201 if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA", 200 if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",
@@ -264,7 +263,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
264 acpi_status status; 263 acpi_status status;
265 struct acpi_object_list arg_list; 264 struct acpi_object_list arg_list;
266 union acpi_object arg; 265 union acpi_object arg;
267 unsigned long current_status; 266 unsigned long long current_status;
268 267
269 268
270 /* Issue the _EJ0 command */ 269 /* Issue the _EJ0 command */
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c
index d3d0886d637f..4434209e453e 100644
--- a/drivers/acpi/asus_acpi.c
+++ b/drivers/acpi/asus_acpi.c
@@ -753,7 +753,7 @@ static int get_lcd_state(void)
753 /* That's what the AML code does */ 753 /* That's what the AML code does */
754 lcd = out_obj.integer.value >> 8; 754 lcd = out_obj.integer.value >> 8;
755 } else if (hotk->model == F3Sa) { 755 } else if (hotk->model == F3Sa) {
756 unsigned long tmp; 756 unsigned long long tmp;
757 union acpi_object param; 757 union acpi_object param;
758 struct acpi_object_list input; 758 struct acpi_object_list input;
759 acpi_status status; 759 acpi_status status;
diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c
index 61b6c5beb2d3..23a51e4779f7 100644
--- a/drivers/acpi/bay.c
+++ b/drivers/acpi/bay.c
@@ -90,7 +90,7 @@ static int is_ejectable(acpi_handle handle)
90 */ 90 */
91static int bay_present(struct bay *bay) 91static int bay_present(struct bay *bay)
92{ 92{
93 unsigned long sta; 93 unsigned long long sta;
94 acpi_status status; 94 acpi_status status;
95 95
96 if (bay) { 96 if (bay) {
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index ccae305ee55d..0885fc796fa0 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -77,7 +77,7 @@ EXPORT_SYMBOL(acpi_bus_get_device);
77int acpi_bus_get_status(struct acpi_device *device) 77int acpi_bus_get_status(struct acpi_device *device)
78{ 78{
79 acpi_status status = AE_OK; 79 acpi_status status = AE_OK;
80 unsigned long sta = 0; 80 unsigned long long sta = 0;
81 81
82 82
83 if (!device) 83 if (!device)
@@ -155,7 +155,7 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
155 int result = 0; 155 int result = 0;
156 acpi_status status = 0; 156 acpi_status status = 0;
157 struct acpi_device *device = NULL; 157 struct acpi_device *device = NULL;
158 unsigned long psc = 0; 158 unsigned long long psc = 0;
159 159
160 160
161 result = acpi_bus_get_device(handle, &device); 161 result = acpi_bus_get_device(handle, &device);
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 1dfec413588c..baeb661ca953 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -145,7 +145,7 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
145{ 145{
146 struct acpi_button *button = seq->private; 146 struct acpi_button *button = seq->private;
147 acpi_status status; 147 acpi_status status;
148 unsigned long state; 148 unsigned long long state;
149 149
150 if (!button || !button->device) 150 if (!button || !button->device)
151 return 0; 151 return 0;
@@ -253,7 +253,7 @@ static int acpi_button_remove_fs(struct acpi_device *device)
253 -------------------------------------------------------------------------- */ 253 -------------------------------------------------------------------------- */
254static int acpi_lid_send_state(struct acpi_button *button) 254static int acpi_lid_send_state(struct acpi_button *button)
255{ 255{
256 unsigned long state; 256 unsigned long long state;
257 acpi_status status; 257 acpi_status status;
258 258
259 status = acpi_evaluate_integer(button->device->handle, "_LID", NULL, 259 status = acpi_evaluate_integer(button->device->handle, "_LID", NULL,
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c
index 3c25ec7a1871..cfa5fd68168a 100644
--- a/drivers/acpi/container.c
+++ b/drivers/acpi/container.c
@@ -76,7 +76,7 @@ static int is_device_present(acpi_handle handle)
76{ 76{
77 acpi_handle temp; 77 acpi_handle temp;
78 acpi_status status; 78 acpi_status status;
79 unsigned long sta; 79 unsigned long long sta;
80 80
81 81
82 status = acpi_get_handle(handle, "_STA", &temp); 82 status = acpi_get_handle(handle, "_STA", &temp);
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 7d2edf143f16..94857112b64d 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -229,7 +229,7 @@ EXPORT_SYMBOL_GPL(is_dock_device);
229 */ 229 */
230static int dock_present(struct dock_station *ds) 230static int dock_present(struct dock_station *ds)
231{ 231{
232 unsigned long sta; 232 unsigned long long sta;
233 acpi_status status; 233 acpi_status status;
234 234
235 if (ds) { 235 if (ds) {
@@ -727,13 +727,13 @@ static DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock);
727static ssize_t show_dock_uid(struct device *dev, 727static ssize_t show_dock_uid(struct device *dev,
728 struct device_attribute *attr, char *buf) 728 struct device_attribute *attr, char *buf)
729{ 729{
730 unsigned long lbuf; 730 unsigned long long lbuf;
731 acpi_status status = acpi_evaluate_integer(dock_station->handle, 731 acpi_status status = acpi_evaluate_integer(dock_station->handle,
732 "_UID", NULL, &lbuf); 732 "_UID", NULL, &lbuf);
733 if (ACPI_FAILURE(status)) 733 if (ACPI_FAILURE(status))
734 return 0; 734 return 0;
735 735
736 return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf); 736 return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
737} 737}
738static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL); 738static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
739 739
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 13593f9f2197..638a68679a42 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -718,6 +718,7 @@ static acpi_status
718ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) 718ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
719{ 719{
720 acpi_status status; 720 acpi_status status;
721 unsigned long long tmp;
721 722
722 struct acpi_ec *ec = context; 723 struct acpi_ec *ec = context;
723 status = acpi_walk_resources(handle, METHOD_NAME__CRS, 724 status = acpi_walk_resources(handle, METHOD_NAME__CRS,
@@ -727,11 +728,13 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
727 728
728 /* Get GPE bit assignment (EC events). */ 729 /* Get GPE bit assignment (EC events). */
729 /* TODO: Add support for _GPE returning a package */ 730 /* TODO: Add support for _GPE returning a package */
730 status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe); 731 status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp);
731 if (ACPI_FAILURE(status)) 732 if (ACPI_FAILURE(status))
732 return status; 733 return status;
734 ec->gpe = tmp;
733 /* Use the global lock for all EC transactions? */ 735 /* Use the global lock for all EC transactions? */
734 acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock); 736 acpi_evaluate_integer(handle, "_GLK", NULL, &tmp);
737 ec->global_lock = tmp;
735 ec->handle = handle; 738 ec->handle = handle;
736 return AE_CTRL_TERMINATE; 739 return AE_CTRL_TERMINATE;
737} 740}
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index cb9864e39bae..25ceae9191ef 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -258,7 +258,7 @@ int __init acpi_numa_init(void)
258 258
259int acpi_get_pxm(acpi_handle h) 259int acpi_get_pxm(acpi_handle h)
260{ 260{
261 unsigned long pxm; 261 unsigned long long pxm;
262 acpi_status status; 262 acpi_status status;
263 acpi_handle handle; 263 acpi_handle handle;
264 acpi_handle phandle = h; 264 acpi_handle phandle = h;
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 235a1386888a..f58fcbbc810d 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -608,7 +608,7 @@ static void acpi_os_derive_pci_id_2(acpi_handle rhandle, /* upper bound */
608 acpi_handle handle; 608 acpi_handle handle;
609 struct acpi_pci_id *pci_id = *id; 609 struct acpi_pci_id *pci_id = *id;
610 acpi_status status; 610 acpi_status status;
611 unsigned long temp; 611 unsigned long long temp;
612 acpi_object_type type; 612 acpi_object_type type;
613 613
614 acpi_get_parent(chandle, &handle); 614 acpi_get_parent(chandle, &handle);
@@ -620,8 +620,7 @@ static void acpi_os_derive_pci_id_2(acpi_handle rhandle, /* upper bound */
620 if ((ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE)) 620 if ((ACPI_FAILURE(status)) || (type != ACPI_TYPE_DEVICE))
621 return; 621 return;
622 622
623 status = 623 status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
624 acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
625 &temp); 624 &temp);
626 if (ACPI_SUCCESS(status)) { 625 if (ACPI_SUCCESS(status)) {
627 u32 val; 626 u32 val;
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index c3fed31166b5..18ff4e5c8d81 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -190,7 +190,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
190 struct acpi_pci_root *root = NULL; 190 struct acpi_pci_root *root = NULL;
191 struct acpi_pci_root *tmp; 191 struct acpi_pci_root *tmp;
192 acpi_status status = AE_OK; 192 acpi_status status = AE_OK;
193 unsigned long value = 0; 193 unsigned long long value = 0;
194 acpi_handle handle = NULL; 194 acpi_handle handle = NULL;
195 struct acpi_device *child; 195 struct acpi_device *child;
196 196
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
index d5b4ef898879..9bb84d4596be 100644
--- a/drivers/acpi/pci_slot.c
+++ b/drivers/acpi/pci_slot.c
@@ -76,10 +76,10 @@ static struct acpi_pci_driver acpi_pci_slot_driver = {
76}; 76};
77 77
78static int 78static int
79check_slot(acpi_handle handle, unsigned long *sun) 79check_slot(acpi_handle handle, unsigned long long *sun)
80{ 80{
81 int device = -1; 81 int device = -1;
82 unsigned long adr, sta; 82 unsigned long long adr, sta;
83 acpi_status status; 83 acpi_status status;
84 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 84 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
85 85
@@ -132,7 +132,7 @@ static acpi_status
132register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) 132register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
133{ 133{
134 int device; 134 int device;
135 unsigned long sun; 135 unsigned long long sun;
136 char name[SLOT_NAME_SIZE]; 136 char name[SLOT_NAME_SIZE];
137 struct acpi_pci_slot *slot; 137 struct acpi_pci_slot *slot;
138 struct pci_slot *pci_slot; 138 struct pci_slot *pci_slot;
@@ -182,7 +182,7 @@ static acpi_status
182walk_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv) 182walk_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
183{ 183{
184 int device, function; 184 int device, function;
185 unsigned long adr; 185 unsigned long long adr;
186 acpi_status status; 186 acpi_status status;
187 acpi_handle dummy_handle; 187 acpi_handle dummy_handle;
188 acpi_walk_callback user_function; 188 acpi_walk_callback user_function;
@@ -239,7 +239,7 @@ static int
239walk_root_bridge(acpi_handle handle, acpi_walk_callback user_function) 239walk_root_bridge(acpi_handle handle, acpi_walk_callback user_function)
240{ 240{
241 int seg, bus; 241 int seg, bus;
242 unsigned long tmp; 242 unsigned long long tmp;
243 acpi_status status; 243 acpi_status status;
244 acpi_handle dummy_handle; 244 acpi_handle dummy_handle;
245 struct pci_bus *pci_bus; 245 struct pci_bus *pci_bus;
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 4ab21cb1c8c7..89e5d2a8c33a 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -131,7 +131,7 @@ acpi_power_get_context(acpi_handle handle,
131static int acpi_power_get_state(struct acpi_power_resource *resource, int *state) 131static int acpi_power_get_state(struct acpi_power_resource *resource, int *state)
132{ 132{
133 acpi_status status = AE_OK; 133 acpi_status status = AE_OK;
134 unsigned long sta = 0; 134 unsigned long long sta = 0;
135 135
136 136
137 if (!resource || !state) 137 if (!resource || !state)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index ee68ac54c0d4..8a2787141f80 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -563,7 +563,7 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
563 563
564 /* Check if it is a Device with HID and UID */ 564 /* Check if it is a Device with HID and UID */
565 if (has_uid) { 565 if (has_uid) {
566 unsigned long value; 566 unsigned long long value;
567 status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID, 567 status = acpi_evaluate_integer(pr->handle, METHOD_NAME__UID,
568 NULL, &value); 568 NULL, &value);
569 if (ACPI_FAILURE(status)) { 569 if (ACPI_FAILURE(status)) {
@@ -875,7 +875,7 @@ static int acpi_processor_remove(struct acpi_device *device, int type)
875static int is_processor_present(acpi_handle handle) 875static int is_processor_present(acpi_handle handle)
876{ 876{
877 acpi_status status; 877 acpi_status status;
878 unsigned long sta = 0; 878 unsigned long long sta = 0;
879 879
880 880
881 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 881 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 80c251ec6d2a..f8129c7277f1 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -126,7 +126,7 @@ static struct notifier_block acpi_ppc_notifier_block = {
126static int acpi_processor_get_platform_limit(struct acpi_processor *pr) 126static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
127{ 127{
128 acpi_status status = 0; 128 acpi_status status = 0;
129 unsigned long ppc = 0; 129 unsigned long long ppc = 0;
130 130
131 131
132 if (!pr) 132 if (!pr)
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index a56fc6c4394b..3097b752003d 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -274,7 +274,7 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data)
274static int acpi_processor_get_platform_limit(struct acpi_processor *pr) 274static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
275{ 275{
276 acpi_status status = 0; 276 acpi_status status = 0;
277 unsigned long tpc = 0; 277 unsigned long long tpc = 0;
278 278
279 if (!pr) 279 if (!pr)
280 return -EINVAL; 280 return -EINVAL;
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
index a4e3767b8c64..81d23d38ec91 100644
--- a/drivers/acpi/sbshc.c
+++ b/drivers/acpi/sbshc.c
@@ -258,7 +258,7 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
258static int acpi_smbus_hc_add(struct acpi_device *device) 258static int acpi_smbus_hc_add(struct acpi_device *device)
259{ 259{
260 int status; 260 int status;
261 unsigned long val; 261 unsigned long long val;
262 struct acpi_smb_hc *hc; 262 struct acpi_smb_hc *hc;
263 263
264 if (!device) 264 if (!device)
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index d13194a031bf..b32ba565e69e 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -444,7 +444,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int *d_min_p)
444 acpi_handle handle = DEVICE_ACPI_HANDLE(dev); 444 acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
445 struct acpi_device *adev; 445 struct acpi_device *adev;
446 char acpi_method[] = "_SxD"; 446 char acpi_method[] = "_SxD";
447 unsigned long d_min, d_max; 447 unsigned long long d_min, d_max;
448 448
449 if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { 449 if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
450 printk(KERN_DEBUG "ACPI handle has no context!\n"); 450 printk(KERN_DEBUG "ACPI handle has no context!\n");
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 912703691d36..47abb94bdfb9 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -246,18 +246,18 @@ static const struct file_operations acpi_thermal_polling_fops = {
246static int acpi_thermal_get_temperature(struct acpi_thermal *tz) 246static int acpi_thermal_get_temperature(struct acpi_thermal *tz)
247{ 247{
248 acpi_status status = AE_OK; 248 acpi_status status = AE_OK;
249 249 unsigned long long tmp;
250 250
251 if (!tz) 251 if (!tz)
252 return -EINVAL; 252 return -EINVAL;
253 253
254 tz->last_temperature = tz->temperature; 254 tz->last_temperature = tz->temperature;
255 255
256 status = 256 status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp);
257 acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tz->temperature);
258 if (ACPI_FAILURE(status)) 257 if (ACPI_FAILURE(status))
259 return -ENODEV; 258 return -ENODEV;
260 259
260 tz->temperature = tmp;
261 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", 261 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n",
262 tz->temperature)); 262 tz->temperature));
263 263
@@ -267,17 +267,16 @@ static int acpi_thermal_get_temperature(struct acpi_thermal *tz)
267static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz) 267static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
268{ 268{
269 acpi_status status = AE_OK; 269 acpi_status status = AE_OK;
270 270 unsigned long long tmp;
271 271
272 if (!tz) 272 if (!tz)
273 return -EINVAL; 273 return -EINVAL;
274 274
275 status = 275 status = acpi_evaluate_integer(tz->device->handle, "_TZP", NULL, &tmp);
276 acpi_evaluate_integer(tz->device->handle, "_TZP", NULL,
277 &tz->polling_frequency);
278 if (ACPI_FAILURE(status)) 276 if (ACPI_FAILURE(status))
279 return -ENODEV; 277 return -ENODEV;
280 278
279 tz->polling_frequency = tmp;
281 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n", 280 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency is %lu dS\n",
282 tz->polling_frequency)); 281 tz->polling_frequency));
283 282
@@ -356,6 +355,7 @@ do { \
356static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag) 355static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
357{ 356{
358 acpi_status status = AE_OK; 357 acpi_status status = AE_OK;
358 unsigned long long tmp;
359 struct acpi_handle_list devices; 359 struct acpi_handle_list devices;
360 int valid = 0; 360 int valid = 0;
361 int i; 361 int i;
@@ -363,7 +363,8 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
363 /* Critical Shutdown (required) */ 363 /* Critical Shutdown (required) */
364 if (flag & ACPI_TRIPS_CRITICAL) { 364 if (flag & ACPI_TRIPS_CRITICAL) {
365 status = acpi_evaluate_integer(tz->device->handle, 365 status = acpi_evaluate_integer(tz->device->handle,
366 "_CRT", NULL, &tz->trips.critical.temperature); 366 "_CRT", NULL, &tmp);
367 tz->trips.critical.temperature = tmp;
367 /* 368 /*
368 * Treat freezing temperatures as invalid as well; some 369 * Treat freezing temperatures as invalid as well; some
369 * BIOSes return really low values and cause reboots at startup. 370 * BIOSes return really low values and cause reboots at startup.
@@ -399,12 +400,13 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
399 /* Critical Sleep (optional) */ 400 /* Critical Sleep (optional) */
400 if (flag & ACPI_TRIPS_HOT) { 401 if (flag & ACPI_TRIPS_HOT) {
401 status = acpi_evaluate_integer(tz->device->handle, 402 status = acpi_evaluate_integer(tz->device->handle,
402 "_HOT", NULL, &tz->trips.hot.temperature); 403 "_HOT", NULL, &tmp);
403 if (ACPI_FAILURE(status)) { 404 if (ACPI_FAILURE(status)) {
404 tz->trips.hot.flags.valid = 0; 405 tz->trips.hot.flags.valid = 0;
405 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 406 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
406 "No hot threshold\n")); 407 "No hot threshold\n"));
407 } else { 408 } else {
409 tz->trips.hot.temperature = tmp;
408 tz->trips.hot.flags.valid = 1; 410 tz->trips.hot.flags.valid = 1;
409 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 411 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
410 "Found hot threshold [%lu]\n", 412 "Found hot threshold [%lu]\n",
@@ -418,33 +420,40 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
418 if (psv == -1) { 420 if (psv == -1) {
419 status = AE_SUPPORT; 421 status = AE_SUPPORT;
420 } else if (psv > 0) { 422 } else if (psv > 0) {
421 tz->trips.passive.temperature = CELSIUS_TO_KELVIN(psv); 423 tmp = CELSIUS_TO_KELVIN(psv);
422 status = AE_OK; 424 status = AE_OK;
423 } else { 425 } else {
424 status = acpi_evaluate_integer(tz->device->handle, 426 status = acpi_evaluate_integer(tz->device->handle,
425 "_PSV", NULL, &tz->trips.passive.temperature); 427 "_PSV", NULL, &tmp);
426 } 428 }
427 429
428 if (ACPI_FAILURE(status)) 430 if (ACPI_FAILURE(status))
429 tz->trips.passive.flags.valid = 0; 431 tz->trips.passive.flags.valid = 0;
430 else { 432 else {
433 tz->trips.passive.temperature = tmp;
431 tz->trips.passive.flags.valid = 1; 434 tz->trips.passive.flags.valid = 1;
432 if (flag == ACPI_TRIPS_INIT) { 435 if (flag == ACPI_TRIPS_INIT) {
433 status = acpi_evaluate_integer( 436 status = acpi_evaluate_integer(
434 tz->device->handle, "_TC1", 437 tz->device->handle, "_TC1",
435 NULL, &tz->trips.passive.tc1); 438 NULL, &tmp);
436 if (ACPI_FAILURE(status)) 439 if (ACPI_FAILURE(status))
437 tz->trips.passive.flags.valid = 0; 440 tz->trips.passive.flags.valid = 0;
441 else
442 tz->trips.passive.tc1 = tmp;
438 status = acpi_evaluate_integer( 443 status = acpi_evaluate_integer(
439 tz->device->handle, "_TC2", 444 tz->device->handle, "_TC2",
440 NULL, &tz->trips.passive.tc2); 445 NULL, &tmp);
441 if (ACPI_FAILURE(status)) 446 if (ACPI_FAILURE(status))
442 tz->trips.passive.flags.valid = 0; 447 tz->trips.passive.flags.valid = 0;
448 else
449 tz->trips.passive.tc2 = tmp;
443 status = acpi_evaluate_integer( 450 status = acpi_evaluate_integer(
444 tz->device->handle, "_TSP", 451 tz->device->handle, "_TSP",
445 NULL, &tz->trips.passive.tsp); 452 NULL, &tmp);
446 if (ACPI_FAILURE(status)) 453 if (ACPI_FAILURE(status))
447 tz->trips.passive.flags.valid = 0; 454 tz->trips.passive.flags.valid = 0;
455 else
456 tz->trips.passive.tsp = tmp;
448 } 457 }
449 } 458 }
450 } 459 }
@@ -479,7 +488,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
479 488
480 if (flag & ACPI_TRIPS_ACTIVE) { 489 if (flag & ACPI_TRIPS_ACTIVE) {
481 status = acpi_evaluate_integer(tz->device->handle, 490 status = acpi_evaluate_integer(tz->device->handle,
482 name, NULL, &tz->trips.active[i].temperature); 491 name, NULL, &tmp);
483 if (ACPI_FAILURE(status)) { 492 if (ACPI_FAILURE(status)) {
484 tz->trips.active[i].flags.valid = 0; 493 tz->trips.active[i].flags.valid = 0;
485 if (i == 0) 494 if (i == 0)
@@ -500,8 +509,10 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
500 tz->trips.active[i - 2].temperature : 509 tz->trips.active[i - 2].temperature :
501 CELSIUS_TO_KELVIN(act)); 510 CELSIUS_TO_KELVIN(act));
502 break; 511 break;
503 } else 512 } else {
513 tz->trips.active[i].temperature = tmp;
504 tz->trips.active[i].flags.valid = 1; 514 tz->trips.active[i].flags.valid = 1;
515 }
505 } 516 }
506 517
507 name[2] = 'L'; 518 name[2] = 'L';
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index 100926143818..e827be36ee8d 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -256,7 +256,7 @@ EXPORT_SYMBOL(acpi_extract_package);
256acpi_status 256acpi_status
257acpi_evaluate_integer(acpi_handle handle, 257acpi_evaluate_integer(acpi_handle handle,
258 acpi_string pathname, 258 acpi_string pathname,
259 struct acpi_object_list *arguments, unsigned long *data) 259 struct acpi_object_list *arguments, unsigned long long *data)
260{ 260{
261 acpi_status status = AE_OK; 261 acpi_status status = AE_OK;
262 union acpi_object *element; 262 union acpi_object *element;
@@ -288,7 +288,7 @@ acpi_evaluate_integer(acpi_handle handle,
288 *data = element->integer.value; 288 *data = element->integer.value;
289 kfree(element); 289 kfree(element);
290 290
291 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%lu]\n", *data)); 291 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Return value [%llu]\n", *data));
292 292
293 return AE_OK; 293 return AE_OK;
294} 294}
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index e8a51a1700f7..79409c9d2ad6 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -291,20 +291,20 @@ static int acpi_video_device_lcd_set_level(struct acpi_video_device *device,
291 int level); 291 int level);
292static int acpi_video_device_lcd_get_level_current( 292static int acpi_video_device_lcd_get_level_current(
293 struct acpi_video_device *device, 293 struct acpi_video_device *device,
294 unsigned long *level); 294 unsigned long long *level);
295static int acpi_video_get_next_level(struct acpi_video_device *device, 295static int acpi_video_get_next_level(struct acpi_video_device *device,
296 u32 level_current, u32 event); 296 u32 level_current, u32 event);
297static void acpi_video_switch_brightness(struct acpi_video_device *device, 297static void acpi_video_switch_brightness(struct acpi_video_device *device,
298 int event); 298 int event);
299static int acpi_video_device_get_state(struct acpi_video_device *device, 299static int acpi_video_device_get_state(struct acpi_video_device *device,
300 unsigned long *state); 300 unsigned long long *state);
301static int acpi_video_output_get(struct output_device *od); 301static int acpi_video_output_get(struct output_device *od);
302static int acpi_video_device_set_state(struct acpi_video_device *device, int state); 302static int acpi_video_device_set_state(struct acpi_video_device *device, int state);
303 303
304/*backlight device sysfs support*/ 304/*backlight device sysfs support*/
305static int acpi_video_get_brightness(struct backlight_device *bd) 305static int acpi_video_get_brightness(struct backlight_device *bd)
306{ 306{
307 unsigned long cur_level; 307 unsigned long long cur_level;
308 int i; 308 int i;
309 struct acpi_video_device *vd = 309 struct acpi_video_device *vd =
310 (struct acpi_video_device *)bl_get_data(bd); 310 (struct acpi_video_device *)bl_get_data(bd);
@@ -336,7 +336,7 @@ static struct backlight_ops acpi_backlight_ops = {
336/*video output device sysfs support*/ 336/*video output device sysfs support*/
337static int acpi_video_output_get(struct output_device *od) 337static int acpi_video_output_get(struct output_device *od)
338{ 338{
339 unsigned long state; 339 unsigned long long state;
340 struct acpi_video_device *vd = 340 struct acpi_video_device *vd =
341 (struct acpi_video_device *)dev_get_drvdata(&od->dev); 341 (struct acpi_video_device *)dev_get_drvdata(&od->dev);
342 acpi_video_device_get_state(vd, &state); 342 acpi_video_device_get_state(vd, &state);
@@ -370,7 +370,7 @@ static int video_get_cur_state(struct thermal_cooling_device *cdev, char *buf)
370{ 370{
371 struct acpi_device *device = cdev->devdata; 371 struct acpi_device *device = cdev->devdata;
372 struct acpi_video_device *video = acpi_driver_data(device); 372 struct acpi_video_device *video = acpi_driver_data(device);
373 unsigned long level; 373 unsigned long long level;
374 int state; 374 int state;
375 375
376 acpi_video_device_lcd_get_level_current(video, &level); 376 acpi_video_device_lcd_get_level_current(video, &level);
@@ -410,7 +410,7 @@ static struct thermal_cooling_device_ops video_cooling_ops = {
410/* device */ 410/* device */
411 411
412static int 412static int
413acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) 413acpi_video_device_query(struct acpi_video_device *device, unsigned long long *state)
414{ 414{
415 int status; 415 int status;
416 416
@@ -421,7 +421,7 @@ acpi_video_device_query(struct acpi_video_device *device, unsigned long *state)
421 421
422static int 422static int
423acpi_video_device_get_state(struct acpi_video_device *device, 423acpi_video_device_get_state(struct acpi_video_device *device,
424 unsigned long *state) 424 unsigned long long *state)
425{ 425{
426 int status; 426 int status;
427 427
@@ -436,7 +436,7 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state)
436 int status; 436 int status;
437 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 437 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
438 struct acpi_object_list args = { 1, &arg0 }; 438 struct acpi_object_list args = { 1, &arg0 };
439 unsigned long ret; 439 unsigned long long ret;
440 440
441 441
442 arg0.integer.value = state; 442 arg0.integer.value = state;
@@ -495,7 +495,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
495 495
496static int 496static int
497acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, 497acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
498 unsigned long *level) 498 unsigned long long *level)
499{ 499{
500 if (device->cap._BQC) 500 if (device->cap._BQC)
501 return acpi_evaluate_integer(device->dev->handle, "_BQC", NULL, 501 return acpi_evaluate_integer(device->dev->handle, "_BQC", NULL,
@@ -549,7 +549,7 @@ static int
549acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) 549acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
550{ 550{
551 int status; 551 int status;
552 unsigned long tmp; 552 unsigned long long tmp;
553 union acpi_object arg0 = { ACPI_TYPE_INTEGER }; 553 union acpi_object arg0 = { ACPI_TYPE_INTEGER };
554 struct acpi_object_list args = { 1, &arg0 }; 554 struct acpi_object_list args = { 1, &arg0 };
555 555
@@ -564,7 +564,7 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
564} 564}
565 565
566static int 566static int
567acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id) 567acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long long *id)
568{ 568{
569 int status; 569 int status;
570 570
@@ -575,7 +575,7 @@ acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id)
575 575
576static int 576static int
577acpi_video_bus_POST_options(struct acpi_video_bus *video, 577acpi_video_bus_POST_options(struct acpi_video_bus *video,
578 unsigned long *options) 578 unsigned long long *options)
579{ 579{
580 int status; 580 int status;
581 581
@@ -918,7 +918,7 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset)
918{ 918{
919 int status; 919 int status;
920 struct acpi_video_device *dev = seq->private; 920 struct acpi_video_device *dev = seq->private;
921 unsigned long state; 921 unsigned long long state;
922 922
923 923
924 if (!dev) 924 if (!dev)
@@ -927,14 +927,14 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset)
927 status = acpi_video_device_get_state(dev, &state); 927 status = acpi_video_device_get_state(dev, &state);
928 seq_printf(seq, "state: "); 928 seq_printf(seq, "state: ");
929 if (ACPI_SUCCESS(status)) 929 if (ACPI_SUCCESS(status))
930 seq_printf(seq, "0x%02lx\n", state); 930 seq_printf(seq, "0x%02llx\n", state);
931 else 931 else
932 seq_printf(seq, "<not supported>\n"); 932 seq_printf(seq, "<not supported>\n");
933 933
934 status = acpi_video_device_query(dev, &state); 934 status = acpi_video_device_query(dev, &state);
935 seq_printf(seq, "query: "); 935 seq_printf(seq, "query: ");
936 if (ACPI_SUCCESS(status)) 936 if (ACPI_SUCCESS(status))
937 seq_printf(seq, "0x%02lx\n", state); 937 seq_printf(seq, "0x%02llx\n", state);
938 else 938 else
939 seq_printf(seq, "<not supported>\n"); 939 seq_printf(seq, "<not supported>\n");
940 940
@@ -1217,7 +1217,7 @@ static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file)
1217static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) 1217static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
1218{ 1218{
1219 struct acpi_video_bus *video = seq->private; 1219 struct acpi_video_bus *video = seq->private;
1220 unsigned long options; 1220 unsigned long long options;
1221 int status; 1221 int status;
1222 1222
1223 1223
@@ -1232,7 +1232,7 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset)
1232 printk(KERN_WARNING PREFIX 1232 printk(KERN_WARNING PREFIX
1233 "This indicates a BIOS bug. Please contact the manufacturer.\n"); 1233 "This indicates a BIOS bug. Please contact the manufacturer.\n");
1234 } 1234 }
1235 printk("%lx\n", options); 1235 printk("%llx\n", options);
1236 seq_printf(seq, "can POST: <integrated video>"); 1236 seq_printf(seq, "can POST: <integrated video>");
1237 if (options & 2) 1237 if (options & 2)
1238 seq_printf(seq, " <PCI video>"); 1238 seq_printf(seq, " <PCI video>");
@@ -1256,7 +1256,7 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset)
1256{ 1256{
1257 struct acpi_video_bus *video = seq->private; 1257 struct acpi_video_bus *video = seq->private;
1258 int status; 1258 int status;
1259 unsigned long id; 1259 unsigned long long id;
1260 1260
1261 1261
1262 if (!video) 1262 if (!video)
@@ -1303,7 +1303,7 @@ acpi_video_bus_write_POST(struct file *file,
1303 struct seq_file *m = file->private_data; 1303 struct seq_file *m = file->private_data;
1304 struct acpi_video_bus *video = m->private; 1304 struct acpi_video_bus *video = m->private;
1305 char str[12] = { 0 }; 1305 char str[12] = { 0 };
1306 unsigned long opt, options; 1306 unsigned long long opt, options;
1307 1307
1308 1308
1309 if (!video || count + 1 > sizeof str) 1309 if (!video || count + 1 > sizeof str)
@@ -1473,7 +1473,7 @@ static int
1473acpi_video_bus_get_one_device(struct acpi_device *device, 1473acpi_video_bus_get_one_device(struct acpi_device *device,
1474 struct acpi_video_bus *video) 1474 struct acpi_video_bus *video)
1475{ 1475{
1476 unsigned long device_id; 1476 unsigned long long device_id;
1477 int status; 1477 int status;
1478 struct acpi_video_device *data; 1478 struct acpi_video_device *data;
1479 struct acpi_video_device_attrib* attribute; 1479 struct acpi_video_device_attrib* attribute;
@@ -1724,7 +1724,7 @@ acpi_video_get_next_level(struct acpi_video_device *device,
1724static void 1724static void
1725acpi_video_switch_brightness(struct acpi_video_device *device, int event) 1725acpi_video_switch_brightness(struct acpi_video_device *device, int event)
1726{ 1726{
1727 unsigned long level_current, level_next; 1727 unsigned long long level_current, level_next;
1728 if (!device->brightness) 1728 if (!device->brightness)
1729 return; 1729 return;
1730 acpi_video_device_lcd_get_level_current(device, &level_current); 1730 acpi_video_device_lcd_get_level_current(device, &level_current);