From patchwork Tue Jul 31 06:17:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai-Heng Feng X-Patchwork-Id: 10550117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 737A9157D for ; Tue, 31 Jul 2018 06:18:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60EDC2965C for ; Tue, 31 Jul 2018 06:18:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55510299FA; Tue, 31 Jul 2018 06:18:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAF232965C for ; Tue, 31 Jul 2018 06:18:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731512AbeGaH4N (ORCPT ); Tue, 31 Jul 2018 03:56:13 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:40391 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729284AbeGaH4N (ORCPT ); Tue, 31 Jul 2018 03:56:13 -0400 Received: from 1-161-146-33.dynamic-ip.hinet.net ([1.161.146.33] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkNyN-0004Wa-Cb; Tue, 31 Jul 2018 06:17:31 +0000 From: Kai-Heng Feng To: arnd@arndb.de, gregkh@linuxfoundation.org Cc: ulf.hansson@linaro.org, stern@rowland.harvard.edu, bauer.chen@realtek.com, ricky_wu@realtek.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Kai-Heng Feng Subject: [PATCH 1/5] misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection Date: Tue, 31 Jul 2018 14:17:17 +0800 Message-Id: <20180731061721.15831-2-kai.heng.feng@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180731061721.15831-1-kai.heng.feng@canonical.com> References: <20180731061721.15831-1-kai.heng.feng@canonical.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/misc/cardreader/rtsx_usb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/misc/cardreader/rtsx_usb.c b/drivers/misc/cardreader/rtsx_usb.c index b97903ff1a72..f7a66f614085 100644 --- a/drivers/misc/cardreader/rtsx_usb.c +++ b/drivers/misc/cardreader/rtsx_usb.c @@ -723,8 +723,15 @@ 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) +{ + pm_request_resume(dev); + return 0; +} + static int rtsx_usb_resume(struct usb_interface *intf) { + device_for_each_child(&intf->dev, NULL, rtsx_usb_resume_child); return 0; } @@ -734,6 +741,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, NULL, rtsx_usb_resume_child); return 0; }