From patchwork Thu May 26 12:12:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarthak Garg X-Patchwork-Id: 12862395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE74DC433F5 for ; Thu, 26 May 2022 12:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241395AbiEZMOv (ORCPT ); Thu, 26 May 2022 08:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230487AbiEZMOu (ORCPT ); Thu, 26 May 2022 08:14:50 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25A23B0A5E; Thu, 26 May 2022 05:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653567290; x=1685103290; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=muvrNAbA9KUhGpmb4Y3QN40P7gy4+uJmLvPE+pNb5js=; b=gm26l0gp/eFjQXG1qf0vvX7OWwqbpNsm6G0gBQtizP3mqXWAnZ3HVWG6 5LSuEAMDZFozl3mdunEDDCQRCr6NBKA2OFlgt2qiOYWzzqbY2MQmL2U/o ScbgjU3xlXdqfPwcvHcdtcwcfWDKnXZ+Rc+XTrtj1VTrRjEUzMAXJJYi6 Q=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 26 May 2022 05:14:50 -0700 X-QCInternal: smtphost Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 26 May 2022 05:14:48 -0700 X-QCInternal: smtphost Received: from hu-sartgarg-hyd.qualcomm.com (HELO hu-maiyas-hyd.qualcomm.com) ([10.213.105.147]) by ironmsg01-blr.qualcomm.com with ESMTP; 26 May 2022 17:44:44 +0530 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2339771) id 242BA5001B7; Thu, 26 May 2022 17:44:43 +0530 (+0530) From: Sarthak Garg To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, quic_kamasali@quicinc.com, quic_rampraka@quicinc.com, quic_pragalla@quicinc.com, quic_sayalil@quicinc.com, Sarthak Garg , Andy Gross , Bjorn Andersson Subject: [PATCH V2 2/2] mmc: sdhci-msm: Add wakeup functionality to sdio cards Date: Thu, 26 May 2022 17:42:15 +0530 Message-Id: <20220526121215.25947-3-quic_sartgarg@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220526121215.25947-1-quic_sartgarg@quicinc.com> References: <20220526121215.25947-1-quic_sartgarg@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This patch initializes wakeup source if the detected card is a sdio card and enables the wakeup capability. Signed-off-by: Sarthak Garg --- drivers/mmc/host/sdhci-msm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index e395411fb6fd..3bfc506e5c45 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -2376,6 +2376,18 @@ static int sdhci_msm_start_signal_voltage_switch(struct mmc_host *mmc, return -EAGAIN; } +static void sdhci_msm_card_init_wakeup(struct mmc_card *card) +{ + int ret; + + if (mmc_card_sdio(card)) { + ret = device_init_wakeup(&card->dev, true); + if (ret) + pr_err("%s: %s: failed to init wakeup: %d\n", + mmc_hostname(card->host), __func__, ret); + } +} + #define DRIVER_NAME "sdhci_msm" #define SDHCI_MSM_DUMP(f, x...) \ pr_err("%s: " DRIVER_NAME ": " f, mmc_hostname(host->mmc), ## x) @@ -2794,6 +2806,8 @@ static int sdhci_msm_probe(struct platform_device *pdev) host->mmc_host_ops.start_signal_voltage_switch = sdhci_msm_start_signal_voltage_switch; host->mmc_host_ops.execute_tuning = sdhci_msm_execute_tuning; + host->mmc_host_ops.card_init_wakeup = sdhci_msm_card_init_wakeup; + if (of_property_read_bool(node, "supports-cqe")) ret = sdhci_msm_cqe_add_host(host, pdev); else