2 we shall need acpi bay support in ibm-acpi regardless, to
3 properly supply bay handling for batteries, and suspend/resume
5 From c14ce44ae5d0f9e84733e4e7526bc352604a39fe Mon Sep 17 00:00:00 2001
6 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
7 Date: Sat, 25 Nov 2006 16:35:09 -0200
8 Subject: [PATCH] ACPI: ibm-acpi: make non-generic bay support optional
10 This patch makes it possible to disable ibm-acpi non-generic bay support,
11 as generic bay support already works well for a number of ThinkPads.
13 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
15 drivers/acpi/Kconfig | 11 +++++++++++
16 drivers/acpi/ibm_acpi.c | 13 ++++++++++++-
17 2 files changed, 23 insertions(+), 1 deletions(-)
19 diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
20 index 113c01b..3a27d58 100644
21 --- a/drivers/acpi/Kconfig
22 +++ b/drivers/acpi/Kconfig
23 @@ -223,6 +223,17 @@ config ACPI_IBM_DOCK
25 If you are not sure, say N here.
28 + bool "Legacy Removable Bay Support"
30 + depends on ACPI_BAY=n
33 + Allows the ibm_acpi driver to handle removable bays.
34 + This support is obsoleted by CONFIG_ACPI_BAY.
36 + If you are not sure, say N here.
39 tristate "Toshiba Laptop Extras"
41 diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
42 index 88ec831..23e963a 100644
43 --- a/drivers/acpi/ibm_acpi.c
44 +++ b/drivers/acpi/ibm_acpi.c
45 @@ -157,6 +157,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */
46 "\\_SB.PCI.ISA.SLCE", /* 570 */
47 ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */
49 +#ifdef CONFIG_ACPI_IBM_BAY
50 IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */
51 "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
52 "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60, SATA mode? */
53 @@ -175,6 +176,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */
54 IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */
59 /* don't list other alternatives as we install a notify handler on the 570 */
60 IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */
61 @@ -1041,6 +1043,7 @@ static int light_write(char *buf)
65 +#if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY)
66 static int _sta(acpi_handle handle)
69 @@ -1050,7 +1053,7 @@ static int _sta(acpi_handle handle)
75 #ifdef CONFIG_ACPI_IBM_DOCK
76 #define dock_docked() (_sta(dock_handle) & 1)
78 @@ -1116,6 +1119,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
82 +#ifdef CONFIG_ACPI_IBM_BAY
83 static int bay_status_supported;
84 static int bay_status2_supported;
85 static int bay_eject_supported;
86 @@ -1191,6 +1195,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event)
88 acpi_bus_generate_event(ibm->device, event, 0);
92 static int cmos_read(char *p)
94 @@ -2357,6 +2362,7 @@ static struct ibm_struct ibms[] = {
95 .type = ACPI_SYSTEM_NOTIFY,
98 +#ifdef CONFIG_ACPI_IBM_BAY
102 @@ -2366,6 +2372,7 @@ static struct ibm_struct ibms[] = {
103 .handle = &bay_handle,
104 .type = ACPI_SYSTEM_NOTIFY,
110 @@ -2651,7 +2658,9 @@ IBM_PARAM(light);
111 #ifdef CONFIG_ACPI_IBM_DOCK
114 +#ifdef CONFIG_ACPI_IBM_BAY
120 @@ -2734,12 +2743,14 @@ static int __init acpi_ibm_init(void)
121 IBM_HANDLE_INIT(dock);
123 IBM_HANDLE_INIT(pci);
124 +#ifdef CONFIG_ACPI_IBM_BAY
125 IBM_HANDLE_INIT(bay);
127 IBM_HANDLE_INIT(bay_ej);
128 IBM_HANDLE_INIT(bay2);
130 IBM_HANDLE_INIT(bay2_ej);
132 IBM_HANDLE_INIT(beep);
133 IBM_HANDLE_INIT(ecrd);
134 IBM_HANDLE_INIT(ecwr);