lkml.org 
[lkml]   [2018]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/5] misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection
Date
Although rtsx_usb doesn't support card removal detection, card insertion
will resume rtsx_usb by USB remote wakeup signaling.

When rtsx_usb gets resumed, also resumes its child devices,
rtsx_usb_sdmmc and rtsx_usb_ms, to notify them there's a card in its
slot.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
drivers/misc/cardreader/rtsx_usb.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/misc/cardreader/rtsx_usb.c b/drivers/misc/cardreader/rtsx_usb.c
index b97903ff1a72..fed83453e5c5 100644
--- a/drivers/misc/cardreader/rtsx_usb.c
+++ b/drivers/misc/cardreader/rtsx_usb.c
@@ -723,8 +723,20 @@ static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message)
return 0;
}

+static int rtsx_usb_resume_child(struct device *dev, void *data)
+{
+ /* No need to wake up self again */
+ if (dev == data)
+ return 0;
+
+ dev_dbg(dev, "%s called\n", __func__);
+ pm_request_resume(dev);
+ return 0;
+}
+
static int rtsx_usb_resume(struct usb_interface *intf)
{
+ device_for_each_child(&intf->dev, &intf->dev, rtsx_usb_resume_child);
return 0;
}

@@ -734,6 +746,7 @@ static int rtsx_usb_reset_resume(struct usb_interface *intf)
(struct rtsx_ucr *)usb_get_intfdata(intf);

rtsx_usb_reset_chip(ucr);
+ device_for_each_child(&intf->dev, &intf->dev, rtsx_usb_resume_child);
return 0;
}

--
2.17.1
\
 
 \ /
  Last update: 2018-07-23 12:28    [W:0.066 / U:3.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site