Add relevant Kconfig changes to upstream patches in archive
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.20-rc2 / 0020-ACPI-ibm-acpi-make-non-generic-bay-support-optional.txt
blob7fc6fd8fc7bb0997edc110b75ccaf0f92a2ad1d0
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>
10 ---
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.
23 +config ACPI_IBM_BAY
24 +       bool "Legacy Removable Bay Support"
25 +       depends on ACPI_IBM
26 +       depends on ACPI_BAY=n
27 +       default n
28 +       ---help---
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.
34  config ACPI_TOSHIBA
35         tristate "Toshiba Laptop Extras"
36         depends on X86
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 */
44  #endif
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 */
51            "_EJ0",              /* 770x */
52      );                         /* all others */
53 +#endif
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)
58         return 0;
59  }
61 +#if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY)
62  static int _sta(acpi_handle handle)
63  {
64         int status;
65 @@ -1060,7 +1063,7 @@ static int _sta(acpi_handle handle)
67         return status;
68  }
70 +#endif
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)
75  }
76  #endif
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)
83  {
84         acpi_bus_generate_event(ibm->device, event, 0);
85  }
86 +#endif
88  static int cmos_read(char *p)
89  {
90 @@ -2330,6 +2335,7 @@ static struct ibm_struct ibms[] = {
91          .type = ACPI_SYSTEM_NOTIFY,
92          },
93  #endif
94 +#ifdef CONFIG_ACPI_IBM_BAY
95         {
96          .name = "bay",
97          .init = bay_init,
98 @@ -2339,6 +2345,7 @@ static struct ibm_struct ibms[] = {
99          .handle = &bay_handle,
100          .type = ACPI_SYSTEM_NOTIFY,
101          },
102 +#endif
103         {
104          .name = "cmos",
105          .read = cmos_read,
106 @@ -2624,7 +2631,9 @@ IBM_PARAM(light);
107  #ifdef CONFIG_ACPI_IBM_DOCK
108  IBM_PARAM(dock);
109  #endif
110 +#ifdef CONFIG_ACPI_IBM_BAY
111  IBM_PARAM(bay);
112 +#endif
113  IBM_PARAM(cmos);
114  IBM_PARAM(led);
115  IBM_PARAM(beep);
116 @@ -2717,12 +2726,14 @@ static int __init acpi_ibm_init(void)
117         IBM_HANDLE_INIT(dock);
118  #endif
119         IBM_HANDLE_INIT(pci);
120 +#ifdef CONFIG_ACPI_IBM_BAY
121         IBM_HANDLE_INIT(bay);
122         if (bay_handle)
123                 IBM_HANDLE_INIT(bay_ej);
124         IBM_HANDLE_INIT(bay2);
125         if (bay2_handle)
126                 IBM_HANDLE_INIT(bay2_ej);
127 +#endif
128         IBM_HANDLE_INIT(beep);
129         IBM_HANDLE_INIT(ecrd);
130         IBM_HANDLE_INIT(ecwr);
131 -- 
132 1.4.4.3