From patchwork Fri Oct 7 05:08:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 9365597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6BCBA6075E for ; Fri, 7 Oct 2016 05:08:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59AC2292AA for ; Fri, 7 Oct 2016 05:08:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D506292EC; Fri, 7 Oct 2016 05:08:53 +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=-6.9 required=2.0 tests=BAYES_00,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 C1589292AA for ; Fri, 7 Oct 2016 05:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751798AbcJGFIw (ORCPT ); Fri, 7 Oct 2016 01:08:52 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:60925 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751627AbcJGFIv (ORCPT ); Fri, 7 Oct 2016 01:08:51 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OEN01JE4VMODQ20@mailout4.samsung.com> for linux-mmc@vger.kernel.org; Fri, 07 Oct 2016 14:08:48 +0900 (KST) X-AuditID: cbfee61a-f79786d000004c78-e6-57f72de0e3eb Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id 1C.23.19576.0ED27F75; Fri, 7 Oct 2016 14:08:48 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OEN00KJLVMO4F40@mmp1.samsung.com>; Fri, 07 Oct 2016 14:08:48 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, adrian.hunter@intel.com, Jaehoon Chung Subject: [PATCH] mmc: sdhci: put together into one condition checking Date: Fri, 07 Oct 2016 14:08:43 +0900 Message-id: <1475816923-24532-1-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrALMWRmVeSWpSXmKPExsVy+t9jAd0Hut/DDVq/i1icfLKGzeLGrzZW iyP/+xktjq8Nd2DxWLznJZPHnWt72Dz6tqxi9Pi8SS6AJcrNJiM1MSW1SCE1Lzk/JTMv3VYp NMRN10JJIS8xN9VWKULXNyRISaEsMacUyDMyQAMOzgHuwUr6dgluGZd7NrMU3OCv+PRsO1sD 43meLkZODgkBE4m/724xQ9hiEhfurWfrYuTiEBJYyiix6+oVFgjnB6NET9dTJpAqNgEdie3f joPZIgKyEj//XGADsZkFYiWmfTgMNklYwFVi15FtYHEWAVWJ2a/2sYDYvAJuErunXWOF2CYn cfLYZNYJjNwLGBlWMUqkFiQXFCel5xrmpZbrFSfmFpfmpesl5+duYgSH3jOpHYwHd7kfYhTg YFTi4Z2R8i1ciDWxrLgy9xCjBAezkgivgOr3cCHelMTKqtSi/Pii0pzU4kOMpkAHTGSWEk3O B8ZFXkm8oYm5ibmxgYW5paWJkZI4b+PsZ+FCAumJJanZqakFqUUwfUwcnFINjEcn9mgUhtnd /V6/cH68aOthRZsb4e9/znPur3o9e0X15TiGVWGOuxwte2+03lLi6eTSv9WuyyPrlKAQsPme hYGR3smLm5prlzbLPT45WcN6zxbp2XPzVk6/nL45uv3n3eNbU/OyTzbv+N4gpb1b8+7DpQ0i RWdf9/tedN+hEJxTs/2x4sQlS5RYijMSDbWYi4oTAYsAs+JTAgAA X-MTR: 20000000000000000@CPGS Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP value of ios->timing is not related with SDCHI v3.0. If Controller version is v3.0, SDHCI_QUIRK_NO_HISPD_BIT is meaningless. To prevent the setting wrong bit moves into one codntion checking. (e.g sdhci-s3c doesn't use SDHCI_CTRL_HISPD bit, instead using this bit as other purpose.) Signed-off-by: Jaehoon Chung Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 4805566..f854c66 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1619,7 +1619,14 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); if ((ios->timing == MMC_TIMING_SD_HS || - ios->timing == MMC_TIMING_MMC_HS) + ios->timing == MMC_TIMING_MMC_HS || + ios->timing == MMC_TIMING_MMC_HS400 || + ios->timing == MMC_TIMING_MMC_HS200 || + ios->timing == MMC_TIMING_MMC_DDR52 || + ios->timing == MMC_TIMING_UHS_SDR50 || + ios->timing == MMC_TIMING_UHS_SDR104 || + ios->timing == MMC_TIMING_UHS_DDR50 || + ios->timing == MMC_TIMING_UHS_SDR25) && !(host->quirks & SDHCI_QUIRK_NO_HISPD_BIT)) ctrl |= SDHCI_CTRL_HISPD; else @@ -1628,16 +1635,6 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (host->version >= SDHCI_SPEC_300) { u16 clk, ctrl_2; - /* In case of UHS-I modes, set High Speed Enable */ - if ((ios->timing == MMC_TIMING_MMC_HS400) || - (ios->timing == MMC_TIMING_MMC_HS200) || - (ios->timing == MMC_TIMING_MMC_DDR52) || - (ios->timing == MMC_TIMING_UHS_SDR50) || - (ios->timing == MMC_TIMING_UHS_SDR104) || - (ios->timing == MMC_TIMING_UHS_DDR50) || - (ios->timing == MMC_TIMING_UHS_SDR25)) - ctrl |= SDHCI_CTRL_HISPD; - if (!host->preset_enabled) { sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); /*