diff options
| author | Alex Dubov <oakad@yahoo.com> | 2008-03-10 14:43:38 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-10 21:01:18 -0400 |
| commit | d114ad54ffb020dc781b6159c1c2f391c6ec418f (patch) | |
| tree | fbb4d6c263583bf3ec5de167124fd87cd28c2914 /drivers/memstick/core | |
| parent | e1f19995f55294fbb00ea22ba85d7b0d80ba3813 (diff) | |
memstick: add memstick_suspend/resume_host methods
Bus driver may need to be informed that host is being suspended/resumed.
Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/memstick/core')
| -rw-r--r-- | drivers/memstick/core/memstick.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c index 5e0e960df45..3c97bac4e47 100644 --- a/drivers/memstick/core/memstick.c +++ b/drivers/memstick/core/memstick.c | |||
| @@ -561,6 +561,31 @@ void memstick_free_host(struct memstick_host *host) | |||
| 561 | } | 561 | } |
| 562 | EXPORT_SYMBOL(memstick_free_host); | 562 | EXPORT_SYMBOL(memstick_free_host); |
| 563 | 563 | ||
| 564 | /** | ||
| 565 | * memstick_suspend_host - notify bus driver of host suspension | ||
| 566 | * @host - host to use | ||
| 567 | */ | ||
| 568 | void memstick_suspend_host(struct memstick_host *host) | ||
| 569 | { | ||
| 570 | mutex_lock(&host->lock); | ||
| 571 | host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF); | ||
| 572 | mutex_unlock(&host->lock); | ||
| 573 | } | ||
| 574 | EXPORT_SYMBOL(memstick_suspend_host); | ||
| 575 | |||
| 576 | /** | ||
| 577 | * memstick_resume_host - notify bus driver of host resumption | ||
| 578 | * @host - host to use | ||
| 579 | */ | ||
| 580 | void memstick_resume_host(struct memstick_host *host) | ||
| 581 | { | ||
| 582 | mutex_lock(&host->lock); | ||
| 583 | host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_ON); | ||
| 584 | mutex_unlock(&host->lock); | ||
| 585 | memstick_detect_change(host); | ||
| 586 | } | ||
| 587 | EXPORT_SYMBOL(memstick_resume_host); | ||
| 588 | |||
| 564 | int memstick_register_driver(struct memstick_driver *drv) | 589 | int memstick_register_driver(struct memstick_driver *drv) |
| 565 | { | 590 | { |
| 566 | drv->driver.bus = &memstick_bus_type; | 591 | drv->driver.bus = &memstick_bus_type; |
