From patchwork Fri Nov 24 16:24:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119615 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2448080qgn; Fri, 24 Nov 2017 08:31:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMbOG0JbSJUQDomY7JrcdBs/m6sXywrSljXWjsvjOKWHVSfOnGOZGpKcmQzpOX+/Ldiv70Hg X-Received: by 10.98.237.20 with SMTP id u20mr27584423pfh.237.1511541080818; Fri, 24 Nov 2017 08:31:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511541080; cv=none; d=google.com; s=arc-20160816; b=U5WtbBttoIhF7WLCzOhxYTtEPlZfOctbV50hXcuHD4dhoc2YSeSpYJFB776mqdQaTy dCSzYyRDJQP9IM2k62ad5D1nU8GlHTK/WFlNNhbFEr3fLaa43HOiMm84lYjaJnGQZq+z b93LOJuHoF00j98yHCqQ2BG2PD7dLg4LnexLQa9Jrrh1n8eV81+T4a/6k/4EfKBHHS97 IdKc3O/z5PbwtK+NXRm/3UYfTmwIY7cb5bAY1SJ5AZUWM8HRdx4H1yietge5IuNU7ymN RfmlO04EOlKIOgQz1WF5gPsU8Knkvsuj7fpd9kcLNmrzlGmc6kB7MXnk/lQO1LhNwPyD dmRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=7gh/BwoDNaM740wyV1jAK1rltJtQpQ5MuljXKGx1Qxc=; b=mGgR6fGXQJDmiv+lsn7gl1ts/dHPXVB2V3hk/ZA2vNr6gbNR+qV3NXXahNxtHwv6a6 MTnyawtTPLtlFfhLpafGw4inJNqJag5O/1ZW3R63RpAUPpF0WX59qYZAK18eualgGUaw qZeUFIz19yNvfYakePwN+6GCJHPMjwdmmDv712QWwdcIPrdT+47j3noRsdCGx3thd2tc /N6CvXHCsoLyV560UPj4I2LGWNeDB1AbAvH0L6i85d2YhfaPg6Tg31gD6UuJhn22JpV6 9geU4aoRIdhmtoG+AIj68T77oMuJBhQkntyLYX5P2G8VN/MjQDHkauxOPxB6WiyvsG2M JR/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=afnpVGLZ; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si18810273plc.450.2017.11.24.08.31.20; Fri, 24 Nov 2017 08:31:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=afnpVGLZ; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753945AbdKXQbS (ORCPT + 6 others); Fri, 24 Nov 2017 11:31:18 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61434 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753632AbdKXQZ6 (ORCPT ); Fri, 24 Nov 2017 11:25:58 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vm007100; Sat, 25 Nov 2017 01:25:10 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vm007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540711; bh=8PiQIno2OUrT3W2GwhtcMp6oHRmeqhftkAuLYhj6bvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=afnpVGLZ6zmPf/WDzfBSWw/9wvJMDARWO4KNQ6sYwjtJAKbUwcJeEjG8BDd7ObNAb 2wzozcpBpyRQXJwk03a8M39gWb0Bgq/zlLOpz2j/8FdHo8sDK2KGZ6cxA1RPosb4iV DBAn1a/OgVmMLQfG63qslcvxaQZSfdmg4Poz1x0zlhzhJE7zPaaYoBfLdH77mSFyKO 3snWYCiLMazs8VOzvq4ZdFgKyhZN7VxEp39rGReyUk44B1jHtilDlwkEcToycD3304 7T4HnPXH5rwkS6bAdbpUAAii6ikgn1mskC5Ix4nO6VvFaDc0ZGWkwjLRY0mbLVhScy rOe4tVyzCEYpg== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 02/22] mmc: renesas_sdhi: remove wrong depends on to enable compile test Date: Sat, 25 Nov 2017 01:24:37 +0900 Message-Id: <1511540697-27387-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org ARCH_RENESAS is a stronger condition than (ARM || ARM64). If ARCH_RENESAS is enabled, (ARM || ARM64) is met as well. What is worse, the first depends on line prevents COMPILE_TEST from enabling this driver. It should be removed. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang --- Changes in v2: - Fix a typo: renesas_sdhc -> renesas_sdhi drivers/mmc/host/Kconfig | 1 - 1 file changed, 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Geert Uytterhoeven diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 1932188..ac25354 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -595,7 +595,6 @@ config MMC_TMIO config MMC_SDHI tristate "Renesas SDHI SD/SDIO controller support" - depends on SUPERH || ARM || ARM64 depends on SUPERH || ARCH_RENESAS || COMPILE_TEST select MMC_TMIO_CORE help From patchwork Fri Nov 24 16:24:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119616 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2448099qgn; Fri, 24 Nov 2017 08:31:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMbr8R2R6e/q2QP8LrU9EHoL4O/GV+4s7sdTVeTOn9hfHeL7DpoyOIhiJVPi0wsPDa3mBH5c X-Received: by 10.98.102.74 with SMTP id a71mr27695587pfc.23.1511541081935; Fri, 24 Nov 2017 08:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511541081; cv=none; d=google.com; s=arc-20160816; b=Hg0ujkoJEuH37XUVL28RW/kZa5iCYrhedCO80Krs8BqdWCNTOQlC8auv7RPp8Ms7s7 nXVQGTx0qYVhyEpv3hU7yPP1YHpaw0XM4oiQ123ofk3RueL6x15g45SVNZOY7WKI70Iw j+jIlBQ+6sE4SOx5SjSgpYkrks4bHFn0tsFh7jo6IETRRBH1+1tse/aB/9mozDtow4aP 8w4ITbmtiGKPS3K2uWxnBEWMVj6ms3xobHdxh+bsT9wRL8FMoVSHwoReYKeCPxC9HGTW oGjgWAMsmixzx94imw6W2j9Ea23gimkH7JuePw9qts8xn0p3drCqipH52M8JXbxTtaN9 lvgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=1MjOQc6LJz4qeVkDan9o6Zoel3TDGLSfm1z9vpfriYc=; b=npHfjSlKcLnPGXwPICWKOGUriJy4T7OhYKVHjIGIJriGfPAv8n61ul25TA1Ji3C3M0 3LFLGip83KGw/McE2oCBEU04LzCVKkQ6U2LzkgMMVFkeyh9I8M7vsU6xyiO2oXkxkdin Cr4oyPYCyzfFDvx11R0PyuxBVWuhnoVJURxgxHsvksCt6ssGuk5l36HdIRQRKUxHln/z mIJllRq+kIgmEZyFIuPDd7J0vbOhLAqap9I9KdmRCndRSSCBuvsQBcKY13xbZPFzLGq5 S4niR9wDUasX2buCUwE//9hBCuROg4GpC4VgUrD4ALohztG8HKc28TXtPDdK1OcHg50s xTpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=B6UxH+fR; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si18810273plc.450.2017.11.24.08.31.21; Fri, 24 Nov 2017 08:31:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=B6UxH+fR; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753952AbdKXQbT (ORCPT + 6 others); Fri, 24 Nov 2017 11:31:19 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61433 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753620AbdKXQZ6 (ORCPT ); Fri, 24 Nov 2017 11:25:58 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vo007100; Sat, 25 Nov 2017 01:25:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vo007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540713; bh=Gcp+WVgzrlSinByi/iVwiNBrfwgOLlXbPUAzKCLR33Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6UxH+fRaJd+P9OWhdOrYHVDy/YQgXFoOKhB3eIoFreIr1ZErOab2LkNw/RUxZ93O kgcgISFi7XkBsjAXHzWmc4U1xwc0j1nxxmPeDqgjYYAE+G/8br5oHt8Cu9gGI8wPcO yRlY3q/fNZHr7vtc3dbAhBNJ43tm1TGlPI9dzF2awHIIsVIXxiMIF8TuatgGXjOZ4n GrAc+QI0ljA4vprBiL4xakl8cbHv8/V4R+o4ncUU5azhshd9IhNdrmOFxsJivv0ZCf FypH6JYPKlLir2v6FDTz8AGaMeNA3UUcpo7ng5D4Y7ua5unsD+OZSJcl2giQ1R4Ku1 qFsviqdQ1VaoQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 04/22] mmc: tmio: set tmio_mmc_host to driver data Date: Sat, 25 Nov 2017 01:24:39 +0900 Message-Id: <1511540697-27387-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org The remove, suspend, resume hooks need to get tmio_mmc_host. It is tedious to call mmc_priv() to convert mmc_host to tmio_mmc_host. We can directly set tmio_mmc_host to driver data. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang --- Changes in v2: None drivers/mmc/host/renesas_sdhi_core.c | 3 +-- drivers/mmc/host/tmio_mmc.c | 12 ++++-------- drivers/mmc/host/tmio_mmc_core.c | 8 +++----- 3 files changed, 8 insertions(+), 15 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 0590ae0..9baf4d1 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -657,8 +657,7 @@ EXPORT_SYMBOL_GPL(renesas_sdhi_probe); int renesas_sdhi_remove(struct platform_device *pdev) { - struct mmc_host *mmc = platform_get_drvdata(pdev); - struct tmio_mmc_host *host = mmc_priv(mmc); + struct tmio_mmc_host *host = platform_get_drvdata(pdev); tmio_mmc_host_remove(host); diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 64b7e9f..ccfbc15 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -128,15 +128,11 @@ static int tmio_mmc_probe(struct platform_device *pdev) static int tmio_mmc_remove(struct platform_device *pdev) { const struct mfd_cell *cell = mfd_get_cell(pdev); - struct mmc_host *mmc = platform_get_drvdata(pdev); + struct tmio_mmc_host *host = platform_get_drvdata(pdev); - if (mmc) { - struct tmio_mmc_host *host = mmc_priv(mmc); - - tmio_mmc_host_remove(host); - if (cell->disable) - cell->disable(pdev); - } + tmio_mmc_host_remove(host); + if (cell->disable) + cell->disable(pdev); return 0; } diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 583bf32..12df338 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1193,7 +1193,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, return ret; _host->pdata = pdata; - platform_set_drvdata(pdev, mmc); + platform_set_drvdata(pdev, _host); _host->set_pwr = pdata->set_pwr; _host->set_clk_div = pdata->set_clk_div; @@ -1351,8 +1351,7 @@ EXPORT_SYMBOL_GPL(tmio_mmc_host_remove); #ifdef CONFIG_PM int tmio_mmc_host_runtime_suspend(struct device *dev) { - struct mmc_host *mmc = dev_get_drvdata(dev); - struct tmio_mmc_host *host = mmc_priv(mmc); + struct tmio_mmc_host *host = dev_get_drvdata(dev); tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL); @@ -1372,8 +1371,7 @@ static bool tmio_mmc_can_retune(struct tmio_mmc_host *host) int tmio_mmc_host_runtime_resume(struct device *dev) { - struct mmc_host *mmc = dev_get_drvdata(dev); - struct tmio_mmc_host *host = mmc_priv(mmc); + struct tmio_mmc_host *host = dev_get_drvdata(dev); tmio_mmc_reset(host); tmio_mmc_clk_enable(host); From patchwork Fri Nov 24 16:24:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119620 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2449300qgn; Fri, 24 Nov 2017 08:32:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMZDLUOF0L32OzjnfqwSlcQLpwdAQg/m+2mz5WEG3KWfgo0b61SgUUi7NoFUjMsGm0Dm43tl X-Received: by 10.99.108.66 with SMTP id h63mr28804346pgc.362.1511541138472; Fri, 24 Nov 2017 08:32:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511541138; cv=none; d=google.com; s=arc-20160816; b=h34IlYmv/rKD+v0vgMsrefaCcq3Y3DPDHIICzlpBB1YMRjQLJss0VHusBwyPa2Qtbp nMl9Y+gs/IY5vjrUwcHzcyclpT/HJ91QhJ9DQ7LeQX1Hn/+KZwYv4dEGC+7QGKZt8BUl XgB8qmvmsapv//rU5nFzT2lN3pHLeRGKRGEp9AcRcGaKtNqioQSn/y/ace4pzVOaZ8Ze q5xoj4yyZ8lOtioR/qVFVvft8TyklxS/3scBQaoKsJW1YWSMvONhNDY0zcBiDNBmKkgp lHZWzhiABM+iAFZChHMqabHUkYu9kgT2QP59+RWAWbV6vBTrYq/phz+ucB1sMK6SILb8 e85w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=Lb/4XYaRzM8FiFqJBkY8bK0S8trPJq3DO8Xsz3+fZqg=; b=aYkMdnu3VfIikhmGVYPp7eJIYrn3iJ4oXfKDYSuSyKki5WYeCHXXi4G7CUua1JxuNq KEccrga178t23DmU40fGhDsVUxm84cZMnCr+jRZbk3WhoIiFhzsNThaX0OezNMvL3TK4 DE58n6P3maqDzSX/lODD9r6ikDb5HlBJtcUR/9g32Q9IFwuxXOxMS+0lL5uWbIHdIM1E hqKti+OY+NfWxdlJYAuN+Y0az16aNjKAOrgi5c0zK5Frubk6cwTm9SZeIumPuQoHYYmS Dwg0Ai4J/XIisDnwN4SaOw/IcpQiP8J67ZVbL+QdKh3eMgL+B+AX8weu11E0T2KJPSil 58qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=T9mPaBm9; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n22si16521539pll.442.2017.11.24.08.32.18; Fri, 24 Nov 2017 08:32:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=T9mPaBm9; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753692AbdKXQcP (ORCPT + 6 others); Fri, 24 Nov 2017 11:32:15 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61428 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753608AbdKXQZ6 (ORCPT ); Fri, 24 Nov 2017 11:25:58 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vp007100; Sat, 25 Nov 2017 01:25:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vp007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540714; bh=qNDBWcc9eLtyjEBtYQmQYpRZXNOZsO7GQak4tSmLjps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T9mPaBm9R+UjF/OXwA66E2Qbf5KIVupdjaNjfWZxwBGSzfcBNSHKQcO3OzqWLzvF5 kJFcrycQnwijhfPdjnZo4GSlvzoXWaZSQTWGel3DTLm/mghdKXQnl0dRFeHYPO2C9l pyJRCm30GDphKUqIreYxfC68NS7pXj0mFHnNwKusmqLYqbDxfu20jxajf7F3XmlXC3 sGGGnfcSklYm2GCsChBq40j3ywWOgM+gX6pLg27GBKfF3v2h7YAMpYv9dZV6r7RDDV aZ4b6jfkZgI3AptSjgdRIhjea7bpoBqWtxGFdlLnX7Ozm8vLksBX9tIdu3l4IK17zC Wz9/GVT4F2oEA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 05/22] mmc: tmio: use devm_ioremap_resource() instead of devm_ioremap() Date: Sat, 25 Nov 2017 01:24:40 +0900 Message-Id: <1511540697-27387-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org The TMIO core misses to call request_mem_region(). devm_ioremap_resource() takes care of it and makes the code cleaner. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 12df338..d3b7af9 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1185,8 +1185,9 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, _host->write16_hook = NULL; res_ctl = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res_ctl) - return -EINVAL; + _host->ctl = devm_ioremap_resource(&pdev->dev, res_ctl); + if (IS_ERR(_host->ctl)) + return PTR_ERR(_host->ctl); ret = mmc_of_parse(mmc); if (ret < 0) @@ -1202,11 +1203,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, if (ret < 0) return ret; - _host->ctl = devm_ioremap(&pdev->dev, - res_ctl->start, resource_size(res_ctl)); - if (!_host->ctl) - return -ENOMEM; - tmio_mmc_ops.card_busy = _host->card_busy; tmio_mmc_ops.start_signal_voltage_switch = _host->start_signal_voltage_switch; From patchwork Fri Nov 24 16:24:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119617 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2448106qgn; Fri, 24 Nov 2017 08:31:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMb6NAfx7dRuDORMaXKdN/Q6B7MrMzjp7XuaCv7neXknkOEtjynW2X58lYbLNio75tdzagEN X-Received: by 10.98.217.133 with SMTP id b5mr14194958pfl.173.1511541082294; Fri, 24 Nov 2017 08:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511541082; cv=none; d=google.com; s=arc-20160816; b=SzjKCkdXHYH3YLbqOiVtnm6WLXPuMi7PSfmAErN+IiwhY9JNg+1P5lbkm4ESxzjr9Z q/ggSj68vVaS54pWmqcxpdpySkERD5KhuWh9hqghNv+f8+GpC9ZvlNVA3G93KBZooUbR +qwYWEyJYiDqJVh5fq4ns575gQPbrpME+ebkhpPBopRa3nXT370LXCrjxKPI252blv3C Fjs3FKQLyD18SbqOYBl+L+iY5wwCY1Yj7taiDZNqmUTAj9TeVM7OCrjkAKXmK6DpB6YU UKJomMBF0oBm7jOZ8F9SFaeMOoukiHPh8JrtCXdLda08ZpCYtrB6sHJbqGAcmG0WN8ZD uJwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=R29tWxFfSr5IIb9U8066R+4s7h3X5dUmLtS1PMDK29A=; b=lBuAIFMr0FHd9QOpjGYIdfSoV8HauO8t82Sbl99ARJSHE0XrTZ6FFo4ZMZmsJtHgQ4 DkqOVpQnr4knZW25QL2wdDK+NqseSt7uAIZn6xIbMKiPDM/uy0OJWlHoYaeCsEbbJSAx 6h/3OKffYjRyyM5+l+B3m0PBFQ6RUPSJVsPBmkoQpb/uvlt4t8qoFRDL/vcbVWJZJIvV ybUG7+X9/oP7BLKgY7sfBpBWA1crxEMidQRgcyIetfMTQr3gRTPe7ZY3fIqcv9K39VGt umJNiwuNhfnoIz2sCZwF8W6JIcUFQakF71xYS/08GF4zPpUVrUtsaMiWVwzqD5brcsPW p6WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=BM8LgqQ1; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si18810273plc.450.2017.11.24.08.31.22; Fri, 24 Nov 2017 08:31:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=BM8LgqQ1; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753632AbdKXQbU (ORCPT + 6 others); Fri, 24 Nov 2017 11:31:20 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61431 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753584AbdKXQZ6 (ORCPT ); Fri, 24 Nov 2017 11:25:58 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vt007100; Sat, 25 Nov 2017 01:25:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vt007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540717; bh=nAFKnXQwDbIlcsGTRoos7TmsVj0l0/qAK3lmA0fh5zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BM8LgqQ1BbHYoiXcorG55Vk2YzqwLULtowJhul23Uk5metCaw0J6YfxVgzYRUqR3g dyiO3jUpqyXpTV39fAnHwx1ZmOW7fwXXvL+MYmap9lxAOMwIP72dezF7gSgtzxCB1X ZfHr98kbtUW0zNwFSDcXFE0bvesA0TpDbmuKTcrMbsNoLzgFH9oq3JrwbHkmqR4DJT ABxaFWU8eqWx8EMivUjzFVyCJF0X1Xtx7Ww3+1qo1112JiFlWQO+ZFlven1P8WUe3X qj5QDCHzErnAEy0FihW8T7YOYTQEjMlk0p3CBFtVqWOXT3lgD/H0ImRti7TatzYrCB 71az4hEwtfjMw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 09/22] mmc: tmio: use mmc_can_gpio_cd() instead of checking TMIO_MMC_USE_GPIO_CD Date: Sat, 25 Nov 2017 01:24:44 +0900 Message-Id: <1511540697-27387-10-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org To use a GPIO line for card detection, TMIO_MMC_USE_GPIO_CD is set by a legacy board (arch/sh/boards/mach-ecovec24). For DT platforms, the "cd-gpios" property is a legitimate way for that in case the IP-builtin card detection can not be used for some reason. mmc_of_parse() calls mmc_gpiod_request_cd() to set up ctx->cd_gpio if the "cd-gpios" property is specified. To cater to both cases, mmc_can_gpio_cd() is a correct way to check which card detection logic is used. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Wolfram Sang diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index efffb04..610f26f 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1232,7 +1232,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, } mmc->max_seg_size = mmc->max_req_size; - _host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD || + _host->native_hotplug = !(mmc_can_gpio_cd(mmc) || mmc->caps & MMC_CAP_NEEDS_POLL || !mmc_card_is_removable(mmc)); From patchwork Fri Nov 24 16:24:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119600 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2442216qgn; Fri, 24 Nov 2017 08:26:01 -0800 (PST) X-Google-Smtp-Source: AGs4zMbSIvqAijmlGul7+bJHuah6fTRIuldq0YNpB3TRmqkeamEMb8iiq0/1tTI5SyjPwPkXXi39 X-Received: by 10.159.218.137 with SMTP id w9mr30151142plp.139.1511540761256; Fri, 24 Nov 2017 08:26:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511540761; cv=none; d=google.com; s=arc-20160816; b=wX6lAreAOhiijPA9Tr9eb1lSXtfXgRU63BYV1F0/+z1/baI20VQGR4AythtXBD7FEa H8XbyewdIuFZMY622tN8iq/GaRWRlf6dU72BtuDl23TXwgHiQ125yFvHRIFyGOtuFhg8 pOlGz80RiI55dSPjcIj2pIOgkcxPIOR3G0l7HQsL5Hi7w+kSuOf/gzie8HYS61xaVXmP K0H21qL7NqgB/hgXhaDZ/zSEIKc9MSDkq/fOFnA23D2sd9KojpC/VB++dp9v9/1CMUBt SAOX7NjWao6OpFyuvZZvZN1H4SdUTd61SuYur8bw3p26ZqsbAjdPBpM2yThgBW9n5o2T rs5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=Hi0Zi72nWZTkAy7TQ96CZDOIoHptbVvHfSUhNbK4/+0=; b=wwkyPE2Fmsit2N2aNrbWZNaSzfzKU22EfI2k23GxUfKMEvMB8uCki9qez4+wvZzmCm HOzdd5GPtfVndMF4pVKBvDuPPv19stY/HaV5z8G+YthGgy8bmChpq9GbwNS2XKnCn6sx UCrltg38LEaoF/dgQ6tB9PQmIlulN7VfdptJu9YBaxv0rH8ZTlIS59fYyAIncODqZ35D CCRFLIVUBRPQggNDcND0Vz/hmJ56olTYwMI+ylEwxnyjRVzceX7dqGsNwyaNbWH5id9v YjCma2cCS09HZR5RFtPPOFA02ZF89hAxOTf1M5Wdc1nCSM3WzbZ0uvcSB+rMC9XCl4eN elLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=ZIarC5lY; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7si5175370ple.586.2017.11.24.08.26.00; Fri, 24 Nov 2017 08:26:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=ZIarC5lY; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753640AbdKXQZ6 (ORCPT + 6 others); Fri, 24 Nov 2017 11:25:58 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61404 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752224AbdKXQZ6 (ORCPT ); Fri, 24 Nov 2017 11:25:58 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vu007100; Sat, 25 Nov 2017 01:25:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vu007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540718; bh=iY3GTa3Ci2TtVpyUUDX3undADzxC4yKTcx5hhMOR45o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZIarC5lYJ7wmbFCcbhn/CKAfv9f7rTSN9Bl43gWUYRaLOms+A0QW+9GDTlVQwouif feqXKNeolg+A3lvs/FLjkMD1SDJDVIBB+/OS8zSFEi/dawkgAgpTDUu2GpwJfQdx4t kHX+2Yq5t/nTSjvsurGSru1FoaYf1CJA/ouVCeWfwla2p7qfsvRISqCM8/1CpX4LVf REw6HwMvdeYxBIPDFwV7xf1pEHY8+ohOOm9XwhPkDTlTj+CRIOYKYHsnkglRWUYQ2t KEA2u3TzZCJmbtt3obQt26lsTf5W+3GInYDpg0prw1blmLan5rT9i9bbnTbZH7HxTF oLSlNdkZ4K5aA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 10/22] mmc: tmio: support IP-builtin card detection logic Date: Sat, 25 Nov 2017 01:24:45 +0900 Message-Id: <1511540697-27387-11-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org A card detect GPIO is set up only for platforms with "cd-gpios" DT property or TMIO_MMC_USE_GPIO_CD flag. However, the driver core always uses mmc_gpio_get_cd, which just fails with -ENOSYS if ctx->cd_gpio is unset. The bit 5 of the status register provides the current signal level of the CD line. Allow to use it if the GPIO is unused. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 610f26f..b51bb06 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1087,6 +1087,19 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc) return ret; } +static int tmio_mmc_get_cd(struct mmc_host *mmc) +{ + struct tmio_mmc_host *host = mmc_priv(mmc); + int ret; + + ret = mmc_gpio_get_cd(mmc); + if (ret >= 0) + return ret; + + return !!(sd_ctrl_read16_and_16_as_32(host, CTL_STATUS) & + TMIO_STAT_SIGSTATE); +} + static int tmio_multi_io_quirk(struct mmc_card *card, unsigned int direction, int blk_size) { @@ -1102,7 +1115,7 @@ static const struct mmc_host_ops tmio_mmc_ops = { .request = tmio_mmc_request, .set_ios = tmio_mmc_set_ios, .get_ro = tmio_mmc_get_ro, - .get_cd = mmc_gpio_get_cd, + .get_cd = tmio_mmc_get_cd, .enable_sdio_irq = tmio_mmc_enable_sdio_irq, .multi_io_quirk = tmio_multi_io_quirk, .hw_reset = tmio_mmc_hw_reset, From patchwork Fri Nov 24 16:24:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119607 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2443549qgn; Fri, 24 Nov 2017 08:27:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMbm09zxknnRpMLKcOSiUJHsBFVeKGRQy9u6dvK56wqh8gR2JPDapBXhjuY5bBj5eaEdww6X X-Received: by 10.159.194.18 with SMTP id x18mr21934884pln.412.1511540841904; Fri, 24 Nov 2017 08:27:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511540841; cv=none; d=google.com; s=arc-20160816; b=yMvOIPe5r5Tr/sRO/cnoziVpOR1y7qmq9+Hg0gCbwPXonN9A1zqLOCbW8PmYkiEXsd lb/LJTwkg07K5tWcEp+m0VhllGC3BtxjOlVIlx7RFmUsyHAFLU4UmpzaVJTqBU63EX1g TICoJRVVGF5tVb3E+yVd0fb/QlPnejZm02hGGU2gjhfEJCCWPOeq6Mj4PjT1l240as/t karop6TkshNqF3CDgoYT6/M9KsYJDWJ7Vw8L8v8F+pzEQIyWkTchq2SKroxnwayQlfpy jRlce34wJQZ27UMAbAIH56bsQJujOPpl3yKGVBuZ9u8sx7EJO5ZAqrgkZwTuP4mjQaoD 1kDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=hv2hJ2KtBq3XC79cSLR3gHYcopTEpInBfLSR+MP1Qks=; b=XmP5jTSidyWRgGye7BMKxgi1UbChixkiVEjzqdmowd+SutQTP9hef7tVQmbLbDt5GD 4ZqqzCpbYoZXIxpWAVCHn4JNqbnx5f39Toe+igZYda0AjDrEFfy5OQ6nJpHtloHVUXi+ XFG3RNvUifnN1JbkGzu8EuiknBedFjoI83RgK6OjY46lerj0SnslYTkx2TawVwou86BL Nx9SHhft1Kx+TJpxttJeTPCZyFOplPBZTwV9LnTrfGyRZBgbfimodVE6RTNeP6a9dDC/ 2kABHPjfkQ6YzrPDzn8eNGDM60ilN5rCmWnJzxzT0R4wptGijWzbqL/Ma6H3PDI0oNGT sSAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=NLWRsHZS; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg3si15390634plb.167.2017.11.24.08.27.21; Fri, 24 Nov 2017 08:27:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=NLWRsHZS; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753610AbdKXQ1T (ORCPT + 6 others); Fri, 24 Nov 2017 11:27:19 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61686 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753802AbdKXQ0J (ORCPT ); Fri, 24 Nov 2017 11:26:09 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vx007100; Sat, 25 Nov 2017 01:25:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vx007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540721; bh=+igcz6tMfjxxH7UHSmZUKfx1D3m3+335tw3xqCbH7JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NLWRsHZSnU7yLXiDmv3WG/5ED2h0Glb1y6xjgurHrsKrwxiV0AVJFZlH8XB6r6OGk 0nC4K/hO5jZk3fyWz/fxUgqWKRYBRmk0/6bCvMjRhWuKhAnDzG9nJczguFdMpDn/3p 5y31sdWJJKqkxnX7erySKZ8gYTJv1d6LWp+OzLw3krjRLKoYFvHXrqzz8YpoSe/0pe 7mq0iFZ64+B5tZqu98lP0PW41zMkimIhg7z+gQSWT3c0bqIWjapqq1bBqKgxc9QiSo x2XNkLGO4bVTCqpQR47AdiReWZDRJRaSC/jibYBxHV8iXinzAjxSoS/mrY7Zews1R2 gxdRSQd64dU+w== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 13/22] mmc: tmio, renesas_sdhi: move Renesas-specific DMA data to renesas_sdhi.h Date: Sat, 25 Nov 2017 01:24:48 +0900 Message-Id: <1511540697-27387-14-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org struct tmio_mmc_host has "dma_dataend" and "dma_complete", but in fact, they are Renesas private data. Move them to renesas_sdhi.h Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi.h | 2 ++ drivers/mmc/host/renesas_sdhi_internal_dmac.c | 8 ++++++-- drivers/mmc/host/renesas_sdhi_sys_dmac.c | 15 ++++++++++----- drivers/mmc/host/tmio_mmc.h | 2 -- 4 files changed, 18 insertions(+), 9 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h index 9a507b3..3250dbe 100644 --- a/drivers/mmc/host/renesas_sdhi.h +++ b/drivers/mmc/host/renesas_sdhi.h @@ -39,6 +39,8 @@ struct tmio_mmc_dma { enum dma_slave_buswidth dma_buswidth; bool (*filter)(struct dma_chan *chan, void *arg); void (*enable)(struct tmio_mmc_host *host, bool enable); + struct completion dma_dataend; + struct tasklet_struct dma_complete; }; struct renesas_sdhi { diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c index 691a99f..02c2724 100644 --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c @@ -132,7 +132,9 @@ renesas_sdhi_internal_dmac_abort_dma(struct tmio_mmc_host *host) { static void renesas_sdhi_internal_dmac_dataend_dma(struct tmio_mmc_host *host) { - tasklet_schedule(&host->dma_complete); + struct renesas_sdhi *priv = host_to_priv(host); + + tasklet_schedule(&priv->dma_priv.dma_complete); } static void @@ -222,10 +224,12 @@ static void renesas_sdhi_internal_dmac_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdata) { + struct renesas_sdhi *priv = host_to_priv(host); + /* Each value is set to non-zero to assume "enabling" each DMA */ host->chan_rx = host->chan_tx = (void *)0xdeadbeaf; - tasklet_init(&host->dma_complete, + tasklet_init(&priv->dma_priv.dma_complete, renesas_sdhi_internal_dmac_complete_tasklet_fn, (unsigned long)host); tasklet_init(&host->dma_issue, diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c index aeb3838..c8a74b2 100644 --- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c +++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c @@ -140,12 +140,15 @@ static void renesas_sdhi_sys_dmac_abort_dma(struct tmio_mmc_host *host) static void renesas_sdhi_sys_dmac_dataend_dma(struct tmio_mmc_host *host) { - complete(&host->dma_dataend); + struct renesas_sdhi *priv = host_to_priv(host); + + complete(&priv->dma_priv.dma_dataend); } static void renesas_sdhi_sys_dmac_dma_callback(void *arg) { struct tmio_mmc_host *host = arg; + struct renesas_sdhi *priv = host_to_priv(host); spin_lock_irq(&host->lock); @@ -163,7 +166,7 @@ static void renesas_sdhi_sys_dmac_dma_callback(void *arg) spin_unlock_irq(&host->lock); - wait_for_completion(&host->dma_dataend); + wait_for_completion(&priv->dma_priv.dma_dataend); spin_lock_irq(&host->lock); tmio_mmc_do_data_irq(host); @@ -173,6 +176,7 @@ static void renesas_sdhi_sys_dmac_dma_callback(void *arg) static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host) { + struct renesas_sdhi *priv = host_to_priv(host); struct scatterlist *sg = host->sg_ptr, *sg_tmp; struct dma_async_tx_descriptor *desc = NULL; struct dma_chan *chan = host->chan_rx; @@ -216,7 +220,7 @@ static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host) DMA_CTRL_ACK); if (desc) { - reinit_completion(&host->dma_dataend); + reinit_completion(&priv->dma_priv.dma_dataend); desc->callback = renesas_sdhi_sys_dmac_dma_callback; desc->callback_param = host; @@ -247,6 +251,7 @@ static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host) static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host) { + struct renesas_sdhi *priv = host_to_priv(host); struct scatterlist *sg = host->sg_ptr, *sg_tmp; struct dma_async_tx_descriptor *desc = NULL; struct dma_chan *chan = host->chan_tx; @@ -295,7 +300,7 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host) DMA_CTRL_ACK); if (desc) { - reinit_completion(&host->dma_dataend); + reinit_completion(&priv->dma_priv.dma_dataend); desc->callback = renesas_sdhi_sys_dmac_dma_callback; desc->callback_param = host; @@ -424,7 +429,7 @@ static void renesas_sdhi_sys_dmac_request_dma(struct tmio_mmc_host *host, if (!host->bounce_buf) goto ebouncebuf; - init_completion(&host->dma_dataend); + init_completion(&priv->dma_priv.dma_dataend); tasklet_init(&host->dma_issue, renesas_sdhi_sys_dmac_issue_tasklet_fn, (unsigned long)host); diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index dc470d3..8b169a0 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -148,8 +148,6 @@ struct tmio_mmc_host { bool force_pio; struct dma_chan *chan_rx; struct dma_chan *chan_tx; - struct completion dma_dataend; - struct tasklet_struct dma_complete; struct tasklet_struct dma_issue; struct scatterlist bounce_sg; u8 *bounce_buf; From patchwork Fri Nov 24 16:24:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119608 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2443586qgn; Fri, 24 Nov 2017 08:27:23 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ9nr5w/Dr/d3lVQ2rSoQlRn9vjcxpYA2HraMkfyAIABfwgttxXLOUfY1d2znCpB/fB8hC6 X-Received: by 10.99.146.18 with SMTP id o18mr28727673pgd.380.1511540843515; Fri, 24 Nov 2017 08:27:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511540843; cv=none; d=google.com; s=arc-20160816; b=JpYC3XGgxz0o8HWPviKeZhqJcpsMUEtRaOXL9gI0FP0gaCVcakNiD8smqbK/mZBvlF agzrOuBb9TW6gjNfp9eF16GukF8V3fsj/OAhiovCZRzVeboas7yiTF/DMP51Mt6Rnqsg fjYYtRF5sL+Nfwc6Yu6fYsgacQOhVxCEGkoidJAeldB9Ll0GzX5wCHoMMG0QpPPdm8ww 6oozSBWeOfrOXTmERS/IeD08YEFoHiN/mOOswYH/ROWgcwenBvKvMGFh+kfNzcCtvPXL F1XNYVschS3notSkz1UdCNXz5ccmDHO5nGrUwJW+DTUNzCVH2MrNsRKh0sd/+KUTC0N4 +9gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=uf4xdsmFy/5tS6152D2RxyyW0cKOW+rbcaRDW+3mK6s=; b=EZy5/iUCI5YNeX/xAU4UDJ32mKzg5b89Rot00F9F4mqvaN2RMzD+bJBs96XtOlCiVk Hgvfy/2fV2M7ITch2RjWMDkqXQjRfOFYsbQ3LtWB/X29viSzayRUwNxWSmierqOltauf z/7PL4FukMk9JA3LdMuwiUL09W7UC/zeDtE15F5uxHwuMMTTOVyoH4ut6/mvJzbVl5s+ B///rEi1IhLhnKa74nRqD1yQDwtkp3XzFBfEfD7MNrHtyG0ce5GcidbtIdyeBZXV+Cqf hzUt9vJDJJSxc45bNzTPLHIXzAxhwpSahASuZ8C78sQLlXXMivst+ZfUqixu/I2zEYI3 4n/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=KJY7i/ug; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg3si15390634plb.167.2017.11.24.08.27.23; Fri, 24 Nov 2017 08:27:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=KJY7i/ug; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753802AbdKXQ1V (ORCPT + 6 others); Fri, 24 Nov 2017 11:27:21 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61663 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753798AbdKXQ0I (ORCPT ); Fri, 24 Nov 2017 11:26:08 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9W8007100; Sat, 25 Nov 2017 01:25:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9W8007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540728; bh=vieGAstKxRkjNgnBdICdlOWJwCrdOoS96FXTnYmioZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KJY7i/ugLTU5PKD8wTW8IxoUFwa9Kmw2gkdXVNEE4fYz2CBP/bPbBLmQLvSv05HnU n4wb0w3vQbPa63meDluhJYNUiiaP78Qg9uBmAmDMk8dcuAHTk2JdcKT0DvavXvjSts RAlKsEuJ9H4+LTepwwlsq/Hs+x7H0uf0TUCPSSjWeMmVY/LzKdWdip857eK1N9P24B Efs8IuzogXvnMxL1UEte55l7SLhZVJn/Oh7BBAUn9B0RmtSvDNF2FAD2J7pJjxDGoJ R4Ul/vLuFaQ6vF3l7A6SEZ6TRygPzjeoqhNVUth/olS8HHLAtbt/urQeGqesGqdCx3 074OzJazPHrJw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 22/22] mmc: tmio: remove dma_ops from tmio_mmc_host_probe() argument Date: Sat, 25 Nov 2017 01:24:57 +0900 Message-Id: <1511540697-27387-23-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Drivers need to set up various struct members for tmio_mmc_host before calling tmio_mmc_host_probe(). Do likewise for host->dma_ops instead of passing it as a function argument. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi_core.c | 3 ++- drivers/mmc/host/tmio_mmc.c | 2 +- drivers/mmc/host/tmio_mmc.h | 3 +-- drivers/mmc/host/tmio_mmc_core.c | 4 +--- 4 files changed, 5 insertions(+), 7 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index a5749d7..825378a 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -531,6 +531,7 @@ int renesas_sdhi_probe(struct platform_device *pdev, host->clk_update = renesas_sdhi_clk_update; host->clk_disable = renesas_sdhi_clk_disable; host->multi_io_quirk = renesas_sdhi_multi_io_quirk; + host->dma_ops = dma_ops; /* SDR speeds are only available on Gen2+ */ if (mmc_data->flags & TMIO_MMC_MIN_RCAR2) { @@ -574,7 +575,7 @@ int renesas_sdhi_probe(struct platform_device *pdev, if (ret) goto efree; - ret = tmio_mmc_host_probe(host, dma_ops); + ret = tmio_mmc_host_probe(host); if (ret < 0) goto edisclk; diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 11b87ce..43a2ea5 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -104,7 +104,7 @@ static int tmio_mmc_probe(struct platform_device *pdev) host->mmc->f_max = pdata->hclk; host->mmc->f_min = pdata->hclk / 512; - ret = tmio_mmc_host_probe(host, NULL); + ret = tmio_mmc_host_probe(host); if (ret) goto host_free; diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index f46d282..7609434 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -198,8 +198,7 @@ struct tmio_mmc_host { struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev, struct tmio_mmc_data *pdata); void tmio_mmc_host_free(struct tmio_mmc_host *host); -int tmio_mmc_host_probe(struct tmio_mmc_host *host, - const struct tmio_mmc_dma_ops *dma_ops); +int tmio_mmc_host_probe(struct tmio_mmc_host *host); void tmio_mmc_host_remove(struct tmio_mmc_host *host); void tmio_mmc_do_data_irq(struct tmio_mmc_host *host); diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 02e1438..1d60a41 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1210,8 +1210,7 @@ void tmio_mmc_host_free(struct tmio_mmc_host *host) } EXPORT_SYMBOL_GPL(tmio_mmc_host_free); -int tmio_mmc_host_probe(struct tmio_mmc_host *_host, - const struct tmio_mmc_dma_ops *dma_ops) +int tmio_mmc_host_probe(struct tmio_mmc_host *_host) { struct platform_device *pdev = _host->pdev; struct tmio_mmc_data *pdata = _host->pdata; @@ -1304,7 +1303,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, INIT_WORK(&_host->done, tmio_mmc_done_work); /* See if we also get DMA */ - _host->dma_ops = dma_ops; tmio_mmc_request_dma(_host, pdata); pm_runtime_set_active(&pdev->dev);