diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/Kconfig | 11 | ||||
-rw-r--r-- | drivers/acpi/ibm_acpi.c | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index e942ffe8b57e..ee3dcd121827 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -242,6 +242,17 @@ config ACPI_IBM_DOCK | |||
242 | 242 | ||
243 | If you are not sure, say N here. | 243 | If you are not sure, say N here. |
244 | 244 | ||
245 | config ACPI_IBM_BAY | ||
246 | bool "Legacy Removable Bay Support" | ||
247 | depends on ACPI_IBM | ||
248 | default y | ||
249 | ---help--- | ||
250 | Allows the ibm_acpi driver to handle removable bays. It will allow | ||
251 | disabling the device in the bay, and also generate notifications when | ||
252 | the bay lever is ejected or inserted. | ||
253 | |||
254 | If you are not sure, say Y here. | ||
255 | |||
245 | config ACPI_TOSHIBA | 256 | config ACPI_TOSHIBA |
246 | tristate "Toshiba Laptop Extras" | 257 | tristate "Toshiba Laptop Extras" |
247 | depends on X86 | 258 | depends on X86 |
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index 7c1b418676b9..e7309a668732 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c | |||
@@ -157,6 +157,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */ | |||
157 | "\\_SB.PCI.ISA.SLCE", /* 570 */ | 157 | "\\_SB.PCI.ISA.SLCE", /* 570 */ |
158 | ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ | 158 | ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */ |
159 | #endif | 159 | #endif |
160 | #ifdef CONFIG_ACPI_IBM_BAY | ||
160 | IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ | 161 | IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ |
161 | "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ | 162 | "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */ |
162 | "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ | 163 | "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */ |
@@ -174,6 +175,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */ | |||
174 | IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ | 175 | IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ |
175 | "_EJ0", /* 770x */ | 176 | "_EJ0", /* 770x */ |
176 | ); /* all others */ | 177 | ); /* all others */ |
178 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
177 | 179 | ||
178 | /* don't list other alternatives as we install a notify handler on the 570 */ | 180 | /* don't list other alternatives as we install a notify handler on the 570 */ |
179 | IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ | 181 | IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ |
@@ -1044,6 +1046,7 @@ static int light_write(char *buf) | |||
1044 | return 0; | 1046 | return 0; |
1045 | } | 1047 | } |
1046 | 1048 | ||
1049 | #if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY) | ||
1047 | static int _sta(acpi_handle handle) | 1050 | static int _sta(acpi_handle handle) |
1048 | { | 1051 | { |
1049 | int status; | 1052 | int status; |
@@ -1053,6 +1056,7 @@ static int _sta(acpi_handle handle) | |||
1053 | 1056 | ||
1054 | return status; | 1057 | return status; |
1055 | } | 1058 | } |
1059 | #endif | ||
1056 | 1060 | ||
1057 | #ifdef CONFIG_ACPI_IBM_DOCK | 1061 | #ifdef CONFIG_ACPI_IBM_DOCK |
1058 | #define dock_docked() (_sta(dock_handle) & 1) | 1062 | #define dock_docked() (_sta(dock_handle) & 1) |
@@ -1119,6 +1123,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event) | |||
1119 | } | 1123 | } |
1120 | #endif | 1124 | #endif |
1121 | 1125 | ||
1126 | #ifdef CONFIG_ACPI_IBM_BAY | ||
1122 | static int bay_status_supported; | 1127 | static int bay_status_supported; |
1123 | static int bay_status2_supported; | 1128 | static int bay_status2_supported; |
1124 | static int bay_eject_supported; | 1129 | static int bay_eject_supported; |
@@ -1194,6 +1199,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event) | |||
1194 | { | 1199 | { |
1195 | acpi_bus_generate_event(ibm->device, event, 0); | 1200 | acpi_bus_generate_event(ibm->device, event, 0); |
1196 | } | 1201 | } |
1202 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
1197 | 1203 | ||
1198 | static int cmos_read(char *p) | 1204 | static int cmos_read(char *p) |
1199 | { | 1205 | { |
@@ -2361,6 +2367,7 @@ static struct ibm_struct ibms[] = { | |||
2361 | .type = ACPI_SYSTEM_NOTIFY, | 2367 | .type = ACPI_SYSTEM_NOTIFY, |
2362 | }, | 2368 | }, |
2363 | #endif | 2369 | #endif |
2370 | #ifdef CONFIG_ACPI_IBM_BAY | ||
2364 | { | 2371 | { |
2365 | .name = "bay", | 2372 | .name = "bay", |
2366 | .init = bay_init, | 2373 | .init = bay_init, |
@@ -2370,6 +2377,7 @@ static struct ibm_struct ibms[] = { | |||
2370 | .handle = &bay_handle, | 2377 | .handle = &bay_handle, |
2371 | .type = ACPI_SYSTEM_NOTIFY, | 2378 | .type = ACPI_SYSTEM_NOTIFY, |
2372 | }, | 2379 | }, |
2380 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
2373 | { | 2381 | { |
2374 | .name = "cmos", | 2382 | .name = "cmos", |
2375 | .read = cmos_read, | 2383 | .read = cmos_read, |
@@ -2655,7 +2663,9 @@ IBM_PARAM(light); | |||
2655 | #ifdef CONFIG_ACPI_IBM_DOCK | 2663 | #ifdef CONFIG_ACPI_IBM_DOCK |
2656 | IBM_PARAM(dock); | 2664 | IBM_PARAM(dock); |
2657 | #endif | 2665 | #endif |
2666 | #ifdef CONFIG_ACPI_IBM_BAY | ||
2658 | IBM_PARAM(bay); | 2667 | IBM_PARAM(bay); |
2668 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
2659 | IBM_PARAM(cmos); | 2669 | IBM_PARAM(cmos); |
2660 | IBM_PARAM(led); | 2670 | IBM_PARAM(led); |
2661 | IBM_PARAM(beep); | 2671 | IBM_PARAM(beep); |
@@ -2731,12 +2741,14 @@ static int __init acpi_ibm_init(void) | |||
2731 | IBM_HANDLE_INIT(dock); | 2741 | IBM_HANDLE_INIT(dock); |
2732 | #endif | 2742 | #endif |
2733 | IBM_HANDLE_INIT(pci); | 2743 | IBM_HANDLE_INIT(pci); |
2744 | #ifdef CONFIG_ACPI_IBM_BAY | ||
2734 | IBM_HANDLE_INIT(bay); | 2745 | IBM_HANDLE_INIT(bay); |
2735 | if (bay_handle) | 2746 | if (bay_handle) |
2736 | IBM_HANDLE_INIT(bay_ej); | 2747 | IBM_HANDLE_INIT(bay_ej); |
2737 | IBM_HANDLE_INIT(bay2); | 2748 | IBM_HANDLE_INIT(bay2); |
2738 | if (bay2_handle) | 2749 | if (bay2_handle) |
2739 | IBM_HANDLE_INIT(bay2_ej); | 2750 | IBM_HANDLE_INIT(bay2_ej); |
2751 | #endif /* CONFIG_ACPI_IBM_BAY */ | ||
2740 | IBM_HANDLE_INIT(beep); | 2752 | IBM_HANDLE_INIT(beep); |
2741 | IBM_HANDLE_INIT(ecrd); | 2753 | IBM_HANDLE_INIT(ecrd); |
2742 | IBM_HANDLE_INIT(ecwr); | 2754 | IBM_HANDLE_INIT(ecwr); |