Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1236603imm; Tue, 2 Oct 2018 05:12:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV62FRYFhctyrmXbVoOHJ0XVmz0e/JVcxrSsqbqrz4DCgvoqe120vL3xi/GjLq0Pes0Cr24O+ X-Received: by 2002:a63:991a:: with SMTP id d26-v6mr9464827pge.434.1538482325812; Tue, 02 Oct 2018 05:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538482325; cv=none; d=google.com; s=arc-20160816; b=aR9bgkdJZoOlwqZCFTaen+WgofUv7gdGTR5d4xKfn/nWpyP4DVOKet3p7NQw3siveY geEiqJhedzQYyoEH5F4uuUleEsEfNFPkkxUJq+4S7gABNZ6Gj81GlbVMrCojFMWSsR2v 8cOVElz5Ml4oM9e5TQyQSKcKiJEASUQw+bGTPvpqG5f9Gxwz01GPKUAOiXtvPFU+ww7s ZyFw3yoRKvsM+o+cueGiiufEe1ohjTHYivnDuztQeYp2rrbm091ZFdpkFH9VeD+Zeixu FhUGUiaBCRiUWMCgxkLlJ2FcKzi586eFbm4tW4CrCo1aytWzL82eX41xCtOMOVbVOy1l OyqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=NPv47UCA6dqsbZzLQpXYvlxndnwzbRVMusavfEzw3mQ=; b=07R/BtwjJkNywNogSyriPprBR1i+8J/9+m+mojrFRD5MOCAVz3ShqrjX498rcQJu2D SJJqYPUGFTt4sETa3eSXQ77O2HMRGeSzDLha/Uwqy/nJbFXUKELrQ0i+r6TWaKJq2ea3 u7dTO/GgDTZofeyzFLvN5ml9WLrwWbJTu/1b6dassPwDmZ+YFRdvv+RA7dJ+QsGZHL/t OtwzNkfK226Ek2kub4u1/PRlQlsVWky/mfzGtZAYj4GUUgbfjHQLi2hTc0CeV9RbINhF dOlLFB5KaYNcSleyo7ojhq+thkDOgPnOmqWgicwKQjHVXsdyS8mdrcIHbwm+0F42dRB7 /8eg== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32-v6si16319574pld.323.2018.10.02.05.11.51; Tue, 02 Oct 2018 05:12:05 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727837AbeJBSxO (ORCPT + 99 others); Tue, 2 Oct 2018 14:53:14 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:41843 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727802AbeJBSxN (ORCPT ); Tue, 2 Oct 2018 14:53:13 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w92C8gos013788; Tue, 2 Oct 2018 14:10:06 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2msxh6gsnm-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 02 Oct 2018 14:10:06 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C255E48; Tue, 2 Oct 2018 12:10:04 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DA0552A3C; Tue, 2 Oct 2018 12:10:04 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 2 Oct 2018 14:10:04 +0200 Received: from lmecxl0923.lme.st.com (10.48.0.237) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 2 Oct 2018 14:10:04 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: Maxime Coquelin , Alexandre Torgue , , Gerald Baeza , Loic Pallardy , , , , , , Ludovic Barre Subject: [PATCH V4 21/25] mmc: mmci: add optional reset property Date: Tue, 2 Oct 2018 14:09:23 +0200 Message-ID: <1538482167-13819-22-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538482167-13819-1-git-send-email-ludovic.Barre@st.com> References: <1538482167-13819-1-git-send-email-ludovic.Barre@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.48.0.237] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-10-02_03:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ludovic Barre This patch adds a optional reset management. STM32 sdmmc variant needs to reset hardware block during the power cycle procedure (for re-initialization). Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 7 +++++++ drivers/mmc/host/mmci.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 969b665..0898cc9 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -1877,6 +1878,12 @@ static int mmci_probe(struct amba_device *dev, dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); + host->rst = devm_reset_control_get_optional_exclusive(&dev->dev, NULL); + if (IS_ERR(host->rst)) { + ret = PTR_ERR(host->rst); + goto clk_disable; + } + /* Get regulators and the supported OCR mask */ ret = mmc_regulator_get_supply(mmc); if (ret) diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 33c243f..f793426 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -318,6 +318,8 @@ struct mmci_host { struct clk *clk; u8 singleirq:1; + struct reset_control *rst; + spinlock_t lock; unsigned int mclk; -- 2.7.4