diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 14:55:14 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 14:55:14 -0500 |
| commit | a3a798c88a14b35e5d4ca30716dbc9eb9a1ddfe2 (patch) | |
| tree | 393969a0f1405237483c8c29b904690f2bb90559 /drivers/acpi/system.c | |
| parent | efcb3cf7f00c3c424db012380a8a974c2676a3c8 (diff) | |
| parent | d97c0defba25a959a990f6d4759f43075540832e (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: (94 commits)
ACPICA: hide private headers
ACPICA: create acpica/ directory
ACPI: fix build warning
ACPI : Use RSDT instead of XSDT by adding boot option of "acpi=rsdt"
ACPI: Avoid array address overflow when _CST MWAIT hint bits are set
fujitsu-laptop: Simplify SBLL/SBL2 backlight handling
fujitsu-laptop: Add BL power, LED control and radio state information
ACPICA: delete utcache.c
ACPICA: delete acdisasm.h
ACPICA: Update version to 20081204.
ACPICA: FADT: Update error msgs for consistency
ACPICA: FADT: set acpi_gbl_use_default_register_widths to TRUE by default
ACPICA: FADT parsing changes and fixes
ACPICA: Add ACPI_MUTEX_TYPE configuration option
ACPICA: Fixes for various ACPI data tables
ACPICA: Restructure includes into public/private
ACPI: remove private acpica headers from driver files
ACPI: reboot.c: use new acpi_reset interface
ACPICA: New: acpi_reset interface - write to reset register
ACPICA: Move all public H/W interfaces to new hwxface
...
Diffstat (limited to 'drivers/acpi/system.c')
| -rw-r--r-- | drivers/acpi/system.c | 63 |
1 files changed, 2 insertions, 61 deletions
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c index 6e4107f8240..391d0358a59 100644 --- a/drivers/acpi/system.c +++ b/drivers/acpi/system.c | |||
| @@ -192,65 +192,6 @@ static struct attribute_group interrupt_stats_attr_group = { | |||
| 192 | }; | 192 | }; |
| 193 | static struct kobj_attribute *counter_attrs; | 193 | static struct kobj_attribute *counter_attrs; |
| 194 | 194 | ||
| 195 | static int count_num_gpes(void) | ||
| 196 | { | ||
| 197 | int count = 0; | ||
| 198 | struct acpi_gpe_xrupt_info *gpe_xrupt_info; | ||
| 199 | struct acpi_gpe_block_info *gpe_block; | ||
| 200 | acpi_cpu_flags flags; | ||
| 201 | |||
| 202 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | ||
| 203 | |||
| 204 | gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head; | ||
| 205 | while (gpe_xrupt_info) { | ||
| 206 | gpe_block = gpe_xrupt_info->gpe_block_list_head; | ||
| 207 | while (gpe_block) { | ||
| 208 | count += gpe_block->register_count * | ||
| 209 | ACPI_GPE_REGISTER_WIDTH; | ||
| 210 | gpe_block = gpe_block->next; | ||
| 211 | } | ||
| 212 | gpe_xrupt_info = gpe_xrupt_info->next; | ||
| 213 | } | ||
| 214 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | ||
| 215 | |||
| 216 | return count; | ||
| 217 | } | ||
| 218 | |||
| 219 | static int get_gpe_device(int index, acpi_handle *handle) | ||
| 220 | { | ||
| 221 | struct acpi_gpe_xrupt_info *gpe_xrupt_info; | ||
| 222 | struct acpi_gpe_block_info *gpe_block; | ||
| 223 | acpi_cpu_flags flags; | ||
| 224 | struct acpi_namespace_node *node; | ||
| 225 | |||
| 226 | flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); | ||
| 227 | |||
| 228 | gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head; | ||
| 229 | while (gpe_xrupt_info) { | ||
| 230 | gpe_block = gpe_xrupt_info->gpe_block_list_head; | ||
| 231 | node = gpe_block->node; | ||
| 232 | while (gpe_block) { | ||
| 233 | index -= gpe_block->register_count * | ||
| 234 | ACPI_GPE_REGISTER_WIDTH; | ||
| 235 | if (index < 0) { | ||
| 236 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | ||
| 237 | /* return NULL if it's FADT GPE */ | ||
| 238 | if (node->type != ACPI_TYPE_DEVICE) | ||
| 239 | *handle = NULL; | ||
| 240 | else | ||
| 241 | *handle = node; | ||
| 242 | return 0; | ||
| 243 | } | ||
| 244 | node = gpe_block->node; | ||
| 245 | gpe_block = gpe_block->next; | ||
| 246 | } | ||
| 247 | gpe_xrupt_info = gpe_xrupt_info->next; | ||
| 248 | } | ||
| 249 | acpi_os_release_lock(acpi_gbl_gpe_lock, flags); | ||
| 250 | |||
| 251 | return -ENODEV; | ||
| 252 | } | ||
| 253 | |||
| 254 | static void delete_gpe_attr_array(void) | 195 | static void delete_gpe_attr_array(void) |
| 255 | { | 196 | { |
| 256 | struct event_counter *tmp = all_counters; | 197 | struct event_counter *tmp = all_counters; |
| @@ -309,7 +250,7 @@ static int get_status(u32 index, acpi_event_status *status, acpi_handle *handle) | |||
| 309 | goto end; | 250 | goto end; |
| 310 | 251 | ||
| 311 | if (index < num_gpes) { | 252 | if (index < num_gpes) { |
| 312 | result = get_gpe_device(index, handle); | 253 | result = acpi_get_gpe_device(index, handle); |
| 313 | if (result) { | 254 | if (result) { |
| 314 | ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND, | 255 | ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND, |
| 315 | "Invalid GPE 0x%x\n", index)); | 256 | "Invalid GPE 0x%x\n", index)); |
| @@ -436,7 +377,7 @@ void acpi_irq_stats_init(void) | |||
| 436 | if (all_counters) | 377 | if (all_counters) |
| 437 | return; | 378 | return; |
| 438 | 379 | ||
| 439 | num_gpes = count_num_gpes(); | 380 | num_gpes = acpi_current_gpe_count; |
| 440 | num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA; | 381 | num_counters = num_gpes + ACPI_NUM_FIXED_EVENTS + NUM_COUNTERS_EXTRA; |
| 441 | 382 | ||
| 442 | all_attrs = kzalloc(sizeof(struct attribute *) * (num_counters + 1), | 383 | all_attrs = kzalloc(sizeof(struct attribute *) * (num_counters + 1), |
