aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@linux.intel.com>2006-05-19 16:54:48 -0400
committerLen Brown <len.brown@intel.com>2006-06-30 02:46:18 -0400
commit901302688cb85b49a9551ec1f6aa86fb081ae49e (patch)
treebf22c2ee09a2fc2fca5dc8ec093457d6a1bec282 /drivers/acpi
parent38ba7c9ed2e1a222103332031f76c28b726573f5 (diff)
ACPI: video: Use acpi_device's handle instead of driver's
Signed-off-by: Patrick Mochel <mochel@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/video.c62
1 files changed, 30 insertions, 32 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index cee9a50fdf91..862cefaff602 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -273,7 +273,8 @@ static int
273acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) 273acpi_video_device_query(struct acpi_video_device *device, unsigned long *state)
274{ 274{
275 int status; 275 int status;
276 status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state); 276
277 status = acpi_evaluate_integer(device->dev->handle, "_DGS", NULL, state);
277 278
278 return status; 279 return status;
279} 280}
@@ -284,8 +285,7 @@ acpi_video_device_get_state(struct acpi_video_device *device,
284{ 285{
285 int status; 286 int status;
286 287
287 288 status = acpi_evaluate_integer(device->dev->handle, "_DCS", NULL, state);
288 status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state);
289 289
290 return status; 290 return status;
291} 291}
@@ -300,7 +300,7 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state)
300 300
301 301
302 arg0.integer.value = state; 302 arg0.integer.value = state;
303 status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret); 303 status = acpi_evaluate_integer(device->dev->handle, "_DSS", &args, &ret);
304 304
305 return status; 305 return status;
306} 306}
@@ -316,7 +316,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
316 316
317 *levels = NULL; 317 *levels = NULL;
318 318
319 status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer); 319 status = acpi_evaluate_object(device->dev->handle, "_BCL", NULL, &buffer);
320 if (!ACPI_SUCCESS(status)) 320 if (!ACPI_SUCCESS(status))
321 return status; 321 return status;
322 obj = (union acpi_object *)buffer.pointer; 322 obj = (union acpi_object *)buffer.pointer;
@@ -345,7 +345,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
345 345
346 346
347 arg0.integer.value = level; 347 arg0.integer.value = level;
348 status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL); 348 status = acpi_evaluate_object(device->dev->handle, "_BCM", &args, NULL);
349 349
350 printk(KERN_DEBUG "set_level status: %x\n", status); 350 printk(KERN_DEBUG "set_level status: %x\n", status);
351 return status; 351 return status;
@@ -357,7 +357,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
357{ 357{
358 int status; 358 int status;
359 359
360 status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level); 360 status = acpi_evaluate_integer(device->dev->handle, "_BQC", NULL, level);
361 361
362 return status; 362 return status;
363} 363}
@@ -384,7 +384,7 @@ acpi_video_device_EDID(struct acpi_video_device *device,
384 else 384 else
385 return -EINVAL; 385 return -EINVAL;
386 386
387 status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer); 387 status = acpi_evaluate_object(device->dev->handle, "_DDC", &args, &buffer);
388 if (ACPI_FAILURE(status)) 388 if (ACPI_FAILURE(status))
389 return -ENODEV; 389 return -ENODEV;
390 390
@@ -414,7 +414,7 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option)
414 414
415 arg0.integer.value = option; 415 arg0.integer.value = option;
416 416
417 status = acpi_evaluate_integer(video->handle, "_SPD", &args, &tmp); 417 status = acpi_evaluate_integer(video->device->handle, "_SPD", &args, &tmp);
418 if (ACPI_SUCCESS(status)) 418 if (ACPI_SUCCESS(status))
419 status = tmp ? (-EINVAL) : (AE_OK); 419 status = tmp ? (-EINVAL) : (AE_OK);
420 420
@@ -426,8 +426,7 @@ acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id)
426{ 426{
427 int status; 427 int status;
428 428
429 429 status = acpi_evaluate_integer(video->device->handle, "_GPD", NULL, id);
430 status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id);
431 430
432 return status; 431 return status;
433} 432}
@@ -438,7 +437,7 @@ acpi_video_bus_POST_options(struct acpi_video_bus *video,
438{ 437{
439 int status; 438 int status;
440 439
441 status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options); 440 status = acpi_evaluate_integer(video->device->handle, "_VPO", NULL, options);
442 *options &= 3; 441 *options &= 3;
443 442
444 return status; 443 return status;
@@ -479,7 +478,7 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
479 } 478 }
480 arg0.integer.value = (lcd_flag << 2) | bios_flag; 479 arg0.integer.value = (lcd_flag << 2) | bios_flag;
481 video->dos_setting = arg0.integer.value; 480 video->dos_setting = arg0.integer.value;
482 acpi_evaluate_object(video->handle, "_DOS", &args, NULL); 481 acpi_evaluate_object(video->device->handle, "_DOS", &args, NULL);
483 482
484 Failed: 483 Failed:
485 return status; 484 return status;
@@ -507,25 +506,25 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
507 506
508 memset(&device->cap, 0, 4); 507 memset(&device->cap, 0, 4);
509 508
510 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ADR", &h_dummy1))) { 509 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_ADR", &h_dummy1))) {
511 device->cap._ADR = 1; 510 device->cap._ADR = 1;
512 } 511 }
513 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCL", &h_dummy1))) { 512 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCL", &h_dummy1))) {
514 device->cap._BCL = 1; 513 device->cap._BCL = 1;
515 } 514 }
516 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_BCM", &h_dummy1))) { 515 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_BCM", &h_dummy1))) {
517 device->cap._BCM = 1; 516 device->cap._BCM = 1;
518 } 517 }
519 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DDC", &h_dummy1))) { 518 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DDC", &h_dummy1))) {
520 device->cap._DDC = 1; 519 device->cap._DDC = 1;
521 } 520 }
522 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DCS", &h_dummy1))) { 521 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DCS", &h_dummy1))) {
523 device->cap._DCS = 1; 522 device->cap._DCS = 1;
524 } 523 }
525 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DGS", &h_dummy1))) { 524 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DGS", &h_dummy1))) {
526 device->cap._DGS = 1; 525 device->cap._DGS = 1;
527 } 526 }
528 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DSS", &h_dummy1))) { 527 if (ACPI_SUCCESS(acpi_get_handle(device->dev->handle, "_DSS", &h_dummy1))) {
529 device->cap._DSS = 1; 528 device->cap._DSS = 1;
530 } 529 }
531 530
@@ -589,22 +588,22 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
589 acpi_handle h_dummy1; 588 acpi_handle h_dummy1;
590 589
591 memset(&video->cap, 0, 4); 590 memset(&video->cap, 0, 4);
592 if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOS", &h_dummy1))) { 591 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOS", &h_dummy1))) {
593 video->cap._DOS = 1; 592 video->cap._DOS = 1;
594 } 593 }
595 if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_DOD", &h_dummy1))) { 594 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_DOD", &h_dummy1))) {
596 video->cap._DOD = 1; 595 video->cap._DOD = 1;
597 } 596 }
598 if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_ROM", &h_dummy1))) { 597 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_ROM", &h_dummy1))) {
599 video->cap._ROM = 1; 598 video->cap._ROM = 1;
600 } 599 }
601 if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_GPD", &h_dummy1))) { 600 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_GPD", &h_dummy1))) {
602 video->cap._GPD = 1; 601 video->cap._GPD = 1;
603 } 602 }
604 if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_SPD", &h_dummy1))) { 603 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_SPD", &h_dummy1))) {
605 video->cap._SPD = 1; 604 video->cap._SPD = 1;
606 } 605 }
607 if (ACPI_SUCCESS(acpi_get_handle(video->handle, "_VPO", &h_dummy1))) { 606 if (ACPI_SUCCESS(acpi_get_handle(video->device->handle, "_VPO", &h_dummy1))) {
608 video->cap._VPO = 1; 607 video->cap._VPO = 1;
609 } 608 }
610} 609}
@@ -1299,7 +1298,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
1299 acpi_video_device_bind(video, data); 1298 acpi_video_device_bind(video, data);
1300 acpi_video_device_find_cap(data); 1299 acpi_video_device_find_cap(data);
1301 1300
1302 status = acpi_install_notify_handler(data->handle, 1301 status = acpi_install_notify_handler(device->handle,
1303 ACPI_DEVICE_NOTIFY, 1302 ACPI_DEVICE_NOTIFY,
1304 acpi_video_device_notify, 1303 acpi_video_device_notify,
1305 data); 1304 data);
@@ -1401,8 +1400,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
1401 union acpi_object *dod = NULL; 1400 union acpi_object *dod = NULL;
1402 union acpi_object *obj; 1401 union acpi_object *obj;
1403 1402
1404 1403 status = acpi_evaluate_object(video->device->handle, "_DOD", NULL, &buffer);
1405 status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer);
1406 if (!ACPI_SUCCESS(status)) { 1404 if (!ACPI_SUCCESS(status)) {
1407 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD")); 1405 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD"));
1408 return status; 1406 return status;
@@ -1570,7 +1568,7 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
1570 up(&video->sem); 1568 up(&video->sem);
1571 acpi_video_device_remove_fs(device->dev); 1569 acpi_video_device_remove_fs(device->dev);
1572 1570
1573 status = acpi_remove_notify_handler(device->handle, 1571 status = acpi_remove_notify_handler(device->dev->handle,
1574 ACPI_DEVICE_NOTIFY, 1572 ACPI_DEVICE_NOTIFY,
1575 acpi_video_device_notify); 1573 acpi_video_device_notify);
1576 1574
@@ -1727,7 +1725,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
1727 acpi_video_bus_get_devices(video, device); 1725 acpi_video_bus_get_devices(video, device);
1728 acpi_video_bus_start_devices(video); 1726 acpi_video_bus_start_devices(video);
1729 1727
1730 status = acpi_install_notify_handler(video->handle, 1728 status = acpi_install_notify_handler(device->handle,
1731 ACPI_DEVICE_NOTIFY, 1729 ACPI_DEVICE_NOTIFY,
1732 acpi_video_bus_notify, video); 1730 acpi_video_bus_notify, video);
1733 if (ACPI_FAILURE(status)) { 1731 if (ACPI_FAILURE(status)) {
@@ -1767,7 +1765,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
1767 1765
1768 acpi_video_bus_stop_devices(video); 1766 acpi_video_bus_stop_devices(video);
1769 1767
1770 status = acpi_remove_notify_handler(video->handle, 1768 status = acpi_remove_notify_handler(video->device->handle,
1771 ACPI_DEVICE_NOTIFY, 1769 ACPI_DEVICE_NOTIFY,
1772 acpi_video_bus_notify); 1770 acpi_video_bus_notify);
1773 1771