Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp687915ioo; Thu, 26 May 2022 12:15:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3eA5HByexWtLSqUl7fBf3HmFOVVg0fJNVe2A4AWbYHgdKgJHJe2DHq1vJmC1225ym2zWg X-Received: by 2002:a05:6402:1c0f:b0:42a:e889:c9d0 with SMTP id ck15-20020a0564021c0f00b0042ae889c9d0mr41826106edb.18.1653592555047; Thu, 26 May 2022 12:15:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653592555; cv=none; d=google.com; s=arc-20160816; b=zTO+LoxZsrdNQRbfIF7Ws0KA7m3GvIwq9s3+Q4PWZe7b3Gq42KEosp4vllzZqpEWOm ebhqOajzaxmJHVyBMSg/il4jt1/46fQflsQOtQJZFwz+/HdN3oFNO9Cy9eWpQU8LRtCd jsP2w32lDFQclLsEkC9aMZ543m4BpTlKhn+TJ6X2ATC9wfFtOpZAsBRWs3ZzuUqE+dF1 Ud9VZo116CdBIpX2oMWuT3qpSywxtO/4euXBNF7QPEc5r9BM/IQiww6amnTez7CkLOzY tsofRqdANstpd9lyr6LfBqe1UTYQRa56eNoGmFqnlFHeoyAZmIYm7pktBGfvWKs0bCtX YF1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=UYtPQVApD7B6CvdbviLsjmzrkXFvYphc+Nw0S1+fXwA=; b=QHKXOvXAMr1ZLMOO2oqrxh/DxuACXzhR42qOjDl9dl4eIRSeUJmv8y7zujBxh/8Yt8 DTOmm44cXSTMqf2kMJ9yV0RyTgS+lLZdzPkuGgm23gEgzadt1OpUD1/hs35gouF2/6ZD 1fJAyk4ZLvAVmVbDpksMg8qs4ngOz17EpBXqi7Al9cVbYpQOJdrD8oWmdtDbO2D3NtuN izqZIHptNl0kXulQmcZNRKRjg9BA+V3bWKC5V8jyrQJHSo031XdvNrQwdOQ5Dk1X0IDG HeMWnPPcdP5Ee9weeyNXxG/EteZEszAhT8op3Agokk1QjO1/QUIRfS3sAZzw5TaMih29 nk7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="ClHU2Mn/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go32-20020a1709070da000b006fe5cf7e3b3si2606770ejc.451.2022.05.26.12.15.25; Thu, 26 May 2022 12:15:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="ClHU2Mn/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345535AbiEZMNq (ORCPT + 99 others); Thu, 26 May 2022 08:13:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230487AbiEZMNp (ORCPT ); Thu, 26 May 2022 08:13:45 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B69DB0A5E; Thu, 26 May 2022 05:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1653567224; x=1685103224; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=UYtPQVApD7B6CvdbviLsjmzrkXFvYphc+Nw0S1+fXwA=; b=ClHU2Mn/cBEeaFQCIdv82Htowf4MnSb/7Ti6HQJwkPcDMyfqJh1W8c5+ Vpcl6x47vWE3peSsLvUJK61hEh1cPu7qPimjVX+cCDNmDRUhixIyKOBmy kP2+gTTF6c49T5/WwytYAXAsG46/0SLW1sGF8+vyiK8T9pBRt4wmP3k2S I=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 26 May 2022 05:13:44 -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:13:43 -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:43:35 +0530 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2339771) id 38B525001B7; Thu, 26 May 2022 17:43:34 +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 , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Thorsten Scherer , Sergey Shtylyov , Dmitry Torokhov , lizhe Subject: [PATCH V2 1/2] mmc: core: Define a new vendor ops to enable wakeup capability Date: Thu, 26 May 2022 17:42:14 +0530 Message-Id: <20220526121215.25947-2-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> X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Define a new vendor ops to let vendor initialize card as wakeup source and enable wakeup capability specially for SDIO cards which supports waking host from system suspend through external dedicated pins. Signed-off-by: Sarthak Garg --- drivers/mmc/core/bus.c | 3 +++ include/linux/mmc/host.h | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 58a60afa650b..6192a52288fd 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -364,6 +364,9 @@ int mmc_add_card(struct mmc_card *card) #endif card->dev.of_node = mmc_of_find_child_device(card->host, 0); + if (card->host->ops->card_init_wakeup) + card->host->ops->card_init_wakeup(card); + device_enable_async_suspend(&card->dev); ret = device_add(&card->dev); diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index c193c50ccd78..3bd4374a64b8 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -193,6 +193,13 @@ struct mmc_host_ops { /* Initialize an SD express card, mandatory for MMC_CAP2_SD_EXP. */ int (*init_sd_express)(struct mmc_host *host, struct mmc_ios *ios); + + /* + * Optional for vendor to initialize card as wakeup source and + * enable wakeup capability specially for SDIO cards which supports + * waking host from suspend through external dedicated pins. + */ + void (*card_init_wakeup)(struct mmc_card *card); }; struct mmc_cqe_ops { -- 2.17.1