From patchwork Sat Apr 1 16:57:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarthak Garg X-Patchwork-Id: 78150 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1338152vqo; Sat, 1 Apr 2023 10:07:55 -0700 (PDT) X-Google-Smtp-Source: AKy350aOAZHRMiDCZasu2XHEVtOq/keHvrlfXa2jPkRfTgHMucgvSZ1Q2SgLMfbvT0wIMU+O04YZ X-Received: by 2002:a17:907:986c:b0:946:2fa6:3b85 with SMTP id ko12-20020a170907986c00b009462fa63b85mr16409867ejc.36.1680368875718; Sat, 01 Apr 2023 10:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680368875; cv=none; d=google.com; s=arc-20160816; b=AIu3fo/WZERYOi4/xcnfcDQXghQnRfQaK46DyObXKwql8kkTc7H0zudRPPRDeBKgZF DLf3gU+eH9CfKqzEz9XrGqzLTjVgDebG9UdAuYjTE8j8G1kRSY8IjWg47ZEmQABppEgu 4cFucpG1G0Css2PXXvCHEglJyflEbxiRlOpEJK32KzGLYPaaUlMUn2EANJIzitrNb4D0 yYFk4yvTwdtRMELQL53fm6UIo+l/XLXE/tH67F4o+4gK43OMfQ04hxZDO1vqK398irWB hRWVijgZy+jRheIJ/RreW0ZkOwBzvzwvAS0qkjJ4qu6iHCbcoOBAd9wDgZVNRDe3gtTB h6Iw== 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=/J7nB6tRhFWnlakZKY5xt/+LvOcnxSh8PjWBMVdUn9k=; b=Ds+4NTBw8QiEQV+aXCbY1vrSIgTD3/3ZMAnUAfjtkxXmtZoTHmQ+54DC/vWegv7BZ+ fPQFr3DeQphYoxgvosOLMUpSX5pRm6Hj7RE1LS1alHpSKPD23/RVNLnPW8NcS/I9CAxj 4Y9Zsjc5AVO0ZxV2UAmHKW5B9bk3fEfSO/u1wC/eadFIzc/V91conKev+4EtM+OfuUTL vnOrtXVErHAvQ1HsAejmvZaL2THJChoJd9iXgbUPRG1iSMYcp2wJPyvOIHz0SVNzEXdE Op2o+jkAnwBzFoZ4EvYlYN1I1DTocplYs+uRm3YJK8srFVDU0tpxhW1sCphqg2m0StQG ZVYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=EwjWgQov; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020aa7dcc4000000b00501dffe7dc3si4827441edu.248.2023.04.01.10.07.32; Sat, 01 Apr 2023 10:07: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=qcppdkim1 header.b=EwjWgQov; 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 S229970AbjDAQ5o (ORCPT + 99 others); Sat, 1 Apr 2023 12:57:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjDAQ5m (ORCPT ); Sat, 1 Apr 2023 12:57:42 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05B671D2C6; Sat, 1 Apr 2023 09:57:41 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 331DoJbc009781; Sat, 1 Apr 2023 16:57:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=/J7nB6tRhFWnlakZKY5xt/+LvOcnxSh8PjWBMVdUn9k=; b=EwjWgQovOl9vsJ8Y2D11UKY7lVPhxhhmHCd1Ih6mv8ZhAViN0Tw216T5fwGIKkYG9p5g W3UTRTWU73Ld5m2QpVzqUC/9CRf+qdFwCZycm6g4yYbTdPd9mB/Y7FiNUNt4gIz3+Aa1 yVjwSSa0gxZKSbkDVDTvBuSyg/bf3SHfWYBbx+Y5dU1Xd+LrZoSuySUfVLA8easgBwaN RxFNJe+KqA1AqiEIT2kG+8tdphkkEHwNqiotJHgNrGyVTHgrSSWrIIJbuHEZQXQRXXgC iForCv8gGRYfdsypbXwI1ad04gfxaJCewiQ7D+K6LZhIICf/9xKqt2hLHjEbqHQukl5K aw== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ppcq3h2e4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Apr 2023 16:57:36 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 331GvXiu006703; Sat, 1 Apr 2023 16:57:33 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3ppdpk2ueb-1; Sat, 01 Apr 2023 16:57:33 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 331GvXoD006697; Sat, 1 Apr 2023 16:57:33 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-sartgarg-hyd.qualcomm.com [10.213.105.147]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 331GvXOi006693; Sat, 01 Apr 2023 16:57:33 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2339771) id 59D2F504928; Sat, 1 Apr 2023 22:27:32 +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_rampraka@quicinc.com, quic_bhaskarv@quicinc.com, quic_sachgupt@quicinc.com, quic_pragalla@quicinc.com, quic_sayalil@quicinc.com, Sarthak Garg , Brian Norris , Wolfram Sang , Linus Walleij Subject: [PATCH V1 1/2] mmc: core: Define new vendor ops to enable internal features Date: Sat, 1 Apr 2023 22:27:22 +0530 Message-Id: <20230401165723.19762-2-quic_sartgarg@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230401165723.19762-1-quic_sartgarg@quicinc.com> References: <20230401165723.19762-1-quic_sartgarg@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: OZciZy35ebSXZTpC_PNebCEcRxk1vUW_ X-Proofpoint-ORIG-GUID: OZciZy35ebSXZTpC_PNebCEcRxk1vUW_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-31_07,2023-03-31_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxlogscore=723 adultscore=0 clxscore=1011 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304010154 X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761994474217774893?= X-GMAIL-MSGID: =?utf-8?q?1761994474217774893?= Define new ops to let vendor enable internal features in mmc_suspend/resume paths like partial init feature. Signed-off-by: Sarthak Garg --- drivers/mmc/core/mmc.c | 13 ++++++++++--- include/linux/mmc/host.h | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 89cd48fcec79..32386e4644df 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -2112,9 +2112,11 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) ((host->caps2 & MMC_CAP2_FULL_PWR_CYCLE) || !is_suspend || (host->caps2 & MMC_CAP2_FULL_PWR_CYCLE_IN_SUSPEND))) err = mmc_poweroff_notify(host->card, notify_type); - else if (mmc_can_sleep(host->card)) + else if (mmc_can_sleep(host->card)) { + if (host->ops->cache_card_properties) + host->ops->cache_card_properties(host); err = mmc_sleep(host); - else if (!mmc_host_is_spi(host)) + } else if (!mmc_host_is_spi(host)) err = mmc_deselect_cards(host); if (!err) { @@ -2149,6 +2151,7 @@ static int mmc_suspend(struct mmc_host *host) static int _mmc_resume(struct mmc_host *host) { int err = 0; + bool partial_init_success = false; mmc_claim_host(host); @@ -2156,7 +2159,11 @@ static int _mmc_resume(struct mmc_host *host) goto out; mmc_power_up(host, host->card->ocr); - err = mmc_init_card(host, host->card->ocr, host->card); + + if (host->ops->partial_init_card) + partial_init_success = host->ops->partial_init_card(host); + if (!partial_init_success) + err = mmc_init_card(host, host->card->ocr, host->card); mmc_card_clr_suspended(host->card); out: diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 461d1543893b..0a796a34b83d 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -212,6 +212,10 @@ 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); + + void (*cache_card_properties)(struct mmc_host *host); + bool (*partial_init_card)(struct mmc_host *host); + }; struct mmc_cqe_ops { From patchwork Sat Apr 1 16:57:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarthak Garg X-Patchwork-Id: 78149 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1337892vqo; Sat, 1 Apr 2023 10:07:28 -0700 (PDT) X-Google-Smtp-Source: AKy350YJ1y4mGRa3+eowJFV6ZKsIX/n4brS3lwd00A9A7Ic2Hm049WFIGYVf3eIZSfGUvH4STek5 X-Received: by 2002:aa7:c790:0:b0:4fc:d837:2c44 with SMTP id n16-20020aa7c790000000b004fcd8372c44mr27692479eds.35.1680368848227; Sat, 01 Apr 2023 10:07:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680368848; cv=none; d=google.com; s=arc-20160816; b=idaiWGKoXdXRxvjQb1bw9bzE1fPJCJwlLyl0yq7Rgt2VlOxNf4EB7o7lFjTDcsu4Xa AyZ2CmN9H0W/UeqcSdkF9CCszzkXadRm4/7sOsP6YyfFZN/cmvfFJ5C8xUj+yoEh9a8z lAxNtbWeqy6Vw1geceBh8tMbZxanvgEzrezNUn9lW1dngGI2deeuycveTtB9EhKgos5o 7wKRmKHX9kPX+TU8damGZWaL1HL73G/qVaR2omuyOUCYRdgje7kR63M0LwgukQu52YiZ 7S2BKnQB+2xzI2opGsojxgbpNQo29fZmY62OKxaCK1iWKAWFIUJXFaGbdVdQ8pW9uxEE pycA== 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=kO0AaTsdO0F707hnDYDMtznkjiKFYiD5tu5F7PAj02o=; b=niSTqE6LG4pvcmTgyfzZJCSoIP8SvFqM2Ja1DVVaYAp9mxYwxaPHm8l6XRpZn5j9o8 njXpvkfaLXXywXEHqlevt3lsFm1s73gDx123OLBZPdY8Q1HD+ULb0l6DMlRbA43Ihuws aY2i+hIV4CPSpkplNiG7QERyh2wz5PLnO9V+l3Fejf1VuTiWzPy/Jc8ilx6wVyfHbHpd +tyK+H5EgduUd63KS8FFEBMcUydiksXjwJ7VDFLaHAIIIbjX6JAFoAUR0HRNNdjvCyRr +02hjvNR/UvEoJnblbEqaUWuAuRTh8A/m7yYhGDu2Dr9Eftfr/t2kCniK7PDDYyaFKoP bGiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=O2xIW4y5; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a3-20020aa7cf03000000b004fb506ae6bfsi2065257edy.247.2023.04.01.10.07.03; Sat, 01 Apr 2023 10:07:28 -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=qcppdkim1 header.b=O2xIW4y5; 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 S229985AbjDARAd (ORCPT + 99 others); Sat, 1 Apr 2023 13:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjDARAb (ORCPT ); Sat, 1 Apr 2023 13:00:31 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C5809018; Sat, 1 Apr 2023 10:00:30 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 331GiHY9029723; Sat, 1 Apr 2023 16:57:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=qcppdkim1; bh=kO0AaTsdO0F707hnDYDMtznkjiKFYiD5tu5F7PAj02o=; b=O2xIW4y5vN3Vz6uHur634oRVJiYhCcypS+6uPim0GU6z3s0i72KHBTbZLXJURKuoL1Lx N1zH+X1hRvv/5eMocjxCM5o2M7t3NqsiuREgztWj26aBlI4x3MgTiLwluxhRlRm/MH8Z jzWR5vAbuaI4570v0aVtFlEbAJr5VVUvzJEBbjPH4+XFt5MrdiPt8t3mRxcvetp0uJv7 fYGDfLJPg2VJa93/+T9AlhmCPED6UX2YC4w5bVWdV54xOusbmCPQbo/GK/gqmXsB7/Q2 xXL/e5Ux/BXuMYsroWzZJVGgWbdN9PlsNPL9ucqTeBqaHB7ly6DbQOSyAbqDGjEaaVnU 7A== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ppcq3h2eb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 01 Apr 2023 16:57:49 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 331GvkLd007088; Sat, 1 Apr 2023 16:57:46 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 3ppdpk2ufb-1; Sat, 01 Apr 2023 16:57:46 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 331GvkdJ007014; Sat, 1 Apr 2023 16:57:46 GMT Received: from hu-maiyas-hyd.qualcomm.com (hu-sartgarg-hyd.qualcomm.com [10.213.105.147]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTP id 331GvkJe006988; Sat, 01 Apr 2023 16:57:46 +0000 Received: by hu-maiyas-hyd.qualcomm.com (Postfix, from userid 2339771) id 6F386504928; Sat, 1 Apr 2023 22:27:45 +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_rampraka@quicinc.com, quic_bhaskarv@quicinc.com, quic_sachgupt@quicinc.com, quic_pragalla@quicinc.com, quic_sayalil@quicinc.com, Sarthak Garg , Wolfram Sang , Kees Cook , "Jason A. Donenfeld" , =?utf-8?q?Christian_L=C3=B6hle?= , Yann Gautier , ChanWoo Lee , Shaik Sajida Bhanu , Heiner Kallweit , Ye Bin , Alexander Stein , Yu Zhe , Yang Yingliang , Brian Norris , Linus Walleij , Jens Axboe , "Martin K. Petersen" , Vincent Whitchurch , David Sterba , John Garry Subject: [PATCH V1 2/2] mmc: core: Export core functions to let vendors use for their features Date: Sat, 1 Apr 2023 22:27:23 +0530 Message-Id: <20230401165723.19762-3-quic_sartgarg@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230401165723.19762-1-quic_sartgarg@quicinc.com> References: <20230401165723.19762-1-quic_sartgarg@quicinc.com> X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: gHQ1LSsFIB8xHEmZlHFJ_fd91KlJYc5g X-Proofpoint-ORIG-GUID: gHQ1LSsFIB8xHEmZlHFJ_fd91KlJYc5g X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-31_07,2023-03-31_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 clxscore=1011 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304010154 X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_NONE,SPF_NONE autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761994445167046231?= X-GMAIL-MSGID: =?utf-8?q?1761994445167046231?= Export core functions to let vendors use for their internal features. Signed-off-by: Sarthak Garg --- drivers/mmc/core/core.c | 6 ++++++ drivers/mmc/core/host.c | 1 + drivers/mmc/core/mmc.c | 18 ++++++++++++------ drivers/mmc/core/mmc_ops.c | 1 + drivers/mmc/core/queue.c | 1 + 5 files changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 3d3e0ca52614..ed44b65f19e0 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -916,6 +916,7 @@ void mmc_set_clock(struct mmc_host *host, unsigned int hz) host->ios.clock = hz; mmc_set_ios(host); } +EXPORT_SYMBOL_GPL(mmc_set_clock); int mmc_execute_tuning(struct mmc_card *card) { @@ -950,6 +951,7 @@ int mmc_execute_tuning(struct mmc_card *card) return err; } +EXPORT_SYMBOL_GPL(mmc_execute_tuning); /* * Change the bus mode (open drain/push-pull) of a host. @@ -959,6 +961,7 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode) host->ios.bus_mode = mode; mmc_set_ios(host); } +EXPORT_SYMBOL_GPL(mmc_set_bus_mode); /* * Change data bus width of a host. @@ -968,6 +971,7 @@ void mmc_set_bus_width(struct mmc_host *host, unsigned int width) host->ios.bus_width = width; mmc_set_ios(host); } +EXPORT_SYMBOL_GPL(mmc_set_bus_width); /* * Set initial state after a power cycle or a hw_reset. @@ -1001,6 +1005,7 @@ void mmc_set_initial_state(struct mmc_host *host) mmc_crypto_set_initial_state(host); } +EXPORT_SYMBOL_GPL(mmc_set_initial_state); /** * mmc_vdd_to_ocrbitnum - Convert a voltage to the OCR bit number @@ -1270,6 +1275,7 @@ void mmc_set_timing(struct mmc_host *host, unsigned int timing) host->ios.timing = timing; mmc_set_ios(host); } +EXPORT_SYMBOL_GPL(mmc_set_timing); /* * Select appropriate driver type for host. diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 76900f67c782..1c5eb1d9d585 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -166,6 +166,7 @@ void mmc_retune_hold(struct mmc_host *host) host->retune_now = 1; host->hold_retune += 1; } +EXPORT_SYMBOL(mmc_retune_hold); void mmc_retune_release(struct mmc_host *host) { diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 32386e4644df..b984a4f90535 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1002,7 +1002,7 @@ static void mmc_set_bus_speed(struct mmc_card *card) * If the bus width is changed successfully, return the selected width value. * Zero is returned instead of error value if the wide width is not supported. */ -static int mmc_select_bus_width(struct mmc_card *card) +int mmc_select_bus_width(struct mmc_card *card) { static unsigned ext_csd_bits[] = { EXT_CSD_BUS_WIDTH_8, @@ -1067,11 +1067,12 @@ static int mmc_select_bus_width(struct mmc_card *card) return err; } +EXPORT_SYMBOL_GPL(mmc_select_bus_width); /* * Switch to the high-speed mode */ -static int mmc_select_hs(struct mmc_card *card) +int mmc_select_hs(struct mmc_card *card) { int err; @@ -1085,11 +1086,12 @@ static int mmc_select_hs(struct mmc_card *card) return err; } +EXPORT_SYMBOL_GPL(mmc_select_hs); /* * Activate wide bus and DDR if supported. */ -static int mmc_select_hs_ddr(struct mmc_card *card) +int mmc_select_hs_ddr(struct mmc_card *card) { struct mmc_host *host = card->host; u32 bus_width, ext_csd_bits; @@ -1158,8 +1160,9 @@ static int mmc_select_hs_ddr(struct mmc_card *card) return err; } +EXPORT_SYMBOL_GPL(mmc_select_hs_ddr); -static int mmc_select_hs400(struct mmc_card *card) +int mmc_select_hs400(struct mmc_card *card) { struct mmc_host *host = card->host; unsigned int max_dtr; @@ -1253,6 +1256,7 @@ static int mmc_select_hs400(struct mmc_card *card) __func__, err); return err; } +EXPORT_SYMBOL_GPL(mmc_select_hs400); int mmc_hs200_to_hs400(struct mmc_card *card) { @@ -1533,7 +1537,7 @@ static int mmc_select_hs200(struct mmc_card *card) /* * Activate High Speed, HS200 or HS400ES mode if supported. */ -static int mmc_select_timing(struct mmc_card *card) +int mmc_select_timing(struct mmc_card *card) { int err = 0; @@ -1568,12 +1572,13 @@ static int mmc_select_timing(struct mmc_card *card) mmc_set_bus_speed(card); return 0; } +EXPORT_SYMBOL_GPL(mmc_select_timing); /* * Execute tuning sequence to seek the proper bus operating * conditions for HS200 and HS400, which sends CMD21 to the device. */ -static int mmc_hs200_tuning(struct mmc_card *card) +int mmc_hs200_tuning(struct mmc_card *card) { struct mmc_host *host = card->host; @@ -1588,6 +1593,7 @@ static int mmc_hs200_tuning(struct mmc_card *card) return mmc_execute_tuning(card); } +EXPORT_SYMBOL_GPL(mmc_hs200_tuning); /* * Handle the detection and initialisation of a card. diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 3b3adbddf664..62c16dac9d62 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -118,6 +118,7 @@ int mmc_select_card(struct mmc_card *card) return _mmc_select_card(card->host, card); } +EXPORT_SYMBOL_GPL(mmc_select_card); int mmc_deselect_cards(struct mmc_host *host) { diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index b396e3900717..2c710d736032 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -69,6 +69,7 @@ enum mmc_issue_type mmc_issue_type(struct mmc_queue *mq, struct request *req) return MMC_ISSUE_SYNC; } +EXPORT_SYMBOL_GPL(mmc_issue_type); static void __mmc_cqe_recovery_notifier(struct mmc_queue *mq) {