Add patches accepted for 2.6.21-rc4 (not released yet)
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.21-rc4 / 0002-ACPI-ibm-acpi-make-ibm-acpi-bay-support-optional.patch
blob721e96d4694f66484f39c039e3e36cfbe6054cc8
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>
9 ---
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.
22 +config ACPI_IBM_BAY
23 + bool "Legacy Removable Bay Support"
24 + depends on ACPI_IBM
25 + default y
26 + ---help---
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.
33 config ACPI_TOSHIBA
34 tristate "Toshiba Laptop Extras"
35 depends on X86
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 */
43 #endif
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 */
50 "_EJ0", /* 770x */
51 ); /* all others */
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)
57 return 0;
60 +#if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY)
61 static int _sta(acpi_handle handle)
63 int status;
64 @@ -1053,6 +1056,7 @@ static int _sta(acpi_handle handle)
66 return status;
68 +#endif
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)
74 #endif
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,
91 #endif
92 +#ifdef CONFIG_ACPI_IBM_BAY
94 .name = "bay",
95 .init = bay_init,
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 */
102 .name = "cmos",
103 .read = cmos_read,
104 @@ -2655,7 +2663,9 @@ IBM_PARAM(light);
105 #ifdef CONFIG_ACPI_IBM_DOCK
106 IBM_PARAM(dock);
107 #endif
108 +#ifdef CONFIG_ACPI_IBM_BAY
109 IBM_PARAM(bay);
110 +#endif /* CONFIG_ACPI_IBM_BAY */
111 IBM_PARAM(cmos);
112 IBM_PARAM(led);
113 IBM_PARAM(beep);
114 @@ -2731,12 +2741,14 @@ static int __init acpi_ibm_init(void)
115 IBM_HANDLE_INIT(dock);
116 #endif
117 IBM_HANDLE_INIT(pci);
118 +#ifdef CONFIG_ACPI_IBM_BAY
119 IBM_HANDLE_INIT(bay);
120 if (bay_handle)
121 IBM_HANDLE_INIT(bay_ej);
122 IBM_HANDLE_INIT(bay2);
123 if (bay2_handle)
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);
130 1.5.0.3