diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 20:28:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 20:28:37 -0400 |
commit | 474829e875ab93512dbe0a713f564d3cd3874bc9 (patch) | |
tree | e0c066ca80e2d0c4b1eb4109393f5911bcb92998 /drivers/pnp | |
parent | 27afe58fe60fbf71a25f1f592472c0e7b72b3502 (diff) | |
parent | 7e31842441776b4d6ec7fd916c91663ad05b7814 (diff) |
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (53 commits)
ACPI: install ACPI table handler before any dynamic tables being loaded
ACPI / PM: Blacklist another machine that needs acpi_sleep=nonvs
ACPI: Page based coalescing of I/O remappings optimization
ACPI: Convert simple locking to RCU based locking
ACPI: Pre-map 'system event' related register blocks
ACPI: Add interfaces for ioremapping/iounmapping ACPI registers
ACPI: Maintain a list of ACPI memory mapped I/O remappings
ACPI: Fix ioremap size for MMIO reads and writes
ACPI / Battery: Return -ENODEV for unknown values in get_property()
ACPI / PM: Fix reference counting of power resources
Subject: [PATCH] ACPICA: Fix Scope() op in module level code
ACPI battery: support percentage battery remaining capacity
ACPI: Make Embedded Controller command timeout delay configurable
ACPI dock: move some functions to .init.text
ACPI: thermal: remove unused limit code
ACPI: static sleep_states[] and acpi_gts_bfs_check
ACPI: remove dead code
ACPI: delete dedicated MAINTAINERS entries for ACPI EC and BATTERY drivers
ACPI: Only processor needs CPU_IDLE
ACPICA: Update version to 20101013
...
Diffstat (limited to 'drivers/pnp')
-rw-r--r-- | drivers/pnp/base.h | 5 | ||||
-rw-r--r-- | drivers/pnp/core.c | 8 | ||||
-rw-r--r-- | drivers/pnp/driver.c | 2 | ||||
-rw-r--r-- | drivers/pnp/pnpacpi/core.c | 31 | ||||
-rw-r--r-- | drivers/pnp/resource.c | 10 |
5 files changed, 39 insertions, 17 deletions
diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h index 0bab84ebb15d..19bc73695475 100644 --- a/drivers/pnp/base.h +++ b/drivers/pnp/base.h | |||
@@ -12,11 +12,12 @@ void pnp_unregister_protocol(struct pnp_protocol *protocol); | |||
12 | 12 | ||
13 | #define PNP_EISA_ID_MASK 0x7fffffff | 13 | #define PNP_EISA_ID_MASK 0x7fffffff |
14 | void pnp_eisa_id_to_string(u32 id, char *str); | 14 | void pnp_eisa_id_to_string(u32 id, char *str); |
15 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *, int id, char *pnpid); | 15 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *, int id, |
16 | const char *pnpid); | ||
16 | struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid); | 17 | struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid); |
17 | 18 | ||
18 | int pnp_add_device(struct pnp_dev *dev); | 19 | int pnp_add_device(struct pnp_dev *dev); |
19 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id); | 20 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id); |
20 | 21 | ||
21 | int pnp_add_card(struct pnp_card *card); | 22 | int pnp_add_card(struct pnp_card *card); |
22 | void pnp_remove_card(struct pnp_card *card); | 23 | void pnp_remove_card(struct pnp_card *card); |
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index 88b3cde52596..0f34d962fd3c 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c | |||
@@ -124,7 +124,8 @@ static void pnp_release_device(struct device *dmdev) | |||
124 | kfree(dev); | 124 | kfree(dev); |
125 | } | 125 | } |
126 | 126 | ||
127 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, char *pnpid) | 127 | struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, |
128 | const char *pnpid) | ||
128 | { | 129 | { |
129 | struct pnp_dev *dev; | 130 | struct pnp_dev *dev; |
130 | struct pnp_id *dev_id; | 131 | struct pnp_id *dev_id; |
@@ -194,8 +195,9 @@ int pnp_add_device(struct pnp_dev *dev) | |||
194 | for (id = dev->id; id; id = id->next) | 195 | for (id = dev->id; id; id = id->next) |
195 | len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id); | 196 | len += scnprintf(buf + len, sizeof(buf) - len, " %s", id->id); |
196 | 197 | ||
197 | pnp_dbg(&dev->dev, "%s device, IDs%s (%s)\n", | 198 | dev_printk(KERN_DEBUG, &dev->dev, "%s device, IDs%s (%s)\n", |
198 | dev->protocol->name, buf, dev->active ? "active" : "disabled"); | 199 | dev->protocol->name, buf, |
200 | dev->active ? "active" : "disabled"); | ||
199 | return 0; | 201 | return 0; |
200 | } | 202 | } |
201 | 203 | ||
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index cd11b113494f..d1dbb9df53fa 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c | |||
@@ -236,7 +236,7 @@ void pnp_unregister_driver(struct pnp_driver *drv) | |||
236 | * @dev: pointer to the desired device | 236 | * @dev: pointer to the desired device |
237 | * @id: pointer to an EISA id string | 237 | * @id: pointer to an EISA id string |
238 | */ | 238 | */ |
239 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id) | 239 | struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id) |
240 | { | 240 | { |
241 | struct pnp_id *dev_id, *ptr; | 241 | struct pnp_id *dev_id, *ptr; |
242 | 242 | ||
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index dc4e32e031e9..2d73dfcecdbb 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "../base.h" | 28 | #include "../base.h" |
29 | #include "pnpacpi.h" | 29 | #include "pnpacpi.h" |
30 | 30 | ||
31 | static int num = 0; | 31 | static int num; |
32 | 32 | ||
33 | /* We need only to blacklist devices that have already an acpi driver that | 33 | /* We need only to blacklist devices that have already an acpi driver that |
34 | * can't use pnp layer. We don't need to blacklist device that are directly | 34 | * can't use pnp layer. We don't need to blacklist device that are directly |
@@ -59,7 +59,7 @@ static inline int __init is_exclusive_device(struct acpi_device *dev) | |||
59 | #define TEST_ALPHA(c) \ | 59 | #define TEST_ALPHA(c) \ |
60 | if (!('@' <= (c) || (c) <= 'Z')) \ | 60 | if (!('@' <= (c) || (c) <= 'Z')) \ |
61 | return 0 | 61 | return 0 |
62 | static int __init ispnpidacpi(char *id) | 62 | static int __init ispnpidacpi(const char *id) |
63 | { | 63 | { |
64 | TEST_ALPHA(id[0]); | 64 | TEST_ALPHA(id[0]); |
65 | TEST_ALPHA(id[1]); | 65 | TEST_ALPHA(id[1]); |
@@ -180,11 +180,24 @@ struct pnp_protocol pnpacpi_protocol = { | |||
180 | }; | 180 | }; |
181 | EXPORT_SYMBOL(pnpacpi_protocol); | 181 | EXPORT_SYMBOL(pnpacpi_protocol); |
182 | 182 | ||
183 | static char *pnpacpi_get_id(struct acpi_device *device) | ||
184 | { | ||
185 | struct acpi_hardware_id *id; | ||
186 | |||
187 | list_for_each_entry(id, &device->pnp.ids, list) { | ||
188 | if (ispnpidacpi(id->id)) | ||
189 | return id->id; | ||
190 | } | ||
191 | |||
192 | return NULL; | ||
193 | } | ||
194 | |||
183 | static int __init pnpacpi_add_device(struct acpi_device *device) | 195 | static int __init pnpacpi_add_device(struct acpi_device *device) |
184 | { | 196 | { |
185 | acpi_handle temp = NULL; | 197 | acpi_handle temp = NULL; |
186 | acpi_status status; | 198 | acpi_status status; |
187 | struct pnp_dev *dev; | 199 | struct pnp_dev *dev; |
200 | char *pnpid; | ||
188 | struct acpi_hardware_id *id; | 201 | struct acpi_hardware_id *id; |
189 | 202 | ||
190 | /* | 203 | /* |
@@ -192,11 +205,17 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
192 | * driver should not be loaded. | 205 | * driver should not be loaded. |
193 | */ | 206 | */ |
194 | status = acpi_get_handle(device->handle, "_CRS", &temp); | 207 | status = acpi_get_handle(device->handle, "_CRS", &temp); |
195 | if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) || | 208 | if (ACPI_FAILURE(status)) |
196 | is_exclusive_device(device) || (!device->status.present)) | 209 | return 0; |
210 | |||
211 | pnpid = pnpacpi_get_id(device); | ||
212 | if (!pnpid) | ||
213 | return 0; | ||
214 | |||
215 | if (is_exclusive_device(device) || !device->status.present) | ||
197 | return 0; | 216 | return 0; |
198 | 217 | ||
199 | dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device)); | 218 | dev = pnp_alloc_dev(&pnpacpi_protocol, num, pnpid); |
200 | if (!dev) | 219 | if (!dev) |
201 | return -ENOMEM; | 220 | return -ENOMEM; |
202 | 221 | ||
@@ -227,7 +246,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device) | |||
227 | pnpacpi_parse_resource_option_data(dev); | 246 | pnpacpi_parse_resource_option_data(dev); |
228 | 247 | ||
229 | list_for_each_entry(id, &device->pnp.ids, list) { | 248 | list_for_each_entry(id, &device->pnp.ids, list) { |
230 | if (!strcmp(id->id, acpi_device_hid(device))) | 249 | if (!strcmp(id->id, pnpid)) |
231 | continue; | 250 | continue; |
232 | if (!ispnpidacpi(id->id)) | 251 | if (!ispnpidacpi(id->id)) |
233 | continue; | 252 | continue; |
diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index e3446ab8b563..a925e6b63d72 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c | |||
@@ -523,7 +523,7 @@ struct pnp_resource *pnp_add_irq_resource(struct pnp_dev *dev, int irq, | |||
523 | res->start = irq; | 523 | res->start = irq; |
524 | res->end = irq; | 524 | res->end = irq; |
525 | 525 | ||
526 | pnp_dbg(&dev->dev, " add %pr\n", res); | 526 | dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); |
527 | return pnp_res; | 527 | return pnp_res; |
528 | } | 528 | } |
529 | 529 | ||
@@ -544,7 +544,7 @@ struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma, | |||
544 | res->start = dma; | 544 | res->start = dma; |
545 | res->end = dma; | 545 | res->end = dma; |
546 | 546 | ||
547 | pnp_dbg(&dev->dev, " add %pr\n", res); | 547 | dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); |
548 | return pnp_res; | 548 | return pnp_res; |
549 | } | 549 | } |
550 | 550 | ||
@@ -568,7 +568,7 @@ struct pnp_resource *pnp_add_io_resource(struct pnp_dev *dev, | |||
568 | res->start = start; | 568 | res->start = start; |
569 | res->end = end; | 569 | res->end = end; |
570 | 570 | ||
571 | pnp_dbg(&dev->dev, " add %pr\n", res); | 571 | dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); |
572 | return pnp_res; | 572 | return pnp_res; |
573 | } | 573 | } |
574 | 574 | ||
@@ -592,7 +592,7 @@ struct pnp_resource *pnp_add_mem_resource(struct pnp_dev *dev, | |||
592 | res->start = start; | 592 | res->start = start; |
593 | res->end = end; | 593 | res->end = end; |
594 | 594 | ||
595 | pnp_dbg(&dev->dev, " add %pr\n", res); | 595 | dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); |
596 | return pnp_res; | 596 | return pnp_res; |
597 | } | 597 | } |
598 | 598 | ||
@@ -616,7 +616,7 @@ struct pnp_resource *pnp_add_bus_resource(struct pnp_dev *dev, | |||
616 | res->start = start; | 616 | res->start = start; |
617 | res->end = end; | 617 | res->end = end; |
618 | 618 | ||
619 | pnp_dbg(&dev->dev, " add %pr\n", res); | 619 | dev_printk(KERN_DEBUG, &dev->dev, "%pR\n", res); |
620 | return pnp_res; | 620 | return pnp_res; |
621 | } | 621 | } |
622 | 622 | ||