diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:52:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:52:36 -0400 |
commit | 37224470c8c6d90a4062e76a08d4dc1fcf91fc89 (patch) | |
tree | 627f537177bf8e951c12bec04c4a85f0125f5ece /drivers/acpi/ibm_acpi.c | |
parent | e83319510b04dd51a60da8a0b4ccf8b92b3ab1ad (diff) | |
parent | ae6c859b7dcd708efadf1c76279c33db213e3506 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (65 commits)
ACPI: suppress power button event on S3 resume
ACPI: resolve merge conflict between sem2mutex and processor_perflib.c
ACPI: use for_each_possible_cpu() instead of for_each_cpu()
ACPI: delete newly added debugging macros in processor_perflib.c
ACPI: UP build fix for bugzilla-5737
Enable P-state software coordination via _PDC
P-state software coordination for speedstep-centrino
P-state software coordination for acpi-cpufreq
P-state software coordination for ACPI core
ACPI: create acpi_thermal_resume()
ACPI: create acpi_fan_suspend()/acpi_fan_resume()
ACPI: pass pm_message_t from acpi_device_suspend() to root_suspend()
ACPI: create acpi_device_suspend()/acpi_device_resume()
ACPI: replace spin_lock_irq with mutex for ec poll mode
ACPI: Allow a WAN module enable/disable on a Thinkpad X60.
sem2mutex: acpi, acpi_link_lock
ACPI: delete unused acpi_bus_drivers_lock
sem2mutex: drivers/acpi/processor_perflib.c
ACPI add ia64 exports to build acpi_memhotplug as a module
ACPI: asus_acpi_init(): propagate correct return value
...
Manual resolve of conflicts in:
arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
include/acpi/processor.h
Diffstat (limited to 'drivers/acpi/ibm_acpi.c')
-rw-r--r-- | drivers/acpi/ibm_acpi.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index 262b1f41335a..15fc12482ba0 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c | |||
@@ -567,6 +567,69 @@ static int bluetooth_write(char *buf) | |||
567 | return 0; | 567 | return 0; |
568 | } | 568 | } |
569 | 569 | ||
570 | static int wan_supported; | ||
571 | |||
572 | static int wan_init(void) | ||
573 | { | ||
574 | wan_supported = hkey_handle && | ||
575 | acpi_evalf(hkey_handle, NULL, "GWAN", "qv"); | ||
576 | |||
577 | return 0; | ||
578 | } | ||
579 | |||
580 | static int wan_status(void) | ||
581 | { | ||
582 | int status; | ||
583 | |||
584 | if (!wan_supported || | ||
585 | !acpi_evalf(hkey_handle, &status, "GWAN", "d")) | ||
586 | status = 0; | ||
587 | |||
588 | return status; | ||
589 | } | ||
590 | |||
591 | static int wan_read(char *p) | ||
592 | { | ||
593 | int len = 0; | ||
594 | int status = wan_status(); | ||
595 | |||
596 | if (!wan_supported) | ||
597 | len += sprintf(p + len, "status:\t\tnot supported\n"); | ||
598 | else if (!(status & 1)) | ||
599 | len += sprintf(p + len, "status:\t\tnot installed\n"); | ||
600 | else { | ||
601 | len += sprintf(p + len, "status:\t\t%s\n", enabled(status, 1)); | ||
602 | len += sprintf(p + len, "commands:\tenable, disable\n"); | ||
603 | } | ||
604 | |||
605 | return len; | ||
606 | } | ||
607 | |||
608 | static int wan_write(char *buf) | ||
609 | { | ||
610 | int status = wan_status(); | ||
611 | char *cmd; | ||
612 | int do_cmd = 0; | ||
613 | |||
614 | if (!wan_supported) | ||
615 | return -ENODEV; | ||
616 | |||
617 | while ((cmd = next_cmd(&buf))) { | ||
618 | if (strlencmp(cmd, "enable") == 0) { | ||
619 | status |= 2; | ||
620 | } else if (strlencmp(cmd, "disable") == 0) { | ||
621 | status &= ~2; | ||
622 | } else | ||
623 | return -EINVAL; | ||
624 | do_cmd = 1; | ||
625 | } | ||
626 | |||
627 | if (do_cmd && !acpi_evalf(hkey_handle, NULL, "SWAN", "vd", status)) | ||
628 | return -EIO; | ||
629 | |||
630 | return 0; | ||
631 | } | ||
632 | |||
570 | static int video_supported; | 633 | static int video_supported; |
571 | static int video_orig_autosw; | 634 | static int video_orig_autosw; |
572 | 635 | ||
@@ -1563,6 +1626,13 @@ static struct ibm_struct ibms[] = { | |||
1563 | .write = bluetooth_write, | 1626 | .write = bluetooth_write, |
1564 | }, | 1627 | }, |
1565 | { | 1628 | { |
1629 | .name = "wan", | ||
1630 | .init = wan_init, | ||
1631 | .read = wan_read, | ||
1632 | .write = wan_write, | ||
1633 | .experimental = 1, | ||
1634 | }, | ||
1635 | { | ||
1566 | .name = "video", | 1636 | .name = "video", |
1567 | .init = video_init, | 1637 | .init = video_init, |
1568 | .read = video_read, | 1638 | .read = video_read, |