From patchwork Thu Apr 26 10:38:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 134482 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2084360lji; Thu, 26 Apr 2018 03:38:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx497jlA0I1L6N47eLlz1nQ2vjBIOj+W8vtZjsx6tAI/B/QJYz1VVcbq0Nd+Bm7wK0cdXQkSb X-Received: by 10.101.99.22 with SMTP id g22mr27301914pgv.410.1524739113500; Thu, 26 Apr 2018 03:38:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524739113; cv=none; d=google.com; s=arc-20160816; b=o5YhngvBTWnEHcEAVcynb0YbuuLiCBGnmAY34iZ6is9gSh33ginPzUuUFZGjcrziPn VXl+TEJMB0RSWesj3iOycFgqB9QM0LdCmzUhoS2DGoFqwmTi3GgxTcAodYfdNutrhA8M v5Y7CI5WnfSZLhO+WmiPmPT9e6eqI5P95mFdE/xov0S0ANPz/38i6PNxZyk6aEEzGElw CyhVUNzGxQ7XwXNqhS6nfY3kbZTgtQbLt7MVG4d18ayGXNsCVCva6gvX3PqLf+HuKPZs HrZtHOPeXSUivaUAPdIQ/PgR+TAANklct3BRddjIR7A2Itg9AawO9lVjJzRFo3vVh36+ GSRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=VIiDnKEeexbinbURdLBwaIqW0MGQVRozapuS/5MzuJ8=; b=ISzXcZK+z4V/InzrUlCZBT5qWGmO/YCLrklWbzy5RjGYqMhhjOtLWjiyAm7MdkTci0 t6gMXaojfrd5EbZl7JHcQBYLj6nEZd8f22yClH3ND3snpISSUsbJcUtRtzgUCg9RhDoj yupcgM3aw+gw0nImcpW8lR19lvIg9ffPBroznISJrInlmYnsYK3Apfed7qzaCSj9C8an BAnIisq2S+1l2EE7kJb2gJ9kySid2QcClMlSrxsmA0Xv/+SX6MPvbZJJRSI6YFHTN3me he7ucN1Hxi1bHWArB/sJm0ltPwvQcuJFAlVWHf8+wSDLnm9a/e1Hr4jWfBQgSc58mG57 pxqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=pgFZ97uj; 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 b10-v6si4547454pls.81.2018.04.26.03.38.33; Thu, 26 Apr 2018 03:38:33 -0700 (PDT) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=pgFZ97uj; 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 S1755542AbeDZKib (ORCPT + 6 others); Thu, 26 Apr 2018 06:38:31 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:35034 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755592AbeDZKi1 (ORCPT ); Thu, 26 Apr 2018 06:38:27 -0400 Received: by mail-wr0-f193.google.com with SMTP id w3-v6so56239146wrg.2 for ; Thu, 26 Apr 2018 03:38:26 -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; bh=otkesq/ghJ+/1s5Fl5F1qM2pKXNxHAEIQUr9kpbG7/k=; b=pgFZ97uj75QZj34zgcOf/yqpc9fpumhrh8SxayiLPD8KaxJmdE6gxaOgvxa9E6fg8E R0iIvDXagN/UDLxDzaqUIrUNhRMaOBk5mRBnDJfA80fY/q0s0Htd1FMkmmzfThItV090 Vu/k+ljexp+6zU62e64nur6e8xt/UrcgIKiBueY57jEKvJUgvsDpcE4RT++3fpuUKXMb 51g9ixxtV5xW1cHMqewTfY73XidKH2wcmMdJFPMup9bVGsiDo738UgHeRUSzzmVOcigm Wtn/ZmGGDPuGWf0Eht2OoQzkOyAvgHuDkRPM9kCrl5LaXnb+YZCr33dll8wortGr01vu rmPQ== 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=otkesq/ghJ+/1s5Fl5F1qM2pKXNxHAEIQUr9kpbG7/k=; b=YWaqq1fgvbX2wZupGy/tOQs53ocSesU9HbYLyzJ9Aha2aqm9yW2qoWzS/yoiYlONVt DBlIq7HmTnBHs+cQEa8Ay8vKwGqLUcfekyhNtEy8opoeXWuGxqhS6e30zCuMWeHPdmfp V6r7UpnKD5wfNdF1xXce1jAhPTLN2P2FI97x1OejDt34XzJwMKMgcyan3ZgbdplRn/Jr vvHA7jP1+gJPcvInUXvTtC1qi80rO2+mTeBFKVSv6CIsmKb/olzrF+ZO0d3P4b1jy7YQ 4dkMvR0v0ppMe/iwwxy2g7dGd4yu6c9uGSUUKfz8cLuiCQZ+cz798wV8gzyuJgytYyMl LogQ== X-Gm-Message-State: ALQs6tACXlEY9ceMGDP4DDypK5RMa80ciYxfh7Mo7d/C37XltkLudtYi zd5JtgxDldLyNBG9tKoYW/lDKQ== X-Received: by 2002:adf:ab0a:: with SMTP id q10-v6mr26937385wrc.239.1524739106238; Thu, 26 Apr 2018 03:38:26 -0700 (PDT) Received: from boomer.baylibre.local ([2a01:e34:eeb6:4690:3146:aafc:91d9:4b96]) by smtp.googlemail.com with ESMTPSA id a10-v6sm30354143wri.10.2018.04.26.03.38.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Apr 2018 03:38:25 -0700 (PDT) From: Jerome Brunet To: Ulf Hansson , Carlo Caione , Kevin Hilman Cc: Jerome Brunet , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] mmc: meson-gx: add device reset Date: Thu, 26 Apr 2018 12:38:17 +0200 Message-Id: <20180426103817.12675-1-jbrunet@baylibre.com> X-Mailer: git-send-email 2.14.3 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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 node have the reset property Signed-off-by: Jerome Brunet --- Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt | 2 ++ drivers/mmc/host/meson-gx-mmc.c | 6 ++++++ 2 files changed, 8 insertions(+) -- 2.14.3 -- 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/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt index 5add8d7d855f..ba434375e7f2 100644 --- a/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt +++ b/Documentation/devicetree/bindings/mmc/amlogic,meson-gx.txt @@ -20,6 +20,7 @@ Required properties: "clkin1" - Other parent clock of internal mux The driver has an internal mux clock which switches between clkin0 and clkin1 depending on the clock rate requested by the MMC core. +- reset : phandle of the internal reset line Example: @@ -30,4 +31,5 @@ Example: clocks = <&clkc CLKID_SD_EMMC_A>, <&xtal>, <&clkc CLKID_FCLK_DIV2>; clock-names = "core", "clkin0", "clkin1"; pinctrl-0 = <&emmc_pins>; + resets = <&reset RESET_SD_EMMC_A>; }; diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 55bbd67177df..9d214622c8cf 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 @@ -1212,6 +1213,11 @@ 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); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(host->regs)) {