From patchwork Thu Mar 3 01:33:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 63430 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2687036lbc; Wed, 2 Mar 2016 17:34:12 -0800 (PST) X-Received: by 10.98.9.129 with SMTP id 1mr42974649pfj.163.1456968851518; Wed, 02 Mar 2016 17:34:11 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tt9si11920907pab.239.2016.03.02.17.34.11; Wed, 02 Mar 2016 17:34:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755883AbcCCBeD (ORCPT + 30 others); Wed, 2 Mar 2016 20:34:03 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:36182 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755692AbcCCBeA (ORCPT ); Wed, 2 Mar 2016 20:34:00 -0500 Received: by mail-pa0-f45.google.com with SMTP id fi3so2730056pac.3 for ; Wed, 02 Mar 2016 17:33:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=goipouOxo+8OYjAAxqD2FWrNHEX/TUj7end0bs1wvuQ=; b=bTzo1QG2Uq/A4P4FuJbMjxAPVfwdJf1WeNuj/E4QY8sEgLoP6IPnjRDwZkBsusm4/L NCm34ajnVQRfNBiY5JWKYsQte6m4HtkpQqni7CviGRUCvfZ0bT6fE7aQLCo968859VxZ 0BTr10fHV2dTI4BYVyGzs3L7N7LcS84f2elR0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=goipouOxo+8OYjAAxqD2FWrNHEX/TUj7end0bs1wvuQ=; b=M5GoVXCXL9/C+HMiYHHtYziodqJdyORdmwNJBL1dkf/8kXWKVJtdiIfnVrcdrFEeDx RVM8i7SyN9emTG0HdoTpRl5xfE2t+hedoiopv+xXmg7QE7H5VXa3u1rjcTO2jv19WhRk CsPYCYFh24KQ9VOJgY/Wtvg7DKfCkmSmVzLzlDiOylhb7NElmgh62X+vJZfvBqHtSVfS BJV1h/olvO2ZUE/6AiDwGrkUw5MFj0gBakzAVeFwrEzbO3+9C6jd5YycFnvBHixykMur ITRMkcvVhg8WDi3ZI1hX4te5zdFFqW2aMy4LGtQlOBBjDYqgjMMbIJKKX8ByrzVlm3Yz SleQ== X-Gm-Message-State: AD7BkJKjKE3USqBk5UPWQDuo12Nq46F9QxykiSj9PQRcw5jO6las2NtaZ+sxQAM0wQHaQ5zf X-Received: by 10.66.253.193 with SMTP id ac1mr43122940pad.121.1456968839305; Wed, 02 Mar 2016 17:33:59 -0800 (PST) Received: from docularxu-ThinkPad-T440p.219.146.1.66 ([182.34.27.183]) by smtp.gmail.com with ESMTPSA id yl1sm55835091pac.35.2016.03.02.17.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Mar 2016 17:33:58 -0800 (PST) From: Guodong Xu To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, jh80.chung@samsung.com, ulf.hansson@linaro.org, shawn.lin@rock-chips.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org Cc: Guodong Xu , Xinwei Kong , Zhangfei Gao Subject: [PATCH 2/2] mmc: dw_mmc: add resets support to dw_mci_parse_dt() Date: Thu, 3 Mar 2016 09:33:38 +0800 Message-Id: <1456968818-22140-2-git-send-email-guodong.xu@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456968818-22140-1-git-send-email-guodong.xu@linaro.org> References: <1456968818-22140-1-git-send-email-guodong.xu@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With this, user can add a 'resets' property into dw_mmc dts node, and when driver probe and parse_dt, it will call reset APIs to reset dw_mmc host controller. Please also refer to Documentation/devicetree/bindings/reset/reset.txt Signed-off-by: Guodong Xu Signed-off-by: Xinwei Kong Signed-off-by: Zhangfei Gao --- drivers/mmc/host/dw_mmc.c | 7 +++++++ include/linux/mmc/dw_mmc.h | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 242f9a0..d3a7376 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2878,6 +2878,13 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host) if (!pdata) return ERR_PTR(-ENOMEM); + /* find reset controller when exist */ + pdata->rstc = devm_reset_control_get_optional(dev, NULL); + if (IS_ERR(pdata->rstc)) + pdata->rstc = NULL; + else + reset_control_deassert(pdata->rstc); + /* find out number of slots supported */ of_property_read_u32(np, "num-slots", &pdata->num_slots); diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 7b41c6d..b95cd84 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -14,9 +14,10 @@ #ifndef LINUX_MMC_DW_MMC_H #define LINUX_MMC_DW_MMC_H -#include -#include #include +#include +#include +#include #define MAX_MCI_SLOTS 2 @@ -260,6 +261,7 @@ struct dw_mci_board { /* delay in mS before detecting cards after interrupt */ u32 detect_delay_ms; + struct reset_control *rstc; struct dw_mci_dma_ops *dma_ops; struct dma_pdata *data; };