aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-04-08 19:40:38 -0400
committerLen Brown <len.brown@intel.com>2010-05-28 23:36:06 -0400
commitfe955682d2153b35dffcf1673dff0491096a3f0a (patch)
treefb2e04c48bb89e19b6b2c274daa817b3cf09bd4e
parentd5a64513c6a171262082c250592c062e97a2c693 (diff)
ACPI / EC / PM: Fix names of functions that block/unblock EC transactions
The names of the functions used for blocking/unblocking EC transactions during suspend/hibernation suggest that the transactions are suspended and resumed by them, while in fact they are disabled and enabled. Rename the functions (and the flag used by them) to better reflect what they really do. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/acpi/ec.c16
-rw-r--r--drivers/acpi/internal.h6
-rw-r--r--drivers/acpi/sleep.c12
3 files changed, 17 insertions, 17 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 2c2b73a2a7c2..3f01f065b533 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -79,7 +79,7 @@ enum {
79 EC_FLAGS_GPE_STORM, /* GPE storm detected */ 79 EC_FLAGS_GPE_STORM, /* GPE storm detected */
80 EC_FLAGS_HANDLERS_INSTALLED, /* Handlers for GPE and 80 EC_FLAGS_HANDLERS_INSTALLED, /* Handlers for GPE and
81 * OpReg are installed */ 81 * OpReg are installed */
82 EC_FLAGS_FROZEN, /* Transactions are suspended */ 82 EC_FLAGS_BLOCKED, /* Transactions are blocked */
83}; 83};
84 84
85/* If we find an EC via the ECDT, we need to keep a ptr to its context */ 85/* If we find an EC via the ECDT, we need to keep a ptr to its context */
@@ -293,7 +293,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
293 if (t->rdata) 293 if (t->rdata)
294 memset(t->rdata, 0, t->rlen); 294 memset(t->rdata, 0, t->rlen);
295 mutex_lock(&ec->lock); 295 mutex_lock(&ec->lock);
296 if (test_bit(EC_FLAGS_FROZEN, &ec->flags)) { 296 if (test_bit(EC_FLAGS_BLOCKED, &ec->flags)) {
297 status = -EINVAL; 297 status = -EINVAL;
298 goto unlock; 298 goto unlock;
299 } 299 }
@@ -459,7 +459,7 @@ int ec_transaction(u8 command,
459 459
460EXPORT_SYMBOL(ec_transaction); 460EXPORT_SYMBOL(ec_transaction);
461 461
462void acpi_ec_suspend_transactions(void) 462void acpi_ec_block_transactions(void)
463{ 463{
464 struct acpi_ec *ec = first_ec; 464 struct acpi_ec *ec = first_ec;
465 465
@@ -468,11 +468,11 @@ void acpi_ec_suspend_transactions(void)
468 468
469 mutex_lock(&ec->lock); 469 mutex_lock(&ec->lock);
470 /* Prevent transactions from being carried out */ 470 /* Prevent transactions from being carried out */
471 set_bit(EC_FLAGS_FROZEN, &ec->flags); 471 set_bit(EC_FLAGS_BLOCKED, &ec->flags);
472 mutex_unlock(&ec->lock); 472 mutex_unlock(&ec->lock);
473} 473}
474 474
475void acpi_ec_resume_transactions(void) 475void acpi_ec_unblock_transactions(void)
476{ 476{
477 struct acpi_ec *ec = first_ec; 477 struct acpi_ec *ec = first_ec;
478 478
@@ -481,18 +481,18 @@ void acpi_ec_resume_transactions(void)
481 481
482 mutex_lock(&ec->lock); 482 mutex_lock(&ec->lock);
483 /* Allow transactions to be carried out again */ 483 /* Allow transactions to be carried out again */
484 clear_bit(EC_FLAGS_FROZEN, &ec->flags); 484 clear_bit(EC_FLAGS_BLOCKED, &ec->flags);
485 mutex_unlock(&ec->lock); 485 mutex_unlock(&ec->lock);
486} 486}
487 487
488void acpi_ec_resume_transactions_early(void) 488void acpi_ec_unblock_transactions_early(void)
489{ 489{
490 /* 490 /*
491 * Allow transactions to happen again (this function is called from 491 * Allow transactions to happen again (this function is called from
492 * atomic context during wakeup, so we don't need to acquire the mutex). 492 * atomic context during wakeup, so we don't need to acquire the mutex).
493 */ 493 */
494 if (first_ec) 494 if (first_ec)
495 clear_bit(EC_FLAGS_FROZEN, &first_ec->flags); 495 clear_bit(EC_FLAGS_BLOCKED, &first_ec->flags);
496} 496}
497 497
498static int acpi_ec_query_unlocked(struct acpi_ec *ec, u8 * data) 498static int acpi_ec_query_unlocked(struct acpi_ec *ec, u8 * data)
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index 0ec48c7efa9b..f8f190ec066e 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -49,9 +49,9 @@ void acpi_early_processor_set_pdc(void);
49int acpi_ec_init(void); 49int acpi_ec_init(void);
50int acpi_ec_ecdt_probe(void); 50int acpi_ec_ecdt_probe(void);
51int acpi_boot_ec_enable(void); 51int acpi_boot_ec_enable(void);
52void acpi_ec_suspend_transactions(void); 52void acpi_ec_block_transactions(void);
53void acpi_ec_resume_transactions(void); 53void acpi_ec_unblock_transactions(void);
54void acpi_ec_resume_transactions_early(void); 54void acpi_ec_unblock_transactions_early(void);
55 55
56/*-------------------------------------------------------------------------- 56/*--------------------------------------------------------------------------
57 Suspend/Resume 57 Suspend/Resume
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 24741ac65897..504a55edac49 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -116,7 +116,7 @@ static int acpi_pm_freeze(void)
116{ 116{
117 acpi_disable_all_gpes(); 117 acpi_disable_all_gpes();
118 acpi_os_wait_events_complete(NULL); 118 acpi_os_wait_events_complete(NULL);
119 acpi_ec_suspend_transactions(); 119 acpi_ec_block_transactions();
120 return 0; 120 return 0;
121} 121}
122 122
@@ -279,7 +279,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
279 */ 279 */
280 acpi_disable_all_gpes(); 280 acpi_disable_all_gpes();
281 /* Allow EC transactions to happen. */ 281 /* Allow EC transactions to happen. */
282 acpi_ec_resume_transactions_early(); 282 acpi_ec_unblock_transactions_early();
283 283
284 local_irq_restore(flags); 284 local_irq_restore(flags);
285 printk(KERN_DEBUG "Back to C!\n"); 285 printk(KERN_DEBUG "Back to C!\n");
@@ -293,7 +293,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
293 293
294static void acpi_suspend_finish(void) 294static void acpi_suspend_finish(void)
295{ 295{
296 acpi_ec_resume_transactions(); 296 acpi_ec_unblock_transactions();
297 acpi_pm_finish(); 297 acpi_pm_finish();
298} 298}
299 299
@@ -597,7 +597,7 @@ static int acpi_hibernation_enter(void)
597static void acpi_hibernation_finish(void) 597static void acpi_hibernation_finish(void)
598{ 598{
599 hibernate_nvs_free(); 599 hibernate_nvs_free();
600 acpi_ec_resume_transactions(); 600 acpi_ec_unblock_transactions();
601 acpi_pm_finish(); 601 acpi_pm_finish();
602} 602}
603 603
@@ -619,12 +619,12 @@ static void acpi_hibernation_leave(void)
619 /* Restore the NVS memory area */ 619 /* Restore the NVS memory area */
620 hibernate_nvs_restore(); 620 hibernate_nvs_restore();
621 /* Allow EC transactions to happen. */ 621 /* Allow EC transactions to happen. */
622 acpi_ec_resume_transactions_early(); 622 acpi_ec_unblock_transactions_early();
623} 623}
624 624
625static void acpi_pm_thaw(void) 625static void acpi_pm_thaw(void)
626{ 626{
627 acpi_ec_resume_transactions(); 627 acpi_ec_unblock_transactions();
628 acpi_enable_all_runtime_gpes(); 628 acpi_enable_all_runtime_gpes();
629} 629}
630 630