aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/acpi/enumeration.txt2
-rw-r--r--Documentation/acpi/gpio-properties.txt6
-rw-r--r--arch/x86/pci/acpi.c24
-rw-r--r--drivers/acpi/acpi_pnp.c2
-rw-r--r--drivers/acpi/resource.c2
-rw-r--r--drivers/acpi/sbshc.c22
6 files changed, 51 insertions, 7 deletions
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt
index 750401f91341..15dfce708ebf 100644
--- a/Documentation/acpi/enumeration.txt
+++ b/Documentation/acpi/enumeration.txt
@@ -253,7 +253,7 @@ input driver:
253GPIO support 253GPIO support
254~~~~~~~~~~~~ 254~~~~~~~~~~~~
255ACPI 5 introduced two new resources to describe GPIO connections: GpioIo 255ACPI 5 introduced two new resources to describe GPIO connections: GpioIo
256and GpioInt. These resources are used be used to pass GPIO numbers used by 256and GpioInt. These resources can be used to pass GPIO numbers used by
257the device to the driver. ACPI 5.1 extended this with _DSD (Device 257the device to the driver. ACPI 5.1 extended this with _DSD (Device
258Specific Data) which made it possible to name the GPIOs among other things. 258Specific Data) which made it possible to name the GPIOs among other things.
259 259
diff --git a/Documentation/acpi/gpio-properties.txt b/Documentation/acpi/gpio-properties.txt
index ae36fcf86dc7..f35dad11f0de 100644
--- a/Documentation/acpi/gpio-properties.txt
+++ b/Documentation/acpi/gpio-properties.txt
@@ -1,9 +1,9 @@
1_DSD Device Properties Related to GPIO 1_DSD Device Properties Related to GPIO
2-------------------------------------- 2--------------------------------------
3 3
4With the release of ACPI 5.1 and the _DSD configuration objecte names 4With the release of ACPI 5.1, the _DSD configuration object finally
5can finally be given to GPIOs (and other things as well) returned by 5allows names to be given to GPIOs (and other things as well) returned
6_CRS. Previously, we were only able to use an integer index to find 6by _CRS. Previously, we were only able to use an integer index to find
7the corresponding GPIO, which is pretty error prone (it depends on 7the corresponding GPIO, which is pretty error prone (it depends on
8the _CRS output ordering, for example). 8the _CRS output ordering, for example).
9 9
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index e4695985f9de..d93963340c3c 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -325,6 +325,26 @@ static void release_pci_root_info(struct pci_host_bridge *bridge)
325 kfree(info); 325 kfree(info);
326} 326}
327 327
328/*
329 * An IO port or MMIO resource assigned to a PCI host bridge may be
330 * consumed by the host bridge itself or available to its child
331 * bus/devices. The ACPI specification defines a bit (Producer/Consumer)
332 * to tell whether the resource is consumed by the host bridge itself,
333 * but firmware hasn't used that bit consistently, so we can't rely on it.
334 *
335 * On x86 and IA64 platforms, all IO port and MMIO resources are assumed
336 * to be available to child bus/devices except one special case:
337 * IO port [0xCF8-0xCFF] is consumed by the host bridge itself
338 * to access PCI configuration space.
339 *
340 * So explicitly filter out PCI CFG IO ports[0xCF8-0xCFF].
341 */
342static bool resource_is_pcicfg_ioport(struct resource *res)
343{
344 return (res->flags & IORESOURCE_IO) &&
345 res->start == 0xCF8 && res->end == 0xCFF;
346}
347
328static void probe_pci_root_info(struct pci_root_info *info, 348static void probe_pci_root_info(struct pci_root_info *info,
329 struct acpi_device *device, 349 struct acpi_device *device,
330 int busnum, int domain, 350 int busnum, int domain,
@@ -346,8 +366,8 @@ static void probe_pci_root_info(struct pci_root_info *info,
346 "no IO and memory resources present in _CRS\n"); 366 "no IO and memory resources present in _CRS\n");
347 else 367 else
348 resource_list_for_each_entry_safe(entry, tmp, list) { 368 resource_list_for_each_entry_safe(entry, tmp, list) {
349 if ((entry->res->flags & IORESOURCE_WINDOW) == 0 || 369 if ((entry->res->flags & IORESOURCE_DISABLED) ||
350 (entry->res->flags & IORESOURCE_DISABLED)) 370 resource_is_pcicfg_ioport(entry->res))
351 resource_list_destroy_entry(entry); 371 resource_list_destroy_entry(entry);
352 else 372 else
353 entry->res->name = info->name; 373 entry->res->name = info->name;
diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
index b193f8425999..ff6d8adc9cda 100644
--- a/drivers/acpi/acpi_pnp.c
+++ b/drivers/acpi/acpi_pnp.c
@@ -304,6 +304,8 @@ static const struct acpi_device_id acpi_pnp_device_ids[] = {
304 {"PNPb006"}, 304 {"PNPb006"},
305 /* cs423x-pnpbios */ 305 /* cs423x-pnpbios */
306 {"CSC0100"}, 306 {"CSC0100"},
307 {"CSC0103"},
308 {"CSC0110"},
307 {"CSC0000"}, 309 {"CSC0000"},
308 {"GIM0100"}, /* Guillemot Turtlebeach something appears to be cs4232 compatible */ 310 {"GIM0100"}, /* Guillemot Turtlebeach something appears to be cs4232 compatible */
309 /* es18xx-pnpbios */ 311 /* es18xx-pnpbios */
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 5589a6e2a023..8244f013f210 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -573,7 +573,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_get_resources);
573 * @ares: Input ACPI resource object. 573 * @ares: Input ACPI resource object.
574 * @types: Valid resource types of IORESOURCE_XXX 574 * @types: Valid resource types of IORESOURCE_XXX
575 * 575 *
576 * This is a hepler function to support acpi_dev_get_resources(), which filters 576 * This is a helper function to support acpi_dev_get_resources(), which filters
577 * ACPI resource objects according to resource types. 577 * ACPI resource objects according to resource types.
578 */ 578 */
579int acpi_dev_filter_resource_type(struct acpi_resource *ares, 579int acpi_dev_filter_resource_type(struct acpi_resource *ares,
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
index 26e5b5060523..bf034f8b7c1a 100644
--- a/drivers/acpi/sbshc.c
+++ b/drivers/acpi/sbshc.c
@@ -14,6 +14,7 @@
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/dmi.h>
17#include "sbshc.h" 18#include "sbshc.h"
18 19
19#define PREFIX "ACPI: " 20#define PREFIX "ACPI: "
@@ -87,6 +88,8 @@ enum acpi_smb_offset {
87 ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */ 88 ACPI_SMB_ALARM_DATA = 0x26, /* 2 bytes alarm data */
88}; 89};
89 90
91static bool macbook;
92
90static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data) 93static inline int smb_hc_read(struct acpi_smb_hc *hc, u8 address, u8 *data)
91{ 94{
92 return ec_read(hc->offset + address, data); 95 return ec_read(hc->offset + address, data);
@@ -132,6 +135,8 @@ static int acpi_smbus_transaction(struct acpi_smb_hc *hc, u8 protocol,
132 } 135 }
133 136
134 mutex_lock(&hc->lock); 137 mutex_lock(&hc->lock);
138 if (macbook)
139 udelay(5);
135 if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp)) 140 if (smb_hc_read(hc, ACPI_SMB_PROTOCOL, &temp))
136 goto end; 141 goto end;
137 if (temp) { 142 if (temp) {
@@ -257,12 +262,29 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
257 acpi_handle handle, acpi_ec_query_func func, 262 acpi_handle handle, acpi_ec_query_func func,
258 void *data); 263 void *data);
259 264
265static int macbook_dmi_match(const struct dmi_system_id *d)
266{
267 pr_debug("Detected MacBook, enabling workaround\n");
268 macbook = true;
269 return 0;
270}
271
272static struct dmi_system_id acpi_smbus_dmi_table[] = {
273 { macbook_dmi_match, "Apple MacBook", {
274 DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
275 DMI_MATCH(DMI_PRODUCT_NAME, "MacBook") },
276 },
277 { },
278};
279
260static int acpi_smbus_hc_add(struct acpi_device *device) 280static int acpi_smbus_hc_add(struct acpi_device *device)
261{ 281{
262 int status; 282 int status;
263 unsigned long long val; 283 unsigned long long val;
264 struct acpi_smb_hc *hc; 284 struct acpi_smb_hc *hc;
265 285
286 dmi_check_system(acpi_smbus_dmi_table);
287
266 if (!device) 288 if (!device)
267 return -EINVAL; 289 return -EINVAL;
268 290