From patchwork Tue May 15 09:57:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 10400769 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 E7984601C8 for ; Tue, 15 May 2018 10:05:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF824286F2 for ; Tue, 15 May 2018 10:05:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C40682872E; Tue, 15 May 2018 10:05:44 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5DA36286F2 for ; Tue, 15 May 2018 10:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NOeDACmpdLq5hlWBMVbxgcH2vTiXnfENuTrlJgkVJCw=; b=O+UCXcNRgwA1M2Zx9pKv4g134w XZSWlznYxlXtVXfgGbWdIpwyOeHl2XB4pvO5JFomNNQUj2UM2pOfq4GJoLQb2jtudSyiusx43C0lQ E2DgjN/yRbIg4aehfrj1wORSbJC1s2GPtw9ITDCEW2+izlM1WGD8pbqdtgrPHzzU9+ihv3PfvBmKs WXAX/r/8U8Bo/nYKZIcMS/uwq1Eb1EnTxVmeIuwuCiC6V41fC3pjVUZOghqnHGAdCyLAfRSkn4Zi/ TTZ0kgpdZPHrPQUVw/zw5c1F7QksKGO/bWw7NMrXq5OgZ8Lw8ISDDMZvC/n1IBDiXRR2RHW8ttZWc x3rR/eCg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIWpv-0005Zc-CZ; Tue, 15 May 2018 10:05:39 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIWil-0005bP-Qs for linux-amlogic@lists.infradead.org; Tue, 15 May 2018 09:58:18 +0000 Received: by mail-wr0-x244.google.com with SMTP id p4-v6so15346717wrh.3 for ; Tue, 15 May 2018 02:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tl/9E1K1OryN0PETVZ1inEtz97OJCjMyjmQFpnztezQ=; b=gLaK9UzCSXl8xeoYWpV2UzaIvHo+qgXDTWNPJPFygsVtrjN6zZL8fLK3ac4NUCjvck 0QmIQFEqX0co8xZCh+yjbNsCvb/bLF/F8TVO/HqeQYSMYJQtXRZ2Gai24zXZkp8atPWu e74JNmPbEEes4rFrMDvmZxeu1oYFtW+jiglgPwev5o/lyWvz0Nid/LaWWT7DGISax02f My5Fmag5Yv3CT8Z0Ch3WU4gJt7aoXASBHiPPV/G3KEy5c2zJCEmKSOOtRxy/+325vaxM bfBkOkwgJpNMSey3iz4y/LkXMBYZT4E6W5jYi/9lZTRovylgokCJYaR9VYKiqpRxBEa8 rV0g== 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:in-reply-to :references; bh=tl/9E1K1OryN0PETVZ1inEtz97OJCjMyjmQFpnztezQ=; b=e5v6B5K4NiR3jkg4QLUS1Gqu8RxbuTmN1h5sj+xgBHljiNkl6AVmTqu60kN3vkVW50 TPLFEO0VscUO20EEgsIacI4SlAecFPaZsHMdihNmShQqjo0PPAXpi8FhWOROD9RaoJFn XRyIHq6t/JZGYp9MJK2CjvdkN6ERj0wxg4pdRDe78AvaFgufD7lNYGWRBBDE3Mp4audU Q9UZBw09smpRkv1ixEnJ06qB0uqYTmDJ8Xvsc+oKInmxSHcTMKk69Une6/T+xxWXUNjW G42Xv08v2OLj0TfPHlf6EkoROe2anroW7mzwomtVSEu/ziAI504hQ8+1YeF0iHStsz8/ 9jCw== X-Gm-Message-State: ALKqPweq6hlasoV8X/w4ymEx+yqte+hK22UQNqiT9or8Gxa0EGJPGMs3 RJtODli0if46HUMLV1EDrT5sow== X-Google-Smtp-Source: AB8JxZol/kxSwZhCf3wzwiXFq/kVbSmFTYjDJvyQlp//y6PiBq+RzCQTNBH7U2zSe9V7oTx4Nqz2zg== X-Received: by 2002:adf:c88c:: with SMTP id k12-v6mr10518523wrh.6.1526378283394; Tue, 15 May 2018 02:58:03 -0700 (PDT) Received: from boomer.baylibre.local ([90.63.244.31]) by smtp.googlemail.com with ESMTPSA id 75-v6sm17253263wmw.37.2018.05.15.02.58.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 02:58:02 -0700 (PDT) From: Jerome Brunet To: Ulf Hansson , Carlo Caione , Kevin Hilman Subject: [PATCH 2/2] mmc: meson-gx: add device reset Date: Tue, 15 May 2018 11:57:48 +0200 Message-Id: <20180515095748.6794-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180515095748.6794-1-jbrunet@baylibre.com> References: <20180515095748.6794-1-jbrunet@baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180515_025815_927960_DCAA3FC9 X-CRM114-Status: GOOD ( 12.71 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Brunet MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Trigger the reset line of the mmc controller while probing, if available. The reset should be optional for now, at least until all related DT nodes have the reset property. Reviewed-by: Kevin Hilman Signed-off-by: Jerome Brunet --- drivers/mmc/host/meson-gx-mmc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 4f972b879fe6..9bca359f7936 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -1184,6 +1185,14 @@ static int meson_mmc_probe(struct platform_device *pdev) goto free_host; } + ret = device_reset_optional(&pdev->dev); + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "device reset failed: %d\n", ret); + + return ret; + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(host->regs)) {