aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
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/misc
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/misc')
-rw-r--r--drivers/misc/asus-laptop.c12
-rw-r--r--drivers/misc/eeepc-laptop.c2
-rw-r--r--drivers/misc/fujitsu-laptop.c8
-rw-r--r--drivers/misc/intel_menlow.c27
4 files changed, 25 insertions, 24 deletions
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
index 7c6dfd03de9f..967ecec82577 100644
--- a/drivers/misc/asus-laptop.c
+++ b/drivers/misc/asus-laptop.c
@@ -280,7 +280,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
280 280
281static int read_wireless_status(int mask) 281static int read_wireless_status(int mask)
282{ 282{
283 ulong status; 283 unsigned long long status;
284 acpi_status rv = AE_OK; 284 acpi_status rv = AE_OK;
285 285
286 if (!wireless_status_handle) 286 if (!wireless_status_handle)
@@ -297,7 +297,7 @@ static int read_wireless_status(int mask)
297 297
298static int read_gps_status(void) 298static int read_gps_status(void)
299{ 299{
300 ulong status; 300 unsigned long long status;
301 acpi_status rv = AE_OK; 301 acpi_status rv = AE_OK;
302 302
303 rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status); 303 rv = acpi_evaluate_integer(gps_status_handle, NULL, NULL, &status);
@@ -404,7 +404,7 @@ static void lcd_blank(int blank)
404 404
405static int read_brightness(struct backlight_device *bd) 405static int read_brightness(struct backlight_device *bd)
406{ 406{
407 ulong value; 407 unsigned long long value;
408 acpi_status rv = AE_OK; 408 acpi_status rv = AE_OK;
409 409
410 rv = acpi_evaluate_integer(brightness_get_handle, NULL, NULL, &value); 410 rv = acpi_evaluate_integer(brightness_get_handle, NULL, NULL, &value);
@@ -455,7 +455,7 @@ static ssize_t show_infos(struct device *dev,
455 struct device_attribute *attr, char *page) 455 struct device_attribute *attr, char *page)
456{ 456{
457 int len = 0; 457 int len = 0;
458 ulong temp; 458 unsigned long long temp;
459 char buf[16]; //enough for all info 459 char buf[16]; //enough for all info
460 acpi_status rv = AE_OK; 460 acpi_status rv = AE_OK;
461 461
@@ -603,7 +603,7 @@ static void set_display(int value)
603 603
604static int read_display(void) 604static int read_display(void)
605{ 605{
606 ulong value = 0; 606 unsigned long long value = 0;
607 acpi_status rv = AE_OK; 607 acpi_status rv = AE_OK;
608 608
609 /* In most of the case, we know how to set the display, but sometime 609 /* In most of the case, we know how to set the display, but sometime
@@ -849,7 +849,7 @@ static int asus_hotk_get_info(void)
849{ 849{
850 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 850 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
851 union acpi_object *model = NULL; 851 union acpi_object *model = NULL;
852 ulong bsts_result, hwrs_result; 852 unsigned long long bsts_result, hwrs_result;
853 char *string = NULL; 853 char *string = NULL;
854 acpi_status status; 854 acpi_status status;
855 855
diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c
index 1ee8501e90f1..616bcbd8def6 100644
--- a/drivers/misc/eeepc-laptop.c
+++ b/drivers/misc/eeepc-laptop.c
@@ -204,7 +204,7 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
204static int read_acpi_int(acpi_handle handle, const char *method, int *val) 204static int read_acpi_int(acpi_handle handle, const char *method, int *val)
205{ 205{
206 acpi_status status; 206 acpi_status status;
207 ulong result; 207 unsigned long long result;
208 208
209 status = acpi_evaluate_integer(handle, (char *)method, NULL, &result); 209 status = acpi_evaluate_integer(handle, (char *)method, NULL, &result);
210 if (ACPI_FAILURE(status)) { 210 if (ACPI_FAILURE(status)) {
diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c
index 3e56203e4947..efd395a64720 100644
--- a/drivers/misc/fujitsu-laptop.c
+++ b/drivers/misc/fujitsu-laptop.c
@@ -224,7 +224,7 @@ static int set_lcd_level_alt(int level)
224 224
225static int get_lcd_level(void) 225static int get_lcd_level(void)
226{ 226{
227 unsigned long state = 0; 227 unsigned long long state = 0;
228 acpi_status status = AE_OK; 228 acpi_status status = AE_OK;
229 229
230 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLL\n"); 230 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLL\n");
@@ -246,7 +246,7 @@ static int get_lcd_level(void)
246 246
247static int get_max_brightness(void) 247static int get_max_brightness(void)
248{ 248{
249 unsigned long state = 0; 249 unsigned long long state = 0;
250 acpi_status status = AE_OK; 250 acpi_status status = AE_OK;
251 251
252 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get max lcd level via RBLL\n"); 252 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get max lcd level via RBLL\n");
@@ -263,7 +263,7 @@ static int get_max_brightness(void)
263 263
264static int get_lcd_level_alt(void) 264static int get_lcd_level_alt(void)
265{ 265{
266 unsigned long state = 0; 266 unsigned long long state = 0;
267 acpi_status status = AE_OK; 267 acpi_status status = AE_OK;
268 268
269 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLS\n"); 269 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLS\n");
@@ -384,7 +384,7 @@ static ssize_t store_lcd_level(struct device *dev,
384 384
385static int get_irb(void) 385static int get_irb(void)
386{ 386{
387 unsigned long state = 0; 387 unsigned long long state = 0;
388 acpi_status status = AE_OK; 388 acpi_status status = AE_OK;
389 389
390 vdbg_printk(FUJLAPTOP_DBG_TRACE, "Get irb\n"); 390 vdbg_printk(FUJLAPTOP_DBG_TRACE, "Get irb\n");
diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c
index 80a136352408..bd372ea11b0a 100644
--- a/drivers/misc/intel_menlow.c
+++ b/drivers/misc/intel_menlow.c
@@ -57,7 +57,7 @@ static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev,
57{ 57{
58 struct acpi_device *device = cdev->devdata; 58 struct acpi_device *device = cdev->devdata;
59 acpi_handle handle = device->handle; 59 acpi_handle handle = device->handle;
60 unsigned long value; 60 unsigned long long value;
61 struct acpi_object_list arg_list; 61 struct acpi_object_list arg_list;
62 union acpi_object arg; 62 union acpi_object arg;
63 acpi_status status = AE_OK; 63 acpi_status status = AE_OK;
@@ -90,7 +90,7 @@ static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev,
90{ 90{
91 struct acpi_device *device = cdev->devdata; 91 struct acpi_device *device = cdev->devdata;
92 acpi_handle handle = device->handle; 92 acpi_handle handle = device->handle;
93 unsigned long value; 93 unsigned long long value;
94 struct acpi_object_list arg_list; 94 struct acpi_object_list arg_list;
95 union acpi_object arg; 95 union acpi_object arg;
96 acpi_status status = AE_OK; 96 acpi_status status = AE_OK;
@@ -115,7 +115,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
115 struct acpi_object_list arg_list; 115 struct acpi_object_list arg_list;
116 union acpi_object arg; 116 union acpi_object arg;
117 acpi_status status; 117 acpi_status status;
118 int temp; 118 unsigned long long temp;
119 unsigned long max_state; 119 unsigned long max_state;
120 120
121 if (memory_get_int_max_bandwidth(cdev, &max_state)) 121 if (memory_get_int_max_bandwidth(cdev, &max_state))
@@ -131,7 +131,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
131 131
132 status = 132 status =
133 acpi_evaluate_integer(handle, MEMORY_SET_BANDWIDTH, &arg_list, 133 acpi_evaluate_integer(handle, MEMORY_SET_BANDWIDTH, &arg_list,
134 (unsigned long *)&temp); 134 &temp);
135 135
136 printk(KERN_INFO 136 printk(KERN_INFO
137 "Bandwidth value was %d: status is %d\n", state, status); 137 "Bandwidth value was %d: status is %d\n", state, status);
@@ -252,7 +252,8 @@ static DEFINE_MUTEX(intel_menlow_attr_lock);
252 * @auxtype : AUX0/AUX1 252 * @auxtype : AUX0/AUX1
253 * @buf: syfs buffer 253 * @buf: syfs buffer
254 */ 254 */
255static int sensor_get_auxtrip(acpi_handle handle, int index, int *value) 255static int sensor_get_auxtrip(acpi_handle handle, int index,
256 unsigned long long *value)
256{ 257{
257 acpi_status status; 258 acpi_status status;
258 259
@@ -260,7 +261,7 @@ static int sensor_get_auxtrip(acpi_handle handle, int index, int *value)
260 return -EINVAL; 261 return -EINVAL;
261 262
262 status = acpi_evaluate_integer(handle, index ? GET_AUX1 : GET_AUX0, 263 status = acpi_evaluate_integer(handle, index ? GET_AUX1 : GET_AUX0,
263 NULL, (unsigned long *)value); 264 NULL, value);
264 if (ACPI_FAILURE(status)) 265 if (ACPI_FAILURE(status))
265 return -EIO; 266 return -EIO;
266 267
@@ -282,13 +283,13 @@ static int sensor_set_auxtrip(acpi_handle handle, int index, int value)
282 struct acpi_object_list args = { 283 struct acpi_object_list args = {
283 1, &arg 284 1, &arg
284 }; 285 };
285 int temp; 286 unsigned long long temp;
286 287
287 if (index != 0 && index != 1) 288 if (index != 0 && index != 1)
288 return -EINVAL; 289 return -EINVAL;
289 290
290 status = acpi_evaluate_integer(handle, index ? GET_AUX0 : GET_AUX1, 291 status = acpi_evaluate_integer(handle, index ? GET_AUX0 : GET_AUX1,
291 NULL, (unsigned long *)&temp); 292 NULL, &temp);
292 if (ACPI_FAILURE(status)) 293 if (ACPI_FAILURE(status))
293 return -EIO; 294 return -EIO;
294 if ((index && value < temp) || (!index && value > temp)) 295 if ((index && value < temp) || (!index && value > temp))
@@ -296,7 +297,7 @@ static int sensor_set_auxtrip(acpi_handle handle, int index, int value)
296 297
297 arg.integer.value = value; 298 arg.integer.value = value;
298 status = acpi_evaluate_integer(handle, index ? SET_AUX1 : SET_AUX0, 299 status = acpi_evaluate_integer(handle, index ? SET_AUX1 : SET_AUX0,
299 &args, (unsigned long *)&temp); 300 &args, &temp);
300 if (ACPI_FAILURE(status)) 301 if (ACPI_FAILURE(status))
301 return -EIO; 302 return -EIO;
302 303
@@ -312,7 +313,7 @@ static ssize_t aux0_show(struct device *dev,
312 struct device_attribute *dev_attr, char *buf) 313 struct device_attribute *dev_attr, char *buf)
313{ 314{
314 struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr); 315 struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr);
315 int value; 316 unsigned long long value;
316 int result; 317 int result;
317 318
318 result = sensor_get_auxtrip(attr->handle, 0, &value); 319 result = sensor_get_auxtrip(attr->handle, 0, &value);
@@ -324,7 +325,7 @@ static ssize_t aux1_show(struct device *dev,
324 struct device_attribute *dev_attr, char *buf) 325 struct device_attribute *dev_attr, char *buf)
325{ 326{
326 struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr); 327 struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr);
327 int value; 328 unsigned long long value;
328 int result; 329 int result;
329 330
330 result = sensor_get_auxtrip(attr->handle, 1, &value); 331 result = sensor_get_auxtrip(attr->handle, 1, &value);
@@ -376,7 +377,7 @@ static ssize_t bios_enabled_show(struct device *dev,
376 struct device_attribute *attr, char *buf) 377 struct device_attribute *attr, char *buf)
377{ 378{
378 acpi_status status; 379 acpi_status status;
379 unsigned long bios_enabled; 380 unsigned long long bios_enabled;
380 381
381 status = acpi_evaluate_integer(NULL, BIOS_ENABLED, NULL, &bios_enabled); 382 status = acpi_evaluate_integer(NULL, BIOS_ENABLED, NULL, &bios_enabled);
382 if (ACPI_FAILURE(status)) 383 if (ACPI_FAILURE(status))
@@ -492,7 +493,7 @@ static int __init intel_menlow_module_init(void)
492{ 493{
493 int result = -ENODEV; 494 int result = -ENODEV;
494 acpi_status status; 495 acpi_status status;
495 unsigned long enable; 496 unsigned long long enable;
496 497
497 if (acpi_disabled) 498 if (acpi_disabled)
498 return result; 499 return result;