1 From 2bc808a8c4821a8ef4e3dc35b8fc577a9d2c6f0d Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Wed, 21 Feb 2007 13:05:38 -0200
4 Subject: [PATCH] ACPI: ibm-acpi: make ibm-acpi bay support optional
6 Make ibm-acpi bay support optional at kernel compile time.
8 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
10 drivers/acpi/Kconfig | 11 +++++++++++
11 drivers/acpi/ibm_acpi.c | 12 ++++++++++++
12 2 files changed, 23 insertions(+), 0 deletions(-)
14 diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
15 index e942ffe..ee3dcd1 100644
16 --- a/drivers/acpi/Kconfig
17 +++ b/drivers/acpi/Kconfig
18 @@ -242,6 +242,17 @@ config ACPI_IBM_DOCK
20 If you are not sure, say N here.
23 + bool "Legacy Removable Bay Support"
27 + Allows the ibm_acpi driver to handle removable bays. It will allow
28 + disabling the device in the bay, and also generate notifications when
29 + the bay lever is ejected or inserted.
31 + If you are not sure, say Y here.
34 tristate "Toshiba Laptop Extras"
36 diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
37 index 7c1b418..e7309a6 100644
38 --- a/drivers/acpi/ibm_acpi.c
39 +++ b/drivers/acpi/ibm_acpi.c
40 @@ -157,6 +157,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */
41 "\\_SB.PCI.ISA.SLCE", /* 570 */
42 ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */
44 +#ifdef CONFIG_ACPI_IBM_BAY
45 IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */
46 "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
47 "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */
48 @@ -174,6 +175,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */
49 IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */
52 +#endif /* CONFIG_ACPI_IBM_BAY */
54 /* don't list other alternatives as we install a notify handler on the 570 */
55 IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */
56 @@ -1044,6 +1046,7 @@ static int light_write(char *buf)
60 +#if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY)
61 static int _sta(acpi_handle handle)
64 @@ -1053,6 +1056,7 @@ static int _sta(acpi_handle handle)
70 #ifdef CONFIG_ACPI_IBM_DOCK
71 #define dock_docked() (_sta(dock_handle) & 1)
72 @@ -1119,6 +1123,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
76 +#ifdef CONFIG_ACPI_IBM_BAY
77 static int bay_status_supported;
78 static int bay_status2_supported;
79 static int bay_eject_supported;
80 @@ -1194,6 +1199,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event)
82 acpi_bus_generate_event(ibm->device, event, 0);
84 +#endif /* CONFIG_ACPI_IBM_BAY */
86 static int cmos_read(char *p)
88 @@ -2361,6 +2367,7 @@ static struct ibm_struct ibms[] = {
89 .type = ACPI_SYSTEM_NOTIFY,
92 +#ifdef CONFIG_ACPI_IBM_BAY
96 @@ -2370,6 +2377,7 @@ static struct ibm_struct ibms[] = {
97 .handle = &bay_handle,
98 .type = ACPI_SYSTEM_NOTIFY,
100 +#endif /* CONFIG_ACPI_IBM_BAY */
104 @@ -2655,7 +2663,9 @@ IBM_PARAM(light);
105 #ifdef CONFIG_ACPI_IBM_DOCK
108 +#ifdef CONFIG_ACPI_IBM_BAY
110 +#endif /* CONFIG_ACPI_IBM_BAY */
114 @@ -2731,12 +2741,14 @@ static int __init acpi_ibm_init(void)
115 IBM_HANDLE_INIT(dock);
117 IBM_HANDLE_INIT(pci);
118 +#ifdef CONFIG_ACPI_IBM_BAY
119 IBM_HANDLE_INIT(bay);
121 IBM_HANDLE_INIT(bay_ej);
122 IBM_HANDLE_INIT(bay2);
124 IBM_HANDLE_INIT(bay2_ej);
125 +#endif /* CONFIG_ACPI_IBM_BAY */
126 IBM_HANDLE_INIT(beep);
127 IBM_HANDLE_INIT(ecrd);
128 IBM_HANDLE_INIT(ecwr);