From patchwork Fri Mar 26 11:02:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 12166389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19870C433E0 for ; Fri, 26 Mar 2021 11:04:16 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A8BCF61A0F for ; Fri, 26 Mar 2021 11:04:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8BCF61A0F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/HHP+cWiWXtm334nouC3xK8Woy5z4rjyWY9iTkoFrrE=; b=mz0M6K+PW040A2P2dnhRTTXPy+ 0+IYU8x0UfLB01El4LhwiO460w+GF6nShfHPR3C1Nrxwqe18IDrN8Ph8+WYiKnir9TpkB4IJCsJoZ 4tZg/a7wY7XZNct0DdX/ZWCd+JTW8X34zb2A5jU9fcq5X/4yqiniZpe6syVrrkPk4CYrJlWh11KAd 9vDJpN42LWfRLtCN+87fpG+AHj6j9IgVs72r0z5+wV60GWhP6fkfGSH4bWjDN27Ow+Z+O7StSxK94 19foMIf38jl8gtHGb+E3dK6FeXt9kpeOdUjU3v9GMLaz3CYivQMQ9ymvkKvr2Btx0xWesWG/ASkZG mRd2/ZkQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPkEa-003NIF-Ec; Fri, 26 Mar 2021 11:02:32 +0000 Received: from mail-pf1-f171.google.com ([209.85.210.171]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPkEV-003NHC-51 for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 11:02:29 +0000 Received: by mail-pf1-f171.google.com with SMTP id c204so4647797pfc.4 for ; Fri, 26 Mar 2021 04:02:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=rumfRvhUhVyWj59sOnuaUTFipCqEyTwMs3xoCRgrClA=; b=CTLgJyzGkghS6JTaVAchGbARPdGZgBgY+tRI4XR4GfT0tlkVrdCfFG6O1Tx966r+c3 0hDVjtIGxCzErcpMWbYu0YpyZ3OyPNWjF5BWKQz3Kcozl09uxcOfJsH7cU17U+ze6SQW Ny1sZFpHZZg5604IisL4SRvsyO1Bvi5XNBrrUpBbYLNM8D9mP4Vnb9WjzAwLEYxalVsZ JwfgZRlOP7CqZWNWgj8cqE7cox5MgrfV/YG8/p0oUU4ZIIqlhWItNPOe2aQgjgiZGNHi uQfKvq4fOgexr8eRiW2Bl1JQiivIiEauMeJ1LwBaTAtSPI5P3xAHOafO+L61HS0WuPt8 gAoA== X-Gm-Message-State: AOAM533ftjKoCFDFCesOfsXJO+3WOX6FE7zpkl/EHz9ZnWlwmmqq/Oxn d8eKmjn7uqkPY7IEQdMemyt2mQ== X-Google-Smtp-Source: ABdhPJz4hhWiURI73CG1edc9x87HhwvY+cn1dgGBvb7rky7Y5ER1ntb0nbUUWamBm5AB5rrCD56izg== X-Received: by 2002:a63:7a07:: with SMTP id v7mr11429029pgc.26.1616756544679; Fri, 26 Mar 2021 04:02:24 -0700 (PDT) Received: from localhost.localdomain (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id i13sm8092521pgi.3.2021.03.26.04.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 04:02:24 -0700 (PDT) From: Shawn Guo To: Adrian Hunter , Ulf Hansson Cc: Haibo Chen , Dong Aisheng , Pengutronix Kernel Team , NXP Linux Team , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Shawn Guo Subject: [PATCH] mmc: sdhci-esdhc-imx: separate 100/200 MHz pinctrl states check Date: Fri, 26 Mar 2021 19:02:14 +0800 Message-Id: <20210326110214.28416-1-shawnguo@kernel.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210326_110227_817558_A982E6B0 X-CRM114-Status: GOOD ( 10.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Shawn Guo As indicated by function esdhc_change_pinstate(), SDR50 and DDR50 require pins_100mhz, while SDR104 and HS400 require pins_200mhz. Some system design may support SDR50 and DDR50 with 100mhz pin state only (without 200mhz one). Currently the combined 100/200 MHz pinctrl state check prevents such system from running SDR50 and DDR50. Separate the check to support such system design. Signed-off-by: Shawn Guo Reviewed-by: Haibo Chen --- drivers/mmc/host/sdhci-esdhc-imx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index a20459744d21..aa45901325b9 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -434,10 +434,10 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg) * Do not advertise faster UHS modes if there are no * pinctrl states for 100MHz/200MHz. */ - if (IS_ERR_OR_NULL(imx_data->pins_100mhz) || - IS_ERR_OR_NULL(imx_data->pins_200mhz)) - val &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50 - | SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_HS400); + if (IS_ERR_OR_NULL(imx_data->pins_100mhz)) + val &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50); + if (IS_ERR_OR_NULL(imx_data->pins_200mhz)) + val &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_HS400); } }