Skip to content

Commit 883a87d

Browse files
khfengstorulf
authored andcommitted
misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection
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> Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 01a7e8e commit 883a87d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/misc/cardreader/rtsx_usb.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,15 @@ static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message)
723723
return 0;
724724
}
725725

726+
static int rtsx_usb_resume_child(struct device *dev, void *data)
727+
{
728+
pm_request_resume(dev);
729+
return 0;
730+
}
731+
726732
static int rtsx_usb_resume(struct usb_interface *intf)
727733
{
734+
device_for_each_child(&intf->dev, NULL, rtsx_usb_resume_child);
728735
return 0;
729736
}
730737

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

736743
rtsx_usb_reset_chip(ucr);
744+
device_for_each_child(&intf->dev, NULL, rtsx_usb_resume_child);
737745
return 0;
738746
}
739747

0 commit comments

Comments
 (0)