aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-02-21 10:05:38 -0500
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-02-22 13:09:25 -0500
commit2bc808a8c4821a8ef4e3dc35b8fc577a9d2c6f0d (patch)
treef03421b0596be8fe8cafe294b4c739e9c52d5e52
parentadb005818b71e9476581a1de5742e2f427ac9e2b (diff)
ACPI: ibm-acpi: make ibm-acpi bay support optional
Make ibm-acpi bay support optional at kernel compile time. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
-rw-r--r--drivers/acpi/Kconfig11
-rw-r--r--drivers/acpi/ibm_acpi.c12
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
245config 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
245config ACPI_TOSHIBA 256config 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
160IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */ 161IBM_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 */
174IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */ 175IBM_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 */
179IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */ 181IBM_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)
1047static int _sta(acpi_handle handle) 1050static 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
1122static int bay_status_supported; 1127static int bay_status_supported;
1123static int bay_status2_supported; 1128static int bay_status2_supported;
1124static int bay_eject_supported; 1129static 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
1198static int cmos_read(char *p) 1204static 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
2656IBM_PARAM(dock); 2664IBM_PARAM(dock);
2657#endif 2665#endif
2666#ifdef CONFIG_ACPI_IBM_BAY
2658IBM_PARAM(bay); 2667IBM_PARAM(bay);
2668#endif /* CONFIG_ACPI_IBM_BAY */
2659IBM_PARAM(cmos); 2669IBM_PARAM(cmos);
2660IBM_PARAM(led); 2670IBM_PARAM(led);
2661IBM_PARAM(beep); 2671IBM_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);