aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/memstick
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/memstick')
-rw-r--r--drivers/memstick/core/memstick.c25
-rw-r--r--drivers/memstick/host/tifm_ms.c8
2 files changed, 29 insertions, 4 deletions
diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c
index 5e0e960df456..3c97bac4e47b 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}
562EXPORT_SYMBOL(memstick_free_host); 562EXPORT_SYMBOL(memstick_free_host);
563 563
564/**
565 * memstick_suspend_host - notify bus driver of host suspension
566 * @host - host to use
567 */
568void 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}
574EXPORT_SYMBOL(memstick_suspend_host);
575
576/**
577 * memstick_resume_host - notify bus driver of host resumption
578 * @host - host to use
579 */
580void 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}
587EXPORT_SYMBOL(memstick_resume_host);
588
564int memstick_register_driver(struct memstick_driver *drv) 589int memstick_register_driver(struct memstick_driver *drv)
565{ 590{
566 drv->driver.bus = &memstick_bus_type; 591 drv->driver.bus = &memstick_bus_type;
diff --git a/drivers/memstick/host/tifm_ms.c b/drivers/memstick/host/tifm_ms.c
index 5b5bd61b3a4a..8b1c102fc317 100644
--- a/drivers/memstick/host/tifm_ms.c
+++ b/drivers/memstick/host/tifm_ms.c
@@ -627,17 +627,17 @@ static void tifm_ms_remove(struct tifm_dev *sock)
627 627
628static int tifm_ms_suspend(struct tifm_dev *sock, pm_message_t state) 628static int tifm_ms_suspend(struct tifm_dev *sock, pm_message_t state)
629{ 629{
630 struct memstick_host *msh = tifm_get_drvdata(sock);
631
632 memstick_suspend_host(msh);
630 return 0; 633 return 0;
631} 634}
632 635
633static int tifm_ms_resume(struct tifm_dev *sock) 636static int tifm_ms_resume(struct tifm_dev *sock)
634{ 637{
635 struct memstick_host *msh = tifm_get_drvdata(sock); 638 struct memstick_host *msh = tifm_get_drvdata(sock);
636 struct tifm_ms *host = memstick_priv(msh);
637
638 tifm_ms_initialize_host(host);
639 memstick_detect_change(msh);
640 639
640 memstick_resume_host(msh);
641 return 0; 641 return 0;
642} 642}
643 643