Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2826824yba; Mon, 15 Apr 2019 21:49:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPpu7wzZhjBt2ADEm8qNSP02G2m4nVXbYJIP5Vid+H7iarkY7t2mYZsmBw/Nu6QCwMxbEt X-Received: by 2002:a63:1c6:: with SMTP id 189mr75572128pgb.22.1555390147103; Mon, 15 Apr 2019 21:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555390147; cv=none; d=google.com; s=arc-20160816; b=ch2EWWcGdi9blQwUQo3ZU4DU2kYfzqICuFC6RTFkGgob/SCnL8MwnAg6D3N3jbrAzq Pg9NHbqFFiyIokdQfrROsgwdfExNeT5m629tEZifTMgOXZ694BFc6gz/YYsev8J71+Px s31sszk9Pn7ZMEV8Z1BEpqf+6HLsowdeG5hNuxhdjIkwGM3MtEeB6Oc78557pvBjdkzT bDjLzmhJsv/I+iZU53HindjGBgy6rKTI3k85CQ7YiQuYI8uYhliHrZB5EgxtohUb17bo YGDASC0ryvWGPopL6oZeFqP0TUZ8a55cGf1Y+SVSk2zK3wABDf0hjFu8Heaok8J8lviw 303A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:cc:subject:date:to :from; bh=tICzloSTIdSGGB33LGS8DXSQa0p4U9NZXnAmbQPHWFc=; b=Nj6Ok1KzNLJRIGzy4SRXYvvuew3hFi04FI8vLiinh7wb7JdeARwshLTOtq+BEJAjlF gJJQlkUS7rOYtnqRhHdyaWU55BvQvA3AKJ0t/zfgTdpIX7fzoKPU7KpRiiEGjQKC0uNh RCHMVH8dL9YXYNfYFfzAJj4vpgamuUObuNAJ27S/aOtizS6ILGb4T9lNgMZxd4mFgy5b qa+v5K0hqzEtjKLOViXuqVUahU6OQRfk3kG4VcxpE24sO6B5y2rZhWYnhiyLKw2IHqB3 gQ7MniG0L3tr6944qBXexxRLLDLFb47gpUeqn0RFOKU7wN3GxLEEQkGjfJC7WS3xo+zM 3Bew== 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 11si38460916pla.316.2019.04.15.21.48.51; Mon, 15 Apr 2019 21:49:07 -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 S1726730AbfDPEsN (ORCPT + 99 others); Tue, 16 Apr 2019 00:48:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:59492 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725770AbfDPEsM (ORCPT ); Tue, 16 Apr 2019 00:48:12 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6465EAF3B; Tue, 16 Apr 2019 04:48:11 +0000 (UTC) From: NeilBrown To: Ulf Hansson , Chaotian Jing Date: Tue, 16 Apr 2019 14:47:29 +1000 Subject: [PATCH 1/5] mmc: mtk-sd: support "voltage-ranges" setting. Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, thirtythreeforty@gmail.com Message-ID: <155539004920.25108.9476903376124066171.stgit@noble.brown> In-Reply-To: <155538933003.25108.3338569916935462285.stgit@noble.brown> References: <155538933003.25108.3338569916935462285.stgit@noble.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the mtk-sd silicon is used in a context where there is no explicit regulator, it is not currently possible to specify the voltage ranges. This is true for the MT7621 MIPS Soc. So add a called to mmc_of_parse_voltage() so that voltage-ranges can be given. Signed-off-by: NeilBrown --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 6 ++++-- drivers/mmc/host/mtk-sd.c | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b/Documentation/devicetree/bindings/mmc/mtk-sd.txt index f5bcda3980cc..ed61cd5a5b8f 100644 --- a/Documentation/devicetree/bindings/mmc/mtk-sd.txt +++ b/Documentation/devicetree/bindings/mmc/mtk-sd.txt @@ -27,10 +27,12 @@ Required properties: - pinctrl-names: should be "default", "state_uhs" - pinctrl-0: should contain default/high speed pin ctrl - pinctrl-1: should contain uhs mode pin ctrl -- vmmc-supply: power to the Core -- vqmmc-supply: power to the IO Optional properties: +- vmmc-supply: power to the Core +- vqmmc-supply: power to the IO +- voltage-ranges: if vmmc-supply not present, this can specify pairs + of millivolt numbers to describe available ranged. - assigned-clocks: PLL of the source clock - assigned-clock-parents: parent of source clock, used for HS400 mode to get 400Mhz source clock - hs400-ds-delay: HS400 DS delay setting diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 0798f0ba6d34..4492a4465c0e 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -2125,6 +2125,9 @@ static int msdc_drv_probe(struct platform_device *pdev) ret = mmc_of_parse(mmc); if (ret) goto host_free; + ret = mmc_of_parse_voltage(pdev->dev.of_node, &mmc->ocr_avail); + if (ret < 0) + goto host_free; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); host->base = devm_ioremap_resource(&pdev->dev, res);