1 From 2df910b4c3edcce9a0c12394db6f5f4a6e69c712 Mon Sep 17 00:00:00 2001
2 From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
3 Date: Sat, 25 Nov 2006 16:35:09 -0200
4 Subject: [PATCH 20/28] ACPI: ibm-acpi: make non-generic bay support optional
6 This patch makes it possible to disable ibm-acpi non-generic bay support,
7 as generic bay support already works well for a number of ThinkPads.
9 Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
11 drivers/acpi/Kconfig | 11 +++++++++++
12 drivers/acpi/ibm_acpi.c | 13 ++++++++++++-
13 2 files changed, 23 insertions(+), 1 deletions(-)
15 diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
16 index 59f9def..6f8c50e 100644
17 --- a/drivers/acpi/Kconfig
18 +++ b/drivers/acpi/Kconfig
19 @@ -224,6 +224,17 @@ config ACPI_IBM_DOCK
21 If you are not sure, say N here.
24 + bool "Legacy Removable Bay Support"
26 + depends on ACPI_BAY=n
29 + Allows the ibm_acpi driver to handle removable bays.
30 + This support is obsoleted by CONFIG_ACPI_BAY.
32 + If you are not sure, say N here.
35 tristate "Toshiba Laptop Extras"
37 diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
38 index 392abbb..fbb4970 100644
39 --- a/drivers/acpi/ibm_acpi.c
40 +++ b/drivers/acpi/ibm_acpi.c
41 @@ -172,6 +172,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */
42 "\\_SB.PCI.ISA.SLCE", /* 570 */
43 ); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */
45 +#ifdef CONFIG_ACPI_IBM_BAY
46 IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */
47 "\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
48 "\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */
49 @@ -189,6 +190,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */
50 IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */
55 /* don't list other alternatives as we install a notify handler on the 570 */
56 IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */
57 @@ -1051,6 +1053,7 @@ static int light_write(char *buf)
61 +#if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY)
62 static int _sta(acpi_handle handle)
65 @@ -1060,7 +1063,7 @@ static int _sta(acpi_handle handle)
71 #ifdef CONFIG_ACPI_IBM_DOCK
72 #define dock_docked() (_sta(dock_handle) & 1)
74 @@ -1126,6 +1129,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
78 +#ifdef CONFIG_ACPI_IBM_BAY
79 static int bay_status_supported;
80 static int bay_status2_supported;
81 static int bay_eject_supported;
82 @@ -1201,6 +1205,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event)
84 acpi_bus_generate_event(ibm->device, event, 0);
88 static int cmos_read(char *p)
90 @@ -2330,6 +2335,7 @@ static struct ibm_struct ibms[] = {
91 .type = ACPI_SYSTEM_NOTIFY,
94 +#ifdef CONFIG_ACPI_IBM_BAY
98 @@ -2339,6 +2345,7 @@ static struct ibm_struct ibms[] = {
99 .handle = &bay_handle,
100 .type = ACPI_SYSTEM_NOTIFY,
106 @@ -2624,7 +2631,9 @@ IBM_PARAM(light);
107 #ifdef CONFIG_ACPI_IBM_DOCK
110 +#ifdef CONFIG_ACPI_IBM_BAY
116 @@ -2717,12 +2726,14 @@ static int __init acpi_ibm_init(void)
117 IBM_HANDLE_INIT(dock);
119 IBM_HANDLE_INIT(pci);
120 +#ifdef CONFIG_ACPI_IBM_BAY
121 IBM_HANDLE_INIT(bay);
123 IBM_HANDLE_INIT(bay_ej);
124 IBM_HANDLE_INIT(bay2);
126 IBM_HANDLE_INIT(bay2_ej);
128 IBM_HANDLE_INIT(beep);
129 IBM_HANDLE_INIT(ecrd);
130 IBM_HANDLE_INIT(ecwr);