diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 238 |
1 files changed, 97 insertions, 141 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index ca37da537bd6..9feb633087a9 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -272,10 +272,9 @@ static int | |||
272 | acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) | 272 | acpi_video_device_query(struct acpi_video_device *device, unsigned long *state) |
273 | { | 273 | { |
274 | int status; | 274 | int status; |
275 | ACPI_FUNCTION_TRACE("acpi_video_device_query"); | ||
276 | status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state); | 275 | status = acpi_evaluate_integer(device->handle, "_DGS", NULL, state); |
277 | 276 | ||
278 | return_VALUE(status); | 277 | return status; |
279 | } | 278 | } |
280 | 279 | ||
281 | static int | 280 | static int |
@@ -284,11 +283,10 @@ acpi_video_device_get_state(struct acpi_video_device *device, | |||
284 | { | 283 | { |
285 | int status; | 284 | int status; |
286 | 285 | ||
287 | ACPI_FUNCTION_TRACE("acpi_video_device_get_state"); | ||
288 | 286 | ||
289 | status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state); | 287 | status = acpi_evaluate_integer(device->handle, "_DCS", NULL, state); |
290 | 288 | ||
291 | return_VALUE(status); | 289 | return status; |
292 | } | 290 | } |
293 | 291 | ||
294 | static int | 292 | static int |
@@ -299,12 +297,11 @@ acpi_video_device_set_state(struct acpi_video_device *device, int state) | |||
299 | struct acpi_object_list args = { 1, &arg0 }; | 297 | struct acpi_object_list args = { 1, &arg0 }; |
300 | unsigned long ret; | 298 | unsigned long ret; |
301 | 299 | ||
302 | ACPI_FUNCTION_TRACE("acpi_video_device_set_state"); | ||
303 | 300 | ||
304 | arg0.integer.value = state; | 301 | arg0.integer.value = state; |
305 | status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret); | 302 | status = acpi_evaluate_integer(device->handle, "_DSS", &args, &ret); |
306 | 303 | ||
307 | return_VALUE(status); | 304 | return status; |
308 | } | 305 | } |
309 | 306 | ||
310 | static int | 307 | static int |
@@ -315,13 +312,12 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device, | |||
315 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 312 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
316 | union acpi_object *obj; | 313 | union acpi_object *obj; |
317 | 314 | ||
318 | ACPI_FUNCTION_TRACE("acpi_video_device_lcd_query_levels"); | ||
319 | 315 | ||
320 | *levels = NULL; | 316 | *levels = NULL; |
321 | 317 | ||
322 | status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer); | 318 | status = acpi_evaluate_object(device->handle, "_BCL", NULL, &buffer); |
323 | if (!ACPI_SUCCESS(status)) | 319 | if (!ACPI_SUCCESS(status)) |
324 | return_VALUE(status); | 320 | return status; |
325 | obj = (union acpi_object *)buffer.pointer; | 321 | obj = (union acpi_object *)buffer.pointer; |
326 | if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { | 322 | if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { |
327 | printk(KERN_ERR PREFIX "Invalid _BCL data\n"); | 323 | printk(KERN_ERR PREFIX "Invalid _BCL data\n"); |
@@ -331,12 +327,12 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device, | |||
331 | 327 | ||
332 | *levels = obj; | 328 | *levels = obj; |
333 | 329 | ||
334 | return_VALUE(0); | 330 | return 0; |
335 | 331 | ||
336 | err: | 332 | err: |
337 | kfree(buffer.pointer); | 333 | kfree(buffer.pointer); |
338 | 334 | ||
339 | return_VALUE(status); | 335 | return status; |
340 | } | 336 | } |
341 | 337 | ||
342 | static int | 338 | static int |
@@ -346,13 +342,12 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) | |||
346 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; | 342 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; |
347 | struct acpi_object_list args = { 1, &arg0 }; | 343 | struct acpi_object_list args = { 1, &arg0 }; |
348 | 344 | ||
349 | ACPI_FUNCTION_TRACE("acpi_video_device_lcd_set_level"); | ||
350 | 345 | ||
351 | arg0.integer.value = level; | 346 | arg0.integer.value = level; |
352 | status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL); | 347 | status = acpi_evaluate_object(device->handle, "_BCM", &args, NULL); |
353 | 348 | ||
354 | printk(KERN_DEBUG "set_level status: %x\n", status); | 349 | printk(KERN_DEBUG "set_level status: %x\n", status); |
355 | return_VALUE(status); | 350 | return status; |
356 | } | 351 | } |
357 | 352 | ||
358 | static int | 353 | static int |
@@ -360,11 +355,10 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device, | |||
360 | unsigned long *level) | 355 | unsigned long *level) |
361 | { | 356 | { |
362 | int status; | 357 | int status; |
363 | ACPI_FUNCTION_TRACE("acpi_video_device_lcd_get_level_current"); | ||
364 | 358 | ||
365 | status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level); | 359 | status = acpi_evaluate_integer(device->handle, "_BQC", NULL, level); |
366 | 360 | ||
367 | return_VALUE(status); | 361 | return status; |
368 | } | 362 | } |
369 | 363 | ||
370 | static int | 364 | static int |
@@ -377,22 +371,21 @@ acpi_video_device_EDID(struct acpi_video_device *device, | |||
377 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; | 371 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; |
378 | struct acpi_object_list args = { 1, &arg0 }; | 372 | struct acpi_object_list args = { 1, &arg0 }; |
379 | 373 | ||
380 | ACPI_FUNCTION_TRACE("acpi_video_device_get_EDID"); | ||
381 | 374 | ||
382 | *edid = NULL; | 375 | *edid = NULL; |
383 | 376 | ||
384 | if (!device) | 377 | if (!device) |
385 | return_VALUE(-ENODEV); | 378 | return -ENODEV; |
386 | if (length == 128) | 379 | if (length == 128) |
387 | arg0.integer.value = 1; | 380 | arg0.integer.value = 1; |
388 | else if (length == 256) | 381 | else if (length == 256) |
389 | arg0.integer.value = 2; | 382 | arg0.integer.value = 2; |
390 | else | 383 | else |
391 | return_VALUE(-EINVAL); | 384 | return -EINVAL; |
392 | 385 | ||
393 | status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer); | 386 | status = acpi_evaluate_object(device->handle, "_DDC", &args, &buffer); |
394 | if (ACPI_FAILURE(status)) | 387 | if (ACPI_FAILURE(status)) |
395 | return_VALUE(-ENODEV); | 388 | return -ENODEV; |
396 | 389 | ||
397 | obj = (union acpi_object *)buffer.pointer; | 390 | obj = (union acpi_object *)buffer.pointer; |
398 | 391 | ||
@@ -404,7 +397,7 @@ acpi_video_device_EDID(struct acpi_video_device *device, | |||
404 | kfree(obj); | 397 | kfree(obj); |
405 | } | 398 | } |
406 | 399 | ||
407 | return_VALUE(status); | 400 | return status; |
408 | } | 401 | } |
409 | 402 | ||
410 | /* bus */ | 403 | /* bus */ |
@@ -417,7 +410,6 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) | |||
417 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; | 410 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; |
418 | struct acpi_object_list args = { 1, &arg0 }; | 411 | struct acpi_object_list args = { 1, &arg0 }; |
419 | 412 | ||
420 | ACPI_FUNCTION_TRACE("acpi_video_bus_set_POST"); | ||
421 | 413 | ||
422 | arg0.integer.value = option; | 414 | arg0.integer.value = option; |
423 | 415 | ||
@@ -425,7 +417,7 @@ acpi_video_bus_set_POST(struct acpi_video_bus *video, unsigned long option) | |||
425 | if (ACPI_SUCCESS(status)) | 417 | if (ACPI_SUCCESS(status)) |
426 | status = tmp ? (-EINVAL) : (AE_OK); | 418 | status = tmp ? (-EINVAL) : (AE_OK); |
427 | 419 | ||
428 | return_VALUE(status); | 420 | return status; |
429 | } | 421 | } |
430 | 422 | ||
431 | static int | 423 | static int |
@@ -433,11 +425,10 @@ acpi_video_bus_get_POST(struct acpi_video_bus *video, unsigned long *id) | |||
433 | { | 425 | { |
434 | int status; | 426 | int status; |
435 | 427 | ||
436 | ACPI_FUNCTION_TRACE("acpi_video_bus_get_POST"); | ||
437 | 428 | ||
438 | status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id); | 429 | status = acpi_evaluate_integer(video->handle, "_GPD", NULL, id); |
439 | 430 | ||
440 | return_VALUE(status); | 431 | return status; |
441 | } | 432 | } |
442 | 433 | ||
443 | static int | 434 | static int |
@@ -445,12 +436,11 @@ acpi_video_bus_POST_options(struct acpi_video_bus *video, | |||
445 | unsigned long *options) | 436 | unsigned long *options) |
446 | { | 437 | { |
447 | int status; | 438 | int status; |
448 | ACPI_FUNCTION_TRACE("acpi_video_bus_POST_options"); | ||
449 | 439 | ||
450 | status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options); | 440 | status = acpi_evaluate_integer(video->handle, "_VPO", NULL, options); |
451 | *options &= 3; | 441 | *options &= 3; |
452 | 442 | ||
453 | return_VALUE(status); | 443 | return status; |
454 | } | 444 | } |
455 | 445 | ||
456 | /* | 446 | /* |
@@ -481,7 +471,6 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) | |||
481 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; | 471 | union acpi_object arg0 = { ACPI_TYPE_INTEGER }; |
482 | struct acpi_object_list args = { 1, &arg0 }; | 472 | struct acpi_object_list args = { 1, &arg0 }; |
483 | 473 | ||
484 | ACPI_FUNCTION_TRACE("acpi_video_bus_DOS"); | ||
485 | 474 | ||
486 | if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) { | 475 | if (bios_flag < 0 || bios_flag > 3 || lcd_flag < 0 || lcd_flag > 1) { |
487 | status = -1; | 476 | status = -1; |
@@ -492,7 +481,7 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag) | |||
492 | acpi_evaluate_object(video->handle, "_DOS", &args, NULL); | 481 | acpi_evaluate_object(video->handle, "_DOS", &args, NULL); |
493 | 482 | ||
494 | Failed: | 483 | Failed: |
495 | return_VALUE(status); | 484 | return status; |
496 | } | 485 | } |
497 | 486 | ||
498 | /* | 487 | /* |
@@ -514,7 +503,6 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
514 | union acpi_object *obj = NULL; | 503 | union acpi_object *obj = NULL; |
515 | struct acpi_video_device_brightness *br = NULL; | 504 | struct acpi_video_device_brightness *br = NULL; |
516 | 505 | ||
517 | ACPI_FUNCTION_TRACE("acpi_video_device_find_cap"); | ||
518 | 506 | ||
519 | memset(&device->cap, 0, 4); | 507 | memset(&device->cap, 0, 4); |
520 | 508 | ||
@@ -582,7 +570,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
582 | 570 | ||
583 | kfree(obj); | 571 | kfree(obj); |
584 | 572 | ||
585 | return_VOID; | 573 | return; |
586 | } | 574 | } |
587 | 575 | ||
588 | /* | 576 | /* |
@@ -629,10 +617,9 @@ static int acpi_video_bus_check(struct acpi_video_bus *video) | |||
629 | { | 617 | { |
630 | acpi_status status = -ENOENT; | 618 | acpi_status status = -ENOENT; |
631 | 619 | ||
632 | ACPI_FUNCTION_TRACE("acpi_video_bus_check"); | ||
633 | 620 | ||
634 | if (!video) | 621 | if (!video) |
635 | return_VALUE(-EINVAL); | 622 | return -EINVAL; |
636 | 623 | ||
637 | /* Since there is no HID, CID and so on for VGA driver, we have | 624 | /* Since there is no HID, CID and so on for VGA driver, we have |
638 | * to check well known required nodes. | 625 | * to check well known required nodes. |
@@ -656,7 +643,7 @@ static int acpi_video_bus_check(struct acpi_video_bus *video) | |||
656 | status = 0; | 643 | status = 0; |
657 | } | 644 | } |
658 | 645 | ||
659 | return_VALUE(status); | 646 | return status; |
660 | } | 647 | } |
661 | 648 | ||
662 | /* -------------------------------------------------------------------------- | 649 | /* -------------------------------------------------------------------------- |
@@ -672,7 +659,6 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset) | |||
672 | struct acpi_video_device *dev = | 659 | struct acpi_video_device *dev = |
673 | (struct acpi_video_device *)seq->private; | 660 | (struct acpi_video_device *)seq->private; |
674 | 661 | ||
675 | ACPI_FUNCTION_TRACE("acpi_video_device_info_seq_show"); | ||
676 | 662 | ||
677 | if (!dev) | 663 | if (!dev) |
678 | goto end; | 664 | goto end; |
@@ -691,7 +677,7 @@ static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset) | |||
691 | seq_printf(seq, "known by bios: %s\n", dev->flags.bios ? "yes" : "no"); | 677 | seq_printf(seq, "known by bios: %s\n", dev->flags.bios ? "yes" : "no"); |
692 | 678 | ||
693 | end: | 679 | end: |
694 | return_VALUE(0); | 680 | return 0; |
695 | } | 681 | } |
696 | 682 | ||
697 | static int | 683 | static int |
@@ -708,7 +694,6 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) | |||
708 | (struct acpi_video_device *)seq->private; | 694 | (struct acpi_video_device *)seq->private; |
709 | unsigned long state; | 695 | unsigned long state; |
710 | 696 | ||
711 | ACPI_FUNCTION_TRACE("acpi_video_device_state_seq_show"); | ||
712 | 697 | ||
713 | if (!dev) | 698 | if (!dev) |
714 | goto end; | 699 | goto end; |
@@ -728,7 +713,7 @@ static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) | |||
728 | seq_printf(seq, "<not supported>\n"); | 713 | seq_printf(seq, "<not supported>\n"); |
729 | 714 | ||
730 | end: | 715 | end: |
731 | return_VALUE(0); | 716 | return 0; |
732 | } | 717 | } |
733 | 718 | ||
734 | static int | 719 | static int |
@@ -749,13 +734,12 @@ acpi_video_device_write_state(struct file *file, | |||
749 | char str[12] = { 0 }; | 734 | char str[12] = { 0 }; |
750 | u32 state = 0; | 735 | u32 state = 0; |
751 | 736 | ||
752 | ACPI_FUNCTION_TRACE("acpi_video_device_write_state"); | ||
753 | 737 | ||
754 | if (!dev || count + 1 > sizeof str) | 738 | if (!dev || count + 1 > sizeof str) |
755 | return_VALUE(-EINVAL); | 739 | return -EINVAL; |
756 | 740 | ||
757 | if (copy_from_user(str, buffer, count)) | 741 | if (copy_from_user(str, buffer, count)) |
758 | return_VALUE(-EFAULT); | 742 | return -EFAULT; |
759 | 743 | ||
760 | str[count] = 0; | 744 | str[count] = 0; |
761 | state = simple_strtoul(str, NULL, 0); | 745 | state = simple_strtoul(str, NULL, 0); |
@@ -764,9 +748,9 @@ acpi_video_device_write_state(struct file *file, | |||
764 | status = acpi_video_device_set_state(dev, state); | 748 | status = acpi_video_device_set_state(dev, state); |
765 | 749 | ||
766 | if (status) | 750 | if (status) |
767 | return_VALUE(-EFAULT); | 751 | return -EFAULT; |
768 | 752 | ||
769 | return_VALUE(count); | 753 | return count; |
770 | } | 754 | } |
771 | 755 | ||
772 | static int | 756 | static int |
@@ -776,11 +760,10 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset) | |||
776 | (struct acpi_video_device *)seq->private; | 760 | (struct acpi_video_device *)seq->private; |
777 | int i; | 761 | int i; |
778 | 762 | ||
779 | ACPI_FUNCTION_TRACE("acpi_video_device_brightness_seq_show"); | ||
780 | 763 | ||
781 | if (!dev || !dev->brightness) { | 764 | if (!dev || !dev->brightness) { |
782 | seq_printf(seq, "<not supported>\n"); | 765 | seq_printf(seq, "<not supported>\n"); |
783 | return_VALUE(0); | 766 | return 0; |
784 | } | 767 | } |
785 | 768 | ||
786 | seq_printf(seq, "levels: "); | 769 | seq_printf(seq, "levels: "); |
@@ -788,7 +771,7 @@ acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset) | |||
788 | seq_printf(seq, " %d", dev->brightness->levels[i]); | 771 | seq_printf(seq, " %d", dev->brightness->levels[i]); |
789 | seq_printf(seq, "\ncurrent: %d\n", dev->brightness->curr); | 772 | seq_printf(seq, "\ncurrent: %d\n", dev->brightness->curr); |
790 | 773 | ||
791 | return_VALUE(0); | 774 | return 0; |
792 | } | 775 | } |
793 | 776 | ||
794 | static int | 777 | static int |
@@ -809,19 +792,18 @@ acpi_video_device_write_brightness(struct file *file, | |||
809 | unsigned int level = 0; | 792 | unsigned int level = 0; |
810 | int i; | 793 | int i; |
811 | 794 | ||
812 | ACPI_FUNCTION_TRACE("acpi_video_device_write_brightness"); | ||
813 | 795 | ||
814 | if (!dev || !dev->brightness || count + 1 > sizeof str) | 796 | if (!dev || !dev->brightness || count + 1 > sizeof str) |
815 | return_VALUE(-EINVAL); | 797 | return -EINVAL; |
816 | 798 | ||
817 | if (copy_from_user(str, buffer, count)) | 799 | if (copy_from_user(str, buffer, count)) |
818 | return_VALUE(-EFAULT); | 800 | return -EFAULT; |
819 | 801 | ||
820 | str[count] = 0; | 802 | str[count] = 0; |
821 | level = simple_strtoul(str, NULL, 0); | 803 | level = simple_strtoul(str, NULL, 0); |
822 | 804 | ||
823 | if (level > 100) | 805 | if (level > 100) |
824 | return_VALUE(-EFAULT); | 806 | return -EFAULT; |
825 | 807 | ||
826 | /* validate though the list of available levels */ | 808 | /* validate though the list of available levels */ |
827 | for (i = 0; i < dev->brightness->count; i++) | 809 | for (i = 0; i < dev->brightness->count; i++) |
@@ -832,7 +814,7 @@ acpi_video_device_write_brightness(struct file *file, | |||
832 | break; | 814 | break; |
833 | } | 815 | } |
834 | 816 | ||
835 | return_VALUE(count); | 817 | return count; |
836 | } | 818 | } |
837 | 819 | ||
838 | static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) | 820 | static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) |
@@ -843,7 +825,6 @@ static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) | |||
843 | int i; | 825 | int i; |
844 | union acpi_object *edid = NULL; | 826 | union acpi_object *edid = NULL; |
845 | 827 | ||
846 | ACPI_FUNCTION_TRACE("acpi_video_device_EDID_seq_show"); | ||
847 | 828 | ||
848 | if (!dev) | 829 | if (!dev) |
849 | goto out; | 830 | goto out; |
@@ -868,7 +849,7 @@ static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) | |||
868 | else | 849 | else |
869 | kfree(edid); | 850 | kfree(edid); |
870 | 851 | ||
871 | return_VALUE(0); | 852 | return 0; |
872 | } | 853 | } |
873 | 854 | ||
874 | static int | 855 | static int |
@@ -883,27 +864,26 @@ static int acpi_video_device_add_fs(struct acpi_device *device) | |||
883 | struct proc_dir_entry *entry = NULL; | 864 | struct proc_dir_entry *entry = NULL; |
884 | struct acpi_video_device *vid_dev; | 865 | struct acpi_video_device *vid_dev; |
885 | 866 | ||
886 | ACPI_FUNCTION_TRACE("acpi_video_device_add_fs"); | ||
887 | 867 | ||
888 | if (!device) | 868 | if (!device) |
889 | return_VALUE(-ENODEV); | 869 | return -ENODEV; |
890 | 870 | ||
891 | vid_dev = (struct acpi_video_device *)acpi_driver_data(device); | 871 | vid_dev = (struct acpi_video_device *)acpi_driver_data(device); |
892 | if (!vid_dev) | 872 | if (!vid_dev) |
893 | return_VALUE(-ENODEV); | 873 | return -ENODEV; |
894 | 874 | ||
895 | if (!acpi_device_dir(device)) { | 875 | if (!acpi_device_dir(device)) { |
896 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), | 876 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), |
897 | vid_dev->video->dir); | 877 | vid_dev->video->dir); |
898 | if (!acpi_device_dir(device)) | 878 | if (!acpi_device_dir(device)) |
899 | return_VALUE(-ENODEV); | 879 | return -ENODEV; |
900 | acpi_device_dir(device)->owner = THIS_MODULE; | 880 | acpi_device_dir(device)->owner = THIS_MODULE; |
901 | } | 881 | } |
902 | 882 | ||
903 | /* 'info' [R] */ | 883 | /* 'info' [R] */ |
904 | entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); | 884 | entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); |
905 | if (!entry) | 885 | if (!entry) |
906 | return_VALUE(-ENODEV); | 886 | return -ENODEV; |
907 | else { | 887 | else { |
908 | entry->proc_fops = &acpi_video_device_info_fops; | 888 | entry->proc_fops = &acpi_video_device_info_fops; |
909 | entry->data = acpi_driver_data(device); | 889 | entry->data = acpi_driver_data(device); |
@@ -915,7 +895,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device) | |||
915 | create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR, | 895 | create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR, |
916 | acpi_device_dir(device)); | 896 | acpi_device_dir(device)); |
917 | if (!entry) | 897 | if (!entry) |
918 | return_VALUE(-ENODEV); | 898 | return -ENODEV; |
919 | else { | 899 | else { |
920 | acpi_video_device_state_fops.write = acpi_video_device_write_state; | 900 | acpi_video_device_state_fops.write = acpi_video_device_write_state; |
921 | entry->proc_fops = &acpi_video_device_state_fops; | 901 | entry->proc_fops = &acpi_video_device_state_fops; |
@@ -928,7 +908,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device) | |||
928 | create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR, | 908 | create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR, |
929 | acpi_device_dir(device)); | 909 | acpi_device_dir(device)); |
930 | if (!entry) | 910 | if (!entry) |
931 | return_VALUE(-ENODEV); | 911 | return -ENODEV; |
932 | else { | 912 | else { |
933 | acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness; | 913 | acpi_video_device_brightness_fops.write = acpi_video_device_write_brightness; |
934 | entry->proc_fops = &acpi_video_device_brightness_fops; | 914 | entry->proc_fops = &acpi_video_device_brightness_fops; |
@@ -939,24 +919,23 @@ static int acpi_video_device_add_fs(struct acpi_device *device) | |||
939 | /* 'EDID' [R] */ | 919 | /* 'EDID' [R] */ |
940 | entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device)); | 920 | entry = create_proc_entry("EDID", S_IRUGO, acpi_device_dir(device)); |
941 | if (!entry) | 921 | if (!entry) |
942 | return_VALUE(-ENODEV); | 922 | return -ENODEV; |
943 | else { | 923 | else { |
944 | entry->proc_fops = &acpi_video_device_EDID_fops; | 924 | entry->proc_fops = &acpi_video_device_EDID_fops; |
945 | entry->data = acpi_driver_data(device); | 925 | entry->data = acpi_driver_data(device); |
946 | entry->owner = THIS_MODULE; | 926 | entry->owner = THIS_MODULE; |
947 | } | 927 | } |
948 | 928 | ||
949 | return_VALUE(0); | 929 | return 0; |
950 | } | 930 | } |
951 | 931 | ||
952 | static int acpi_video_device_remove_fs(struct acpi_device *device) | 932 | static int acpi_video_device_remove_fs(struct acpi_device *device) |
953 | { | 933 | { |
954 | struct acpi_video_device *vid_dev; | 934 | struct acpi_video_device *vid_dev; |
955 | ACPI_FUNCTION_TRACE("acpi_video_device_remove_fs"); | ||
956 | 935 | ||
957 | vid_dev = (struct acpi_video_device *)acpi_driver_data(device); | 936 | vid_dev = (struct acpi_video_device *)acpi_driver_data(device); |
958 | if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) | 937 | if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) |
959 | return_VALUE(-ENODEV); | 938 | return -ENODEV; |
960 | 939 | ||
961 | if (acpi_device_dir(device)) { | 940 | if (acpi_device_dir(device)) { |
962 | remove_proc_entry("info", acpi_device_dir(device)); | 941 | remove_proc_entry("info", acpi_device_dir(device)); |
@@ -967,7 +946,7 @@ static int acpi_video_device_remove_fs(struct acpi_device *device) | |||
967 | acpi_device_dir(device) = NULL; | 946 | acpi_device_dir(device) = NULL; |
968 | } | 947 | } |
969 | 948 | ||
970 | return_VALUE(0); | 949 | return 0; |
971 | } | 950 | } |
972 | 951 | ||
973 | /* video bus */ | 952 | /* video bus */ |
@@ -975,7 +954,6 @@ static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset) | |||
975 | { | 954 | { |
976 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; | 955 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; |
977 | 956 | ||
978 | ACPI_FUNCTION_TRACE("acpi_video_bus_info_seq_show"); | ||
979 | 957 | ||
980 | if (!video) | 958 | if (!video) |
981 | goto end; | 959 | goto end; |
@@ -988,7 +966,7 @@ static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset) | |||
988 | video->flags.post ? "yes" : "no"); | 966 | video->flags.post ? "yes" : "no"); |
989 | 967 | ||
990 | end: | 968 | end: |
991 | return_VALUE(0); | 969 | return 0; |
992 | } | 970 | } |
993 | 971 | ||
994 | static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file) | 972 | static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file) |
@@ -1001,7 +979,6 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset) | |||
1001 | { | 979 | { |
1002 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; | 980 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; |
1003 | 981 | ||
1004 | ACPI_FUNCTION_TRACE("acpi_video_bus_ROM_seq_show"); | ||
1005 | 982 | ||
1006 | if (!video) | 983 | if (!video) |
1007 | goto end; | 984 | goto end; |
@@ -1010,7 +987,7 @@ static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset) | |||
1010 | seq_printf(seq, "<TODO>\n"); | 987 | seq_printf(seq, "<TODO>\n"); |
1011 | 988 | ||
1012 | end: | 989 | end: |
1013 | return_VALUE(0); | 990 | return 0; |
1014 | } | 991 | } |
1015 | 992 | ||
1016 | static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file) | 993 | static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file) |
@@ -1024,7 +1001,6 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) | |||
1024 | unsigned long options; | 1001 | unsigned long options; |
1025 | int status; | 1002 | int status; |
1026 | 1003 | ||
1027 | ACPI_FUNCTION_TRACE("acpi_video_bus_POST_info_seq_show"); | ||
1028 | 1004 | ||
1029 | if (!video) | 1005 | if (!video) |
1030 | goto end; | 1006 | goto end; |
@@ -1047,7 +1023,7 @@ static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) | |||
1047 | } else | 1023 | } else |
1048 | seq_printf(seq, "<not supported>\n"); | 1024 | seq_printf(seq, "<not supported>\n"); |
1049 | end: | 1025 | end: |
1050 | return_VALUE(0); | 1026 | return 0; |
1051 | } | 1027 | } |
1052 | 1028 | ||
1053 | static int | 1029 | static int |
@@ -1063,7 +1039,6 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) | |||
1063 | int status; | 1039 | int status; |
1064 | unsigned long id; | 1040 | unsigned long id; |
1065 | 1041 | ||
1066 | ACPI_FUNCTION_TRACE("acpi_video_bus_POST_seq_show"); | ||
1067 | 1042 | ||
1068 | if (!video) | 1043 | if (!video) |
1069 | goto end; | 1044 | goto end; |
@@ -1076,18 +1051,17 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) | |||
1076 | seq_printf(seq, "device posted is <%s>\n", device_decode[id & 3]); | 1051 | seq_printf(seq, "device posted is <%s>\n", device_decode[id & 3]); |
1077 | 1052 | ||
1078 | end: | 1053 | end: |
1079 | return_VALUE(0); | 1054 | return 0; |
1080 | } | 1055 | } |
1081 | 1056 | ||
1082 | static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset) | 1057 | static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset) |
1083 | { | 1058 | { |
1084 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; | 1059 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; |
1085 | 1060 | ||
1086 | ACPI_FUNCTION_TRACE("acpi_video_bus_DOS_seq_show"); | ||
1087 | 1061 | ||
1088 | seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); | 1062 | seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); |
1089 | 1063 | ||
1090 | return_VALUE(0); | 1064 | return 0; |
1091 | } | 1065 | } |
1092 | 1066 | ||
1093 | static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file) | 1067 | static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file) |
@@ -1112,22 +1086,21 @@ acpi_video_bus_write_POST(struct file *file, | |||
1112 | char str[12] = { 0 }; | 1086 | char str[12] = { 0 }; |
1113 | unsigned long opt, options; | 1087 | unsigned long opt, options; |
1114 | 1088 | ||
1115 | ACPI_FUNCTION_TRACE("acpi_video_bus_write_POST"); | ||
1116 | 1089 | ||
1117 | if (!video || count + 1 > sizeof str) | 1090 | if (!video || count + 1 > sizeof str) |
1118 | return_VALUE(-EINVAL); | 1091 | return -EINVAL; |
1119 | 1092 | ||
1120 | status = acpi_video_bus_POST_options(video, &options); | 1093 | status = acpi_video_bus_POST_options(video, &options); |
1121 | if (!ACPI_SUCCESS(status)) | 1094 | if (!ACPI_SUCCESS(status)) |
1122 | return_VALUE(-EINVAL); | 1095 | return -EINVAL; |
1123 | 1096 | ||
1124 | if (copy_from_user(str, buffer, count)) | 1097 | if (copy_from_user(str, buffer, count)) |
1125 | return_VALUE(-EFAULT); | 1098 | return -EFAULT; |
1126 | 1099 | ||
1127 | str[count] = 0; | 1100 | str[count] = 0; |
1128 | opt = strtoul(str, NULL, 0); | 1101 | opt = strtoul(str, NULL, 0); |
1129 | if (opt > 3) | 1102 | if (opt > 3) |
1130 | return_VALUE(-EFAULT); | 1103 | return -EFAULT; |
1131 | 1104 | ||
1132 | /* just in case an OEM 'forget' the motherboard... */ | 1105 | /* just in case an OEM 'forget' the motherboard... */ |
1133 | options |= 1; | 1106 | options |= 1; |
@@ -1135,11 +1108,11 @@ acpi_video_bus_write_POST(struct file *file, | |||
1135 | if (options & (1ul << opt)) { | 1108 | if (options & (1ul << opt)) { |
1136 | status = acpi_video_bus_set_POST(video, opt); | 1109 | status = acpi_video_bus_set_POST(video, opt); |
1137 | if (!ACPI_SUCCESS(status)) | 1110 | if (!ACPI_SUCCESS(status)) |
1138 | return_VALUE(-EFAULT); | 1111 | return -EFAULT; |
1139 | 1112 | ||
1140 | } | 1113 | } |
1141 | 1114 | ||
1142 | return_VALUE(count); | 1115 | return count; |
1143 | } | 1116 | } |
1144 | 1117 | ||
1145 | static ssize_t | 1118 | static ssize_t |
@@ -1153,25 +1126,24 @@ acpi_video_bus_write_DOS(struct file *file, | |||
1153 | char str[12] = { 0 }; | 1126 | char str[12] = { 0 }; |
1154 | unsigned long opt; | 1127 | unsigned long opt; |
1155 | 1128 | ||
1156 | ACPI_FUNCTION_TRACE("acpi_video_bus_write_DOS"); | ||
1157 | 1129 | ||
1158 | if (!video || count + 1 > sizeof str) | 1130 | if (!video || count + 1 > sizeof str) |
1159 | return_VALUE(-EINVAL); | 1131 | return -EINVAL; |
1160 | 1132 | ||
1161 | if (copy_from_user(str, buffer, count)) | 1133 | if (copy_from_user(str, buffer, count)) |
1162 | return_VALUE(-EFAULT); | 1134 | return -EFAULT; |
1163 | 1135 | ||
1164 | str[count] = 0; | 1136 | str[count] = 0; |
1165 | opt = strtoul(str, NULL, 0); | 1137 | opt = strtoul(str, NULL, 0); |
1166 | if (opt > 7) | 1138 | if (opt > 7) |
1167 | return_VALUE(-EFAULT); | 1139 | return -EFAULT; |
1168 | 1140 | ||
1169 | status = acpi_video_bus_DOS(video, opt & 0x3, (opt & 0x4) >> 2); | 1141 | status = acpi_video_bus_DOS(video, opt & 0x3, (opt & 0x4) >> 2); |
1170 | 1142 | ||
1171 | if (!ACPI_SUCCESS(status)) | 1143 | if (!ACPI_SUCCESS(status)) |
1172 | return_VALUE(-EFAULT); | 1144 | return -EFAULT; |
1173 | 1145 | ||
1174 | return_VALUE(count); | 1146 | return count; |
1175 | } | 1147 | } |
1176 | 1148 | ||
1177 | static int acpi_video_bus_add_fs(struct acpi_device *device) | 1149 | static int acpi_video_bus_add_fs(struct acpi_device *device) |
@@ -1179,7 +1151,6 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1179 | struct proc_dir_entry *entry = NULL; | 1151 | struct proc_dir_entry *entry = NULL; |
1180 | struct acpi_video_bus *video; | 1152 | struct acpi_video_bus *video; |
1181 | 1153 | ||
1182 | ACPI_FUNCTION_TRACE("acpi_video_bus_add_fs"); | ||
1183 | 1154 | ||
1184 | video = (struct acpi_video_bus *)acpi_driver_data(device); | 1155 | video = (struct acpi_video_bus *)acpi_driver_data(device); |
1185 | 1156 | ||
@@ -1187,7 +1158,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1187 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), | 1158 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), |
1188 | acpi_video_dir); | 1159 | acpi_video_dir); |
1189 | if (!acpi_device_dir(device)) | 1160 | if (!acpi_device_dir(device)) |
1190 | return_VALUE(-ENODEV); | 1161 | return -ENODEV; |
1191 | video->dir = acpi_device_dir(device); | 1162 | video->dir = acpi_device_dir(device); |
1192 | acpi_device_dir(device)->owner = THIS_MODULE; | 1163 | acpi_device_dir(device)->owner = THIS_MODULE; |
1193 | } | 1164 | } |
@@ -1195,7 +1166,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1195 | /* 'info' [R] */ | 1166 | /* 'info' [R] */ |
1196 | entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); | 1167 | entry = create_proc_entry("info", S_IRUGO, acpi_device_dir(device)); |
1197 | if (!entry) | 1168 | if (!entry) |
1198 | return_VALUE(-ENODEV); | 1169 | return -ENODEV; |
1199 | else { | 1170 | else { |
1200 | entry->proc_fops = &acpi_video_bus_info_fops; | 1171 | entry->proc_fops = &acpi_video_bus_info_fops; |
1201 | entry->data = acpi_driver_data(device); | 1172 | entry->data = acpi_driver_data(device); |
@@ -1205,7 +1176,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1205 | /* 'ROM' [R] */ | 1176 | /* 'ROM' [R] */ |
1206 | entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device)); | 1177 | entry = create_proc_entry("ROM", S_IRUGO, acpi_device_dir(device)); |
1207 | if (!entry) | 1178 | if (!entry) |
1208 | return_VALUE(-ENODEV); | 1179 | return -ENODEV; |
1209 | else { | 1180 | else { |
1210 | entry->proc_fops = &acpi_video_bus_ROM_fops; | 1181 | entry->proc_fops = &acpi_video_bus_ROM_fops; |
1211 | entry->data = acpi_driver_data(device); | 1182 | entry->data = acpi_driver_data(device); |
@@ -1216,7 +1187,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1216 | entry = | 1187 | entry = |
1217 | create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device)); | 1188 | create_proc_entry("POST_info", S_IRUGO, acpi_device_dir(device)); |
1218 | if (!entry) | 1189 | if (!entry) |
1219 | return_VALUE(-ENODEV); | 1190 | return -ENODEV; |
1220 | else { | 1191 | else { |
1221 | entry->proc_fops = &acpi_video_bus_POST_info_fops; | 1192 | entry->proc_fops = &acpi_video_bus_POST_info_fops; |
1222 | entry->data = acpi_driver_data(device); | 1193 | entry->data = acpi_driver_data(device); |
@@ -1228,7 +1199,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1228 | create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR, | 1199 | create_proc_entry("POST", S_IFREG | S_IRUGO | S_IRUSR, |
1229 | acpi_device_dir(device)); | 1200 | acpi_device_dir(device)); |
1230 | if (!entry) | 1201 | if (!entry) |
1231 | return_VALUE(-ENODEV); | 1202 | return -ENODEV; |
1232 | else { | 1203 | else { |
1233 | acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; | 1204 | acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; |
1234 | entry->proc_fops = &acpi_video_bus_POST_fops; | 1205 | entry->proc_fops = &acpi_video_bus_POST_fops; |
@@ -1241,7 +1212,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1241 | create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR, | 1212 | create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IRUSR, |
1242 | acpi_device_dir(device)); | 1213 | acpi_device_dir(device)); |
1243 | if (!entry) | 1214 | if (!entry) |
1244 | return_VALUE(-ENODEV); | 1215 | return -ENODEV; |
1245 | else { | 1216 | else { |
1246 | acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; | 1217 | acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; |
1247 | entry->proc_fops = &acpi_video_bus_DOS_fops; | 1218 | entry->proc_fops = &acpi_video_bus_DOS_fops; |
@@ -1249,14 +1220,13 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1249 | entry->owner = THIS_MODULE; | 1220 | entry->owner = THIS_MODULE; |
1250 | } | 1221 | } |
1251 | 1222 | ||
1252 | return_VALUE(0); | 1223 | return 0; |
1253 | } | 1224 | } |
1254 | 1225 | ||
1255 | static int acpi_video_bus_remove_fs(struct acpi_device *device) | 1226 | static int acpi_video_bus_remove_fs(struct acpi_device *device) |
1256 | { | 1227 | { |
1257 | struct acpi_video_bus *video; | 1228 | struct acpi_video_bus *video; |
1258 | 1229 | ||
1259 | ACPI_FUNCTION_TRACE("acpi_video_bus_remove_fs"); | ||
1260 | 1230 | ||
1261 | video = (struct acpi_video_bus *)acpi_driver_data(device); | 1231 | video = (struct acpi_video_bus *)acpi_driver_data(device); |
1262 | 1232 | ||
@@ -1270,7 +1240,7 @@ static int acpi_video_bus_remove_fs(struct acpi_device *device) | |||
1270 | acpi_device_dir(device) = NULL; | 1240 | acpi_device_dir(device) = NULL; |
1271 | } | 1241 | } |
1272 | 1242 | ||
1273 | return_VALUE(0); | 1243 | return 0; |
1274 | } | 1244 | } |
1275 | 1245 | ||
1276 | /* -------------------------------------------------------------------------- | 1246 | /* -------------------------------------------------------------------------- |
@@ -1287,10 +1257,9 @@ acpi_video_bus_get_one_device(struct acpi_device *device, | |||
1287 | int status; | 1257 | int status; |
1288 | struct acpi_video_device *data; | 1258 | struct acpi_video_device *data; |
1289 | 1259 | ||
1290 | ACPI_FUNCTION_TRACE("acpi_video_bus_get_one_device"); | ||
1291 | 1260 | ||
1292 | if (!device || !video) | 1261 | if (!device || !video) |
1293 | return_VALUE(-EINVAL); | 1262 | return -EINVAL; |
1294 | 1263 | ||
1295 | status = | 1264 | status = |
1296 | acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); | 1265 | acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); |
@@ -1298,7 +1267,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device, | |||
1298 | 1267 | ||
1299 | data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL); | 1268 | data = kmalloc(sizeof(struct acpi_video_device), GFP_KERNEL); |
1300 | if (!data) | 1269 | if (!data) |
1301 | return_VALUE(-ENOMEM); | 1270 | return -ENOMEM; |
1302 | 1271 | ||
1303 | memset(data, 0, sizeof(struct acpi_video_device)); | 1272 | memset(data, 0, sizeof(struct acpi_video_device)); |
1304 | 1273 | ||
@@ -1349,10 +1318,10 @@ acpi_video_bus_get_one_device(struct acpi_device *device, | |||
1349 | 1318 | ||
1350 | acpi_video_device_add_fs(device); | 1319 | acpi_video_device_add_fs(device); |
1351 | 1320 | ||
1352 | return_VALUE(0); | 1321 | return 0; |
1353 | } | 1322 | } |
1354 | 1323 | ||
1355 | return_VALUE(-ENOENT); | 1324 | return -ENOENT; |
1356 | } | 1325 | } |
1357 | 1326 | ||
1358 | /* | 1327 | /* |
@@ -1395,7 +1364,6 @@ acpi_video_device_bind(struct acpi_video_bus *video, | |||
1395 | struct acpi_video_device *device) | 1364 | struct acpi_video_device *device) |
1396 | { | 1365 | { |
1397 | int i; | 1366 | int i; |
1398 | ACPI_FUNCTION_TRACE("acpi_video_device_bind"); | ||
1399 | 1367 | ||
1400 | #define IDS_VAL(i) video->attached_array[i].value.int_val | 1368 | #define IDS_VAL(i) video->attached_array[i].value.int_val |
1401 | #define IDS_BIND(i) video->attached_array[i].bind_info | 1369 | #define IDS_BIND(i) video->attached_array[i].bind_info |
@@ -1432,12 +1400,11 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) | |||
1432 | union acpi_object *dod = NULL; | 1400 | union acpi_object *dod = NULL; |
1433 | union acpi_object *obj; | 1401 | union acpi_object *obj; |
1434 | 1402 | ||
1435 | ACPI_FUNCTION_TRACE("acpi_video_device_enumerate"); | ||
1436 | 1403 | ||
1437 | status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer); | 1404 | status = acpi_evaluate_object(video->handle, "_DOD", NULL, &buffer); |
1438 | if (!ACPI_SUCCESS(status)) { | 1405 | if (!ACPI_SUCCESS(status)) { |
1439 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD")); | 1406 | ACPI_EXCEPTION((AE_INFO, status, "Evaluating _DOD")); |
1440 | return_VALUE(status); | 1407 | return status; |
1441 | } | 1408 | } |
1442 | 1409 | ||
1443 | dod = (union acpi_object *)buffer.pointer; | 1410 | dod = (union acpi_object *)buffer.pointer; |
@@ -1484,7 +1451,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) | |||
1484 | video->attached_count = count; | 1451 | video->attached_count = count; |
1485 | out: | 1452 | out: |
1486 | acpi_os_free(buffer.pointer); | 1453 | acpi_os_free(buffer.pointer); |
1487 | return_VALUE(status); | 1454 | return status; |
1488 | } | 1455 | } |
1489 | 1456 | ||
1490 | /* | 1457 | /* |
@@ -1509,7 +1476,6 @@ static int acpi_video_switch_output(struct acpi_video_bus *video, int event) | |||
1509 | unsigned long state; | 1476 | unsigned long state; |
1510 | int status = 0; | 1477 | int status = 0; |
1511 | 1478 | ||
1512 | ACPI_FUNCTION_TRACE("acpi_video_switch_output"); | ||
1513 | 1479 | ||
1514 | list_for_each_safe(node, next, &video->video_device_list) { | 1480 | list_for_each_safe(node, next, &video->video_device_list) { |
1515 | dev = container_of(node, struct acpi_video_device, entry); | 1481 | dev = container_of(node, struct acpi_video_device, entry); |
@@ -1540,7 +1506,7 @@ static int acpi_video_switch_output(struct acpi_video_bus *video, int event) | |||
1540 | break; | 1506 | break; |
1541 | } | 1507 | } |
1542 | 1508 | ||
1543 | return_VALUE(status); | 1509 | return status; |
1544 | } | 1510 | } |
1545 | 1511 | ||
1546 | static int | 1512 | static int |
@@ -1567,7 +1533,6 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video, | |||
1567 | int status = 0; | 1533 | int status = 0; |
1568 | struct list_head *node, *next; | 1534 | struct list_head *node, *next; |
1569 | 1535 | ||
1570 | ACPI_FUNCTION_TRACE("acpi_video_get_devices"); | ||
1571 | 1536 | ||
1572 | acpi_video_device_enumerate(video); | 1537 | acpi_video_device_enumerate(video); |
1573 | 1538 | ||
@@ -1585,7 +1550,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video, | |||
1585 | } | 1550 | } |
1586 | 1551 | ||
1587 | } | 1552 | } |
1588 | return_VALUE(status); | 1553 | return status; |
1589 | } | 1554 | } |
1590 | 1555 | ||
1591 | static int acpi_video_bus_put_one_device(struct acpi_video_device *device) | 1556 | static int acpi_video_bus_put_one_device(struct acpi_video_device *device) |
@@ -1593,10 +1558,9 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device) | |||
1593 | acpi_status status; | 1558 | acpi_status status; |
1594 | struct acpi_video_bus *video; | 1559 | struct acpi_video_bus *video; |
1595 | 1560 | ||
1596 | ACPI_FUNCTION_TRACE("acpi_video_bus_put_one_device"); | ||
1597 | 1561 | ||
1598 | if (!device || !device->video) | 1562 | if (!device || !device->video) |
1599 | return_VALUE(-ENOENT); | 1563 | return -ENOENT; |
1600 | 1564 | ||
1601 | video = device->video; | 1565 | video = device->video; |
1602 | 1566 | ||
@@ -1609,7 +1573,7 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device) | |||
1609 | ACPI_DEVICE_NOTIFY, | 1573 | ACPI_DEVICE_NOTIFY, |
1610 | acpi_video_device_notify); | 1574 | acpi_video_device_notify); |
1611 | 1575 | ||
1612 | return_VALUE(0); | 1576 | return 0; |
1613 | } | 1577 | } |
1614 | 1578 | ||
1615 | static int acpi_video_bus_put_devices(struct acpi_video_bus *video) | 1579 | static int acpi_video_bus_put_devices(struct acpi_video_bus *video) |
@@ -1617,7 +1581,6 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) | |||
1617 | int status; | 1581 | int status; |
1618 | struct list_head *node, *next; | 1582 | struct list_head *node, *next; |
1619 | 1583 | ||
1620 | ACPI_FUNCTION_TRACE("acpi_video_bus_put_devices"); | ||
1621 | 1584 | ||
1622 | list_for_each_safe(node, next, &video->video_device_list) { | 1585 | list_for_each_safe(node, next, &video->video_device_list) { |
1623 | struct acpi_video_device *data = | 1586 | struct acpi_video_device *data = |
@@ -1636,7 +1599,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) | |||
1636 | kfree(data); | 1599 | kfree(data); |
1637 | } | 1600 | } |
1638 | 1601 | ||
1639 | return_VALUE(0); | 1602 | return 0; |
1640 | } | 1603 | } |
1641 | 1604 | ||
1642 | /* acpi_video interface */ | 1605 | /* acpi_video interface */ |
@@ -1656,14 +1619,13 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) | |||
1656 | struct acpi_video_bus *video = (struct acpi_video_bus *)data; | 1619 | struct acpi_video_bus *video = (struct acpi_video_bus *)data; |
1657 | struct acpi_device *device = NULL; | 1620 | struct acpi_device *device = NULL; |
1658 | 1621 | ||
1659 | ACPI_FUNCTION_TRACE("acpi_video_bus_notify"); | ||
1660 | printk("video bus notify\n"); | 1622 | printk("video bus notify\n"); |
1661 | 1623 | ||
1662 | if (!video) | 1624 | if (!video) |
1663 | return_VOID; | 1625 | return; |
1664 | 1626 | ||
1665 | if (acpi_bus_get_device(handle, &device)) | 1627 | if (acpi_bus_get_device(handle, &device)) |
1666 | return_VOID; | 1628 | return; |
1667 | 1629 | ||
1668 | switch (event) { | 1630 | switch (event) { |
1669 | case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur, | 1631 | case ACPI_VIDEO_NOTIFY_SWITCH: /* User request that a switch occur, |
@@ -1692,7 +1654,7 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) | |||
1692 | break; | 1654 | break; |
1693 | } | 1655 | } |
1694 | 1656 | ||
1695 | return_VOID; | 1657 | return; |
1696 | } | 1658 | } |
1697 | 1659 | ||
1698 | static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) | 1660 | static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) |
@@ -1701,14 +1663,13 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) | |||
1701 | (struct acpi_video_device *)data; | 1663 | (struct acpi_video_device *)data; |
1702 | struct acpi_device *device = NULL; | 1664 | struct acpi_device *device = NULL; |
1703 | 1665 | ||
1704 | ACPI_FUNCTION_TRACE("acpi_video_device_notify"); | ||
1705 | 1666 | ||
1706 | printk("video device notify\n"); | 1667 | printk("video device notify\n"); |
1707 | if (!video_device) | 1668 | if (!video_device) |
1708 | return_VOID; | 1669 | return; |
1709 | 1670 | ||
1710 | if (acpi_bus_get_device(handle, &device)) | 1671 | if (acpi_bus_get_device(handle, &device)) |
1711 | return_VOID; | 1672 | return; |
1712 | 1673 | ||
1713 | switch (event) { | 1674 | switch (event) { |
1714 | case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */ | 1675 | case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */ |
@@ -1728,7 +1689,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) | |||
1728 | "Unsupported event [0x%x]\n", event)); | 1689 | "Unsupported event [0x%x]\n", event)); |
1729 | break; | 1690 | break; |
1730 | } | 1691 | } |
1731 | return_VOID; | 1692 | return; |
1732 | } | 1693 | } |
1733 | 1694 | ||
1734 | static int acpi_video_bus_add(struct acpi_device *device) | 1695 | static int acpi_video_bus_add(struct acpi_device *device) |
@@ -1737,14 +1698,13 @@ static int acpi_video_bus_add(struct acpi_device *device) | |||
1737 | acpi_status status = 0; | 1698 | acpi_status status = 0; |
1738 | struct acpi_video_bus *video = NULL; | 1699 | struct acpi_video_bus *video = NULL; |
1739 | 1700 | ||
1740 | ACPI_FUNCTION_TRACE("acpi_video_bus_add"); | ||
1741 | 1701 | ||
1742 | if (!device) | 1702 | if (!device) |
1743 | return_VALUE(-EINVAL); | 1703 | return -EINVAL; |
1744 | 1704 | ||
1745 | video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); | 1705 | video = kmalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); |
1746 | if (!video) | 1706 | if (!video) |
1747 | return_VALUE(-ENOMEM); | 1707 | return -ENOMEM; |
1748 | memset(video, 0, sizeof(struct acpi_video_bus)); | 1708 | memset(video, 0, sizeof(struct acpi_video_bus)); |
1749 | 1709 | ||
1750 | video->handle = device->handle; | 1710 | video->handle = device->handle; |
@@ -1791,7 +1751,7 @@ static int acpi_video_bus_add(struct acpi_device *device) | |||
1791 | if (result) | 1751 | if (result) |
1792 | kfree(video); | 1752 | kfree(video); |
1793 | 1753 | ||
1794 | return_VALUE(result); | 1754 | return result; |
1795 | } | 1755 | } |
1796 | 1756 | ||
1797 | static int acpi_video_bus_remove(struct acpi_device *device, int type) | 1757 | static int acpi_video_bus_remove(struct acpi_device *device, int type) |
@@ -1799,10 +1759,9 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) | |||
1799 | acpi_status status = 0; | 1759 | acpi_status status = 0; |
1800 | struct acpi_video_bus *video = NULL; | 1760 | struct acpi_video_bus *video = NULL; |
1801 | 1761 | ||
1802 | ACPI_FUNCTION_TRACE("acpi_video_bus_remove"); | ||
1803 | 1762 | ||
1804 | if (!device || !acpi_driver_data(device)) | 1763 | if (!device || !acpi_driver_data(device)) |
1805 | return_VALUE(-EINVAL); | 1764 | return -EINVAL; |
1806 | 1765 | ||
1807 | video = (struct acpi_video_bus *)acpi_driver_data(device); | 1766 | video = (struct acpi_video_bus *)acpi_driver_data(device); |
1808 | 1767 | ||
@@ -1818,7 +1777,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) | |||
1818 | kfree(video->attached_array); | 1777 | kfree(video->attached_array); |
1819 | kfree(video); | 1778 | kfree(video); |
1820 | 1779 | ||
1821 | return_VALUE(0); | 1780 | return 0; |
1822 | } | 1781 | } |
1823 | 1782 | ||
1824 | static int | 1783 | static int |
@@ -1828,10 +1787,9 @@ acpi_video_bus_match(struct acpi_device *device, struct acpi_driver *driver) | |||
1828 | acpi_handle h_dummy2; | 1787 | acpi_handle h_dummy2; |
1829 | acpi_handle h_dummy3; | 1788 | acpi_handle h_dummy3; |
1830 | 1789 | ||
1831 | ACPI_FUNCTION_TRACE("acpi_video_bus_match"); | ||
1832 | 1790 | ||
1833 | if (!device || !driver) | 1791 | if (!device || !driver) |
1834 | return_VALUE(-EINVAL); | 1792 | return -EINVAL; |
1835 | 1793 | ||
1836 | /* Since there is no HID, CID for ACPI Video drivers, we have | 1794 | /* Since there is no HID, CID for ACPI Video drivers, we have |
1837 | * to check well known required nodes for each feature we support. | 1795 | * to check well known required nodes for each feature we support. |
@@ -1840,26 +1798,25 @@ acpi_video_bus_match(struct acpi_device *device, struct acpi_driver *driver) | |||
1840 | /* Does this device able to support video switching ? */ | 1798 | /* Does this device able to support video switching ? */ |
1841 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy1)) && | 1799 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy1)) && |
1842 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2))) | 1800 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy2))) |
1843 | return_VALUE(0); | 1801 | return 0; |
1844 | 1802 | ||
1845 | /* Does this device able to retrieve a video ROM ? */ | 1803 | /* Does this device able to retrieve a video ROM ? */ |
1846 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1))) | 1804 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy1))) |
1847 | return_VALUE(0); | 1805 | return 0; |
1848 | 1806 | ||
1849 | /* Does this device able to configure which video head to be POSTed ? */ | 1807 | /* Does this device able to configure which video head to be POSTed ? */ |
1850 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy1)) && | 1808 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy1)) && |
1851 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy2)) && | 1809 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy2)) && |
1852 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3))) | 1810 | ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy3))) |
1853 | return_VALUE(0); | 1811 | return 0; |
1854 | 1812 | ||
1855 | return_VALUE(-ENODEV); | 1813 | return -ENODEV; |
1856 | } | 1814 | } |
1857 | 1815 | ||
1858 | static int __init acpi_video_init(void) | 1816 | static int __init acpi_video_init(void) |
1859 | { | 1817 | { |
1860 | int result = 0; | 1818 | int result = 0; |
1861 | 1819 | ||
1862 | ACPI_FUNCTION_TRACE("acpi_video_init"); | ||
1863 | 1820 | ||
1864 | /* | 1821 | /* |
1865 | acpi_dbg_level = 0xFFFFFFFF; | 1822 | acpi_dbg_level = 0xFFFFFFFF; |
@@ -1868,27 +1825,26 @@ static int __init acpi_video_init(void) | |||
1868 | 1825 | ||
1869 | acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); | 1826 | acpi_video_dir = proc_mkdir(ACPI_VIDEO_CLASS, acpi_root_dir); |
1870 | if (!acpi_video_dir) | 1827 | if (!acpi_video_dir) |
1871 | return_VALUE(-ENODEV); | 1828 | return -ENODEV; |
1872 | acpi_video_dir->owner = THIS_MODULE; | 1829 | acpi_video_dir->owner = THIS_MODULE; |
1873 | 1830 | ||
1874 | result = acpi_bus_register_driver(&acpi_video_bus); | 1831 | result = acpi_bus_register_driver(&acpi_video_bus); |
1875 | if (result < 0) { | 1832 | if (result < 0) { |
1876 | remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); | 1833 | remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); |
1877 | return_VALUE(-ENODEV); | 1834 | return -ENODEV; |
1878 | } | 1835 | } |
1879 | 1836 | ||
1880 | return_VALUE(0); | 1837 | return 0; |
1881 | } | 1838 | } |
1882 | 1839 | ||
1883 | static void __exit acpi_video_exit(void) | 1840 | static void __exit acpi_video_exit(void) |
1884 | { | 1841 | { |
1885 | ACPI_FUNCTION_TRACE("acpi_video_exit"); | ||
1886 | 1842 | ||
1887 | acpi_bus_unregister_driver(&acpi_video_bus); | 1843 | acpi_bus_unregister_driver(&acpi_video_bus); |
1888 | 1844 | ||
1889 | remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); | 1845 | remove_proc_entry(ACPI_VIDEO_CLASS, acpi_root_dir); |
1890 | 1846 | ||
1891 | return_VOID; | 1847 | return; |
1892 | } | 1848 | } |
1893 | 1849 | ||
1894 | module_init(acpi_video_init); | 1850 | module_init(acpi_video_init); |