Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3155794rwb; Tue, 8 Nov 2022 00:57:25 -0800 (PST) X-Google-Smtp-Source: AMsMyM6cL6LHlvyX5ErHU6FbKwPgdQgsfZu+HZY30Oud4htGb+RWSRZv3lXAY4F8silgxg7Wejiz X-Received: by 2002:a05:6402:550e:b0:456:f79f:2bed with SMTP id fi14-20020a056402550e00b00456f79f2bedmr55322512edb.106.1667897845202; Tue, 08 Nov 2022 00:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667897845; cv=none; d=google.com; s=arc-20160816; b=xAWqLj0E7uGn2dYYFnHLnoFIiusv0a11+qniddeapPTVodDN01WXQqDM4u9e2LiDvu AC6HvPyCWLYsoN+HLUQEEKdLjBhZX+F4jOWSQEB36vKne4Qd+cWh9rbu5WAkJy1bksmW mcRY7cm6dDJE0iDbjgRCaqqSaf0TevC1RGKUJ+ZRgpfcwV3LXlMU/r0RB1JCXK+XGo2D gIRObw6LGsccsr07xDqscMPMKudPa6x1SfZN9J3DIY9Yy4Rc8haIexlib2Nkms3teoqK eT6Ix1ow3EXEQJP4cu9uCJ80qJ1WlClJmcgzqCzYhswcGTxCaWpsFPcS2Bav1CgjHpTU OTRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=pB9ae38EbgcREzrM6tNMQ4NRzQ296L5HvzgPjDbrNRU=; b=Y0EdVasVJDKjgUBY6ZXKzA3Yb8BjnxrRWo+P7jSg9Zoqh+x1WScRxjakg4x46Ixuvq T9+NUlnqyQ+zTORniYyokbnAc8EdHT4+hsG77YirCCcNcgGf+hoJdOGxgBGhQwHBAY44 QqQH0uHHqEH6aoptdvtrDmVvsf3kd6I0R7eH9Y4tCoRY4lB8c4GHjgXcO2PmbFDYGwM4 to3DzhidD7mvY7ehMQY16r8v46CCoSNTONZr/rwWNG7pB8AAkJCnwhe2MGPnZiy5nYXl SqFFwDnZn0NBpnPPHlPeh2o447AojpTFbvEduIMT0MHct62Wb2Ol0pN2MK4STROJ695C yVyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sz15-20020a1709078b0f00b00782933fe436si7676093ejc.965.2022.11.08.00.57.00; Tue, 08 Nov 2022 00:57:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233774AbiKHIZo (ORCPT + 91 others); Tue, 8 Nov 2022 03:25:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233670AbiKHIZl (ORCPT ); Tue, 8 Nov 2022 03:25:41 -0500 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD91B27B20 for ; Tue, 8 Nov 2022 00:25:39 -0800 (PST) Received: from unknown (HELO kinkan2-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 08 Nov 2022 17:25:38 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by kinkan2-ex.css.socionext.com (Postfix) with ESMTP id C85522059027; Tue, 8 Nov 2022 17:25:38 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Tue, 8 Nov 2022 17:25:38 +0900 Received: from plum.e01.socionext.com (unknown [10.212.243.119]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 89233B62A4; Tue, 8 Nov 2022 17:25:38 +0900 (JST) From: Kunihiko Hayashi To: Adrian Hunter , Ulf Hansson Cc: Jassi Brar , Ard Biesheuvel , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH 1/4] mmc: f-sdh30: Add reset control support Date: Tue, 8 Nov 2022 17:25:30 +0900 Message-Id: <20221108082533.21384-2-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221108082533.21384-1-hayashi.kunihiko@socionext.com> References: <20221108082533.21384-1-hayashi.kunihiko@socionext.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add reset control support for F_SDH30 controller. This is optional. Signed-off-by: Kunihiko Hayashi --- drivers/mmc/host/sdhci_f_sdh30.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c index 3f5977979cf2..7f4553b28180 100644 --- a/drivers/mmc/host/sdhci_f_sdh30.c +++ b/drivers/mmc/host/sdhci_f_sdh30.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "sdhci-pltfm.h" #include "sdhci_f_sdh30.h" @@ -21,6 +22,7 @@ struct f_sdhost_priv { struct clk *clk_iface; struct clk *clk; + struct reset_control *rst; u32 vendor_hs200; struct device *dev; bool enable_cmd_dat_delay; @@ -150,6 +152,16 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) ret = clk_prepare_enable(priv->clk); if (ret) goto err_clk; + + priv->rst = devm_reset_control_get_optional_shared(dev, NULL); + if (IS_ERR(priv->rst)) { + ret = PTR_ERR(priv->rst); + goto err_rst; + } + + ret = reset_control_deassert(priv->rst); + if (ret) + goto err_rst; } /* init vendor specific regs */ @@ -175,6 +187,8 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) return 0; err_add_host: + reset_control_assert(priv->rst); +err_rst: clk_disable_unprepare(priv->clk); err_clk: clk_disable_unprepare(priv->clk_iface); @@ -191,8 +205,9 @@ static int sdhci_f_sdh30_remove(struct platform_device *pdev) sdhci_remove_host(host, readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff); - clk_disable_unprepare(priv->clk_iface); + reset_control_assert(priv->rst); clk_disable_unprepare(priv->clk); + clk_disable_unprepare(priv->clk_iface); sdhci_free_host(host); platform_set_drvdata(pdev, NULL); -- 2.25.1