From patchwork Tue Jun 4 08:14:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 11033413 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8AE814DB for ; Fri, 5 Jul 2019 22:25:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7A6828A8C for ; Fri, 5 Jul 2019 22:25:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9E3328AAB; Fri, 5 Jul 2019 22:25:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,RCVD_IN_DNSWL_LOW, T_TVD_MIME_NO_HEADERS autolearn=ham version=3.3.1 Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 388CC28A8C for ; Fri, 5 Jul 2019 22:25:53 +0000 (UTC) X-Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by groups.io with SMTP; Fri, 05 Jul 2019 15:25:52 -0700 X-Received: by mail-lf1-f65.google.com with SMTP id u10so7170557lfm.12 for ; Fri, 05 Jul 2019 15:25:52 -0700 (PDT) X-Gm-Message-State: APjAAAU0K92qeAdoFRLE6PM6HEpRVI+YyVoQIaewHxu7EHISdo4mf0yn uTM5HEawOuHJbCrOWS+elSxBZynh+nig7w== X-Google-Smtp-Source: APXvYqwSFOp/1p+AG3cadRYEUlpl+N9DnfTljMoH/fG6kHIHvIeVSrNO2Arwjj+55vfiw+SQ23l92g== X-Received: by 2002:a19:c503:: with SMTP id w3mr2681957lfe.139.1562365550193; Fri, 05 Jul 2019 15:25:50 -0700 (PDT) X-Received: from localhost (h85-30-9-151.cust.a3fiber.se. [85.30.9.151]) by smtp.gmail.com with ESMTPSA id b25sm1577758lfq.11.2019.07.05.15.25.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2019 15:25:49 -0700 (PDT) Resent-From: Olof Johansson Resent-Date: Fri, 5 Jul 2019 13:51:26 -0700 Resent-Message-ID: <20190705205126.tz3mh7hnw4xacytl@localhost> Resent-To: patchwork-soc@linux.kernel.org X-Received: by 2002:a05:6602:220a:0:0:0:0 with SMTP id n10csp5434700ion; Tue, 4 Jun 2019 01:14:53 -0700 (PDT) X-Received: by 2002:a63:330b:: with SMTP id z11mr33217715pgz.407.1559636093433; Tue, 04 Jun 2019 01:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559636093; cv=none; d=google.com; s=arc-20160816; b=FY2IX/+rtSpqt056r0Rp8vyQg6DI1XLpwWBI8DVCYDf0Ch3kX9JfVgQG2VU5m1SRTD PcdrHMo2d/GbvFAuVCpjtMEbXy9aB2HMR0i3qD4DSkqgu/6IWfbwTCGV1uNsfr/mdU4s E6wa7oJME9Ed5vbRYeV0MRYOHzqF+Gcaen368bw3Ag0g6tjTQ2Nw5HibvOe2X+V6AQ48 /QKZslN26//atIMS7Vzzot5Nw+Zz2xDlTxW5Cu1wajbdZ/vQG5qRs6c/eChBkDOjpnRi F7QALb3Kof+5mI1abgqIqBVj6Rhr5CciaIH7j50Tv734jTBu7ZNSTu8IIbNkEiLxFLRC qK8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tvMJ5s9gExvOA7lMPut++cP3zHcPvryLWLVuc4mHs3M=; b=Nw/X/2Mh2hd57lH+Psa5MFifwUHdk+uJ5zZn1znyp6A8oSw/bxT3NS1ssIdLpZxSDS u5Xi5yjuBUh9wDnSqc8DIHUxIO9622iLRHoCE3UjxE83/O0Dzsb6M4Oa+N3g5GtqboUD Qy9CiTqsSA6Whc/Mv9hWywAbWsZIGLQLneMqJi9Z/uPfYOCGDm7AGzpzAHimNSwb1MQr NlzzaQQRMi77FAKSrq09Glo9i9LQ1OxL9/4q16GPdO0y9mupE6rbRPNQYg5axcPs7FfL 9ktIUEXeQGTtKn8xvvnOPRkmHN+KyE8wKlvDN7KbtWpx7yV9FYGZuWZRk7Z2GvyfaiPQ ko+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KvCoOxV2; spf=pass (google.com: domain of baolin.wang@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=baolin.wang@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id j20sor19354908pfi.52.2019.06.04.01.14.53 for (Google Transport Security); Tue, 04 Jun 2019 01:14:53 -0700 (PDT) Received-SPF: pass (google.com: domain of baolin.wang@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:aa7:8ece:: with SMTP id b14mr27207253pfr.244.1559636093172; Tue, 04 Jun 2019 01:14:53 -0700 (PDT) X-Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id j4sm14818804pgc.56.2019.06.04.01.14.48 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jun 2019 01:14:52 -0700 (PDT) From: "Olof Johansson" To: adrian.hunter@intel.com, ulf.hansson@linaro.org, zhang.lyra@gmail.com, orsonzhai@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, olof@lixom.net Cc: baolin.wang@linaro.org, vincent.guittot@linaro.org, arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/9] mmc: sdhci-sprd: Check the enable clock's return value correctly Date: Tue, 4 Jun 2019 16:14:21 +0800 Message-Id: <9c76f06c8ba1762c9706f2c20878bf39d46370dc.1559635435.git.baolin.wang@linaro.org> In-Reply-To: References: In-Reply-To: References: X-TUID: 6BdADSp+RhRz Precedence: Bulk List-Unsubscribe: Sender: patchwork-soc@linux.kernel.org List-Id: Mailing-List: list patchwork-soc@linux.kernel.org; contact patchwork-soc+owner@linux.kernel.org Delivered-To: mailing list patchwork-soc@linux.kernel.org Reply-To: patchwork-soc+owner@linux.kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.kernel.org; q=dns/txt; s=20140610; t=1562365553; bh=wl6RipAfc8pQIsuU+Btgw5EkEQ8spiGZrn4QztV1/ZQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=KY1ThzQzE2hP+YuM9VQCCe9DL8yYWfgw0AaEv7UKMK8fl+FrLhiNQiE/Ej9Ic6zFxqv 53IXYN3f5avATBbn6+pLX8+pmU3Ki4RA7MkboZmnRNI1frGJ2FcTX4Jm8wBs/eK5lJCWt vZURO9lOnqXMCndb1e8jZDdQoL0Q71acGQI= X-Virus-Scanned: ClamAV using ClamSMTP Missed to check the enable clock's return value, fix it. Signed-off-by: Baolin Wang Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-sprd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index 9a822e2..e741491 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -368,7 +368,7 @@ static int sdhci_sprd_probe(struct platform_device *pdev) if (ret) goto pltfm_free; - clk_prepare_enable(sprd_host->clk_enable); + ret = clk_prepare_enable(sprd_host->clk_enable); if (ret) goto clk_disable; From patchwork Tue Jun 4 08:14:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 11033415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1A8114DB for ; Fri, 5 Jul 2019 22:25:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DBE728A8C for ; Fri, 5 Jul 2019 22:25:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EE2728AAB; Fri, 5 Jul 2019 22:25:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,RCVD_IN_DNSWL_LOW, T_TVD_MIME_NO_HEADERS autolearn=ham version=3.3.1 Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33A4F28A8C for ; Fri, 5 Jul 2019 22:25:54 +0000 (UTC) X-Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by groups.io with SMTP; Fri, 05 Jul 2019 15:25:53 -0700 X-Received: by mail-lf1-f65.google.com with SMTP id p197so7212716lfa.2 for ; Fri, 05 Jul 2019 15:25:53 -0700 (PDT) X-Gm-Message-State: APjAAAV1mTYhA7DQasOs6Qq8hKclNxD8wcDCv872GKJTXLuSl73l12SZ 671NOmgAc52AK8leDk541zFb1kpS14ujJg== X-Google-Smtp-Source: APXvYqy6eYP8kDDz9cX9t0tdcVDeNHlnDCDn3UGc4m5krORek4US+tjcGLPkd5aqNOT6qD8DzoSJVg== X-Received: by 2002:a19:6b0e:: with SMTP id d14mr2973440lfa.174.1562365551292; Fri, 05 Jul 2019 15:25:51 -0700 (PDT) X-Received: from localhost (h85-30-9-151.cust.a3fiber.se. [85.30.9.151]) by smtp.gmail.com with ESMTPSA id z85sm2004924ljb.101.2019.07.05.15.25.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2019 15:25:51 -0700 (PDT) Resent-From: Olof Johansson Resent-Date: Fri, 5 Jul 2019 13:51:26 -0700 Resent-Message-ID: <20190705205126.xp6mib5nu6orhb3k@localhost> Resent-To: patchwork-soc@linux.kernel.org X-Received: by 2002:a05:6602:220a:0:0:0:0 with SMTP id n10csp5434793ion; Tue, 4 Jun 2019 01:14:58 -0700 (PDT) X-Received: by 2002:a65:4209:: with SMTP id c9mr25196110pgq.111.1559636098230; Tue, 04 Jun 2019 01:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559636098; cv=none; d=google.com; s=arc-20160816; b=qSHPNdwkKjD8M8Hog2OWC1AM1wNmoX1Bt6gCX5zbnPHGwhyEGZZCSfD0lbpb+XpGWg 246ILfvHLwlqr6fhM4NK+DLrjm0lutAQfnJOeKiOLSey0v/7E90a9W/fLpoNnjL+7uYS iLY/LIvsEIfUeNndL/W1kYetYS2/HctJ11AXpAHK/6AM0PIK61uNBSwvGZIxKb/CA0c8 m8IE+1m/f0Uzjyt5ihLkC17vwt/Ik5a7k+RVKza0acHw4DfoUs8RXs96ENmyP6plgfAx ygtQFKmwLWYkoGNQVP9VOOzdPbbC3ZKbqOFXCGPfN/HFFVh5/KO0vbk0hJfmbyagCG95 7xHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=e4QisK5dlRTGLzT7/Rg8a2odjBOSln7PHE3O27n2JN8=; b=Er5nphbc2jjLvkKVb7NwZC1Z2TBnm9dWzePwkDdH3uwmJAnHCCoM+3jZjlPFWosnu1 jIYk9FCLYRuwwsbXsc0Vm9x1npLmo1a53jVXyneW9pVVdTX1dHUvssj/8b2lp4zRoebC 64QUj8p0qGoWuaS2AoBBDmInDGEvWf3frQrlQ58Mx87xXzx2s16c5sTHyMQS0nNW/wqw VdhXrnNYBtew2uHUJDZkU8ByeMLZLyVCXqHV12PUIvgVwHF4JyOsYjrQxg9VDa2TV7QN IeeGVAy/AiSay0ASSInU+JiZ4LBxnTDPAOhPtT01dn6PgX7b6M5Hi4ggdfoXNgJ7Kwpr tj4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=trbg0frb; spf=pass (google.com: domain of baolin.wang@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=baolin.wang@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i7sor17597993pfd.71.2019.06.04.01.14.58 for (Google Transport Security); Tue, 04 Jun 2019 01:14:58 -0700 (PDT) Received-SPF: pass (google.com: domain of baolin.wang@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a62:d149:: with SMTP id t9mr14481108pfl.173.1559636097966; Tue, 04 Jun 2019 01:14:57 -0700 (PDT) X-Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id j4sm14818804pgc.56.2019.06.04.01.14.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jun 2019 01:14:57 -0700 (PDT) From: "Olof Johansson" To: adrian.hunter@intel.com, ulf.hansson@linaro.org, zhang.lyra@gmail.com, orsonzhai@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, olof@lixom.net Cc: baolin.wang@linaro.org, vincent.guittot@linaro.org, arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/9] dt-bindings: mmc: sprd: Add another optional clock documentation Date: Tue, 4 Jun 2019 16:14:22 +0800 Message-Id: <84abb6b282b1fbce0c39ebd2b42ca4c18118f863.1559635435.git.baolin.wang@linaro.org> In-Reply-To: References: In-Reply-To: References: X-TUID: XDXdPzLUjUD2 Precedence: Bulk List-Unsubscribe: Sender: patchwork-soc@linux.kernel.org List-Id: Mailing-List: list patchwork-soc@linux.kernel.org; contact patchwork-soc+owner@linux.kernel.org Delivered-To: mailing list patchwork-soc@linux.kernel.org Reply-To: patchwork-soc+owner@linux.kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.kernel.org; q=dns/txt; s=20140610; t=1562365554; bh=6gJqsIkoUAOCu1GSSg23gXXXkPrvVvXZB99WecS3SbI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=JnokgzPPFU9mLT69iYBU7QKYQdxBAfxxb6ZDqUahtUXJ/PQwu5DkZKwSj/o941wUf0y aUnhvwwl4DtWRRg3ySHq+5y5/f47g4QuljKT9Y/TefwyqQI9U79F33ALyArOpUOIxkfT2 eGxqehaH1HlheZx4CQ1RwLtC6wQJGpC0Plg= X-Virus-Scanned: ClamAV using ClamSMTP For some Spreadtrum platforms like SC9860 platform, we should enable another gate clock '2x_enable' to make the SD host controller work well. Thus add documentation for this optional clock. Signed-off-by: Baolin Wang --- .../devicetree/bindings/mmc/sdhci-sprd.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt b/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt index 45c9978..a285c77 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-sprd.txt @@ -14,6 +14,7 @@ Required properties: - clock-names: Should contain the following: "sdio" - SDIO source clock (required) "enable" - gate clock which used for enabling/disabling the device (required) + "2x_enable" - gate clock controlling the device for some special platforms (optional) Optional properties: - assigned-clocks: the same with "sdio" clock From patchwork Tue Jun 4 08:14:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 11033417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A62F014DB for ; Fri, 5 Jul 2019 22:25:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9465228A8C for ; Fri, 5 Jul 2019 22:25:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87B6828AAB; Fri, 5 Jul 2019 22:25:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,RCVD_IN_DNSWL_LOW, T_TVD_MIME_NO_HEADERS autolearn=ham version=3.3.1 Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A72B28A8C for ; Fri, 5 Jul 2019 22:25:55 +0000 (UTC) X-Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by groups.io with SMTP; Fri, 05 Jul 2019 15:25:54 -0700 X-Received: by mail-lj1-f193.google.com with SMTP id t28so10521377lje.9 for ; Fri, 05 Jul 2019 15:25:54 -0700 (PDT) X-Gm-Message-State: APjAAAWMMyj2OoBmeqCqH34GV58fSs5BGelHS6xrGlkuMnmMB6UOtcAC +RPX/VZNb7NJmBrcAHM9VxXLTIWlhlMrTg== X-Google-Smtp-Source: APXvYqwDOdQPUZYNPmULv07xpb1peAWtTGHWCFiWWlH+pT4hFQ/un+ZsYUmwS1MU9/Bc8a7mqreCbw== X-Received: by 2002:a2e:5b0f:: with SMTP id p15mr3292185ljb.82.1562365552394; Fri, 05 Jul 2019 15:25:52 -0700 (PDT) X-Received: from localhost (h85-30-9-151.cust.a3fiber.se. [85.30.9.151]) by smtp.gmail.com with ESMTPSA id e26sm2022656ljl.33.2019.07.05.15.25.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Jul 2019 15:25:52 -0700 (PDT) Resent-From: Olof Johansson Resent-Date: Fri, 5 Jul 2019 13:51:26 -0700 Resent-Message-ID: <20190705205126.fnw4l3m7wibts2vw@localhost> Resent-To: patchwork-soc@linux.kernel.org X-Received: by 2002:a05:6602:220a:0:0:0:0 with SMTP id n10csp5434862ion; Tue, 4 Jun 2019 01:15:02 -0700 (PDT) X-Received: by 2002:a62:82c2:: with SMTP id w185mr14625370pfd.202.1559636102805; Tue, 04 Jun 2019 01:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559636102; cv=none; d=google.com; s=arc-20160816; b=YeA08aKoqpEDmch8fyCQSMFsgwlwDdl2pNveF7bkGXvr4UN3TKTXmh3TV16W0Ngqd/ Oop8HLmk3Of2KmAczgGCmT8e0/plu1L+J3dKe9jJAe59ddqSFg4mCAEH0QUzmoNX1ThB pcDTds1o20j2rF1uBf5OZGsEOn9xbaVOrdKOrsJ2hT/JYjdm80iNQY7vU2bFgo/0iiV2 X1/CMQyV324Ln9mrgChcz4lQdewjegob0MEGCCobMBvDJJgJO2sTpt2uz6cPZbQX2Ydb naox1ng/AMNbGGT/vb8zdRlhVfn96GTnZM83hE3JX49sI4nofp3EheROnteLSNkjDTbV bjHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=FdrxifC9VKJDfmhJlZCtT+SJXQU8nyEdMzYOjCE23wE=; b=iIeRI8gow3UXeDzaRVIuZCWizwhrrHt9YbZQn6YABnh3iRdfJXYl2x+U6syMbX0Xe7 Nos8Yrwb5iivGmNF22nbjjRXYqyQsOf9qHLG5HaYMbsnRTpMp6s+jPcQcBv1rpeHADNy YzaXll0BMdQUMy07BZdxcSDpOUPujwJdfB9qa9T0dunQdyIiOPwD5MZT8UMISjcEyYbQ X+wwSTyV1M9NA6U+Bsy1a/ljy3l1Wn3ACJ5FuYfBf1A16d33TCCXiTBCY6esbDRe99zF OeeC3WJnHvN4wXL54feLpkuqSd6VIfUzaJzHg3VmkHW6ktpuL6YS4fXUrbQU59vVlVKY QTVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O+2GCVHo; spf=pass (google.com: domain of baolin.wang@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=baolin.wang@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x2sor6207409plo.58.2019.06.04.01.15.02 for (Google Transport Security); Tue, 04 Jun 2019 01:15:02 -0700 (PDT) Received-SPF: pass (google.com: domain of baolin.wang@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:7e0e:: with SMTP id b14mr9660980plm.257.1559636102504; Tue, 04 Jun 2019 01:15:02 -0700 (PDT) X-Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id j4sm14818804pgc.56.2019.06.04.01.14.58 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jun 2019 01:15:02 -0700 (PDT) From: "Olof Johansson" To: adrian.hunter@intel.com, ulf.hansson@linaro.org, zhang.lyra@gmail.com, orsonzhai@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de, olof@lixom.net Cc: baolin.wang@linaro.org, vincent.guittot@linaro.org, arm@kernel.org, linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 3/9] mmc: sdhci-sprd: Add optional gate clock support Date: Tue, 4 Jun 2019 16:14:23 +0800 Message-Id: <3bd7f5b0d4c78b75f8c4067a34f79396b4fd0a5c.1559635435.git.baolin.wang@linaro.org> In-Reply-To: References: In-Reply-To: References: X-TUID: lmv3KY25T5G5 Precedence: Bulk List-Unsubscribe: Sender: patchwork-soc@linux.kernel.org List-Id: Mailing-List: list patchwork-soc@linux.kernel.org; contact patchwork-soc+owner@linux.kernel.org Delivered-To: mailing list patchwork-soc@linux.kernel.org Reply-To: patchwork-soc+owner@linux.kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.kernel.org; q=dns/txt; s=20140610; t=1562365555; bh=RdrvU1jxOgzG4sLHU+EZqm1TGGwcKveDRYamTshIlgo=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=poNI5mTieOJzIMMjZ8ohf/gBDHvsF7750LBEz/tEHw0g81Tlw+bnWhDlKSxdtN+Yk6v gx1KP41dGwLVLziJG3NqTcB3rYfS0aBFwaT/Ra8QGTiU4PMlPcefrUq82YjzNV+PQSBwg FkvtNHYoQqtTzhZH89T6WeYEROnNpZH8dLU= X-Virus-Scanned: ClamAV using ClamSMTP For the Spreadtrum SC9860 platform, we should enable another gate clock '2x_enable' to make the SD host controller work well. Signed-off-by: Baolin Wang Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-sprd.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index e741491..31ba7d6 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -60,6 +60,7 @@ struct sdhci_sprd_host { u32 version; struct clk *clk_sdio; struct clk *clk_enable; + struct clk *clk_2x_enable; u32 base_rate; int flags; /* backup of host attribute */ }; @@ -364,6 +365,10 @@ static int sdhci_sprd_probe(struct platform_device *pdev) } sprd_host->clk_enable = clk; + clk = devm_clk_get(&pdev->dev, "2x_enable"); + if (!IS_ERR(clk)) + sprd_host->clk_2x_enable = clk; + ret = clk_prepare_enable(sprd_host->clk_sdio); if (ret) goto pltfm_free; @@ -372,6 +377,10 @@ static int sdhci_sprd_probe(struct platform_device *pdev) if (ret) goto clk_disable; + ret = clk_prepare_enable(sprd_host->clk_2x_enable); + if (ret) + goto clk_disable2; + sdhci_sprd_init_config(host); host->version = sdhci_readw(host, SDHCI_HOST_VERSION); sprd_host->version = ((host->version & SDHCI_VENDOR_VER_MASK) >> @@ -408,6 +417,9 @@ static int sdhci_sprd_probe(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); + clk_disable_unprepare(sprd_host->clk_2x_enable); + +clk_disable2: clk_disable_unprepare(sprd_host->clk_enable); clk_disable: @@ -427,6 +439,7 @@ static int sdhci_sprd_remove(struct platform_device *pdev) mmc_remove_host(mmc); clk_disable_unprepare(sprd_host->clk_sdio); clk_disable_unprepare(sprd_host->clk_enable); + clk_disable_unprepare(sprd_host->clk_2x_enable); mmc_free_host(mmc); @@ -449,6 +462,7 @@ static int sdhci_sprd_runtime_suspend(struct device *dev) clk_disable_unprepare(sprd_host->clk_sdio); clk_disable_unprepare(sprd_host->clk_enable); + clk_disable_unprepare(sprd_host->clk_2x_enable); return 0; } @@ -459,19 +473,28 @@ static int sdhci_sprd_runtime_resume(struct device *dev) struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host); int ret; - ret = clk_prepare_enable(sprd_host->clk_enable); + ret = clk_prepare_enable(sprd_host->clk_2x_enable); if (ret) return ret; + ret = clk_prepare_enable(sprd_host->clk_enable); + if (ret) + goto clk_2x_disable; + ret = clk_prepare_enable(sprd_host->clk_sdio); - if (ret) { - clk_disable_unprepare(sprd_host->clk_enable); - return ret; - } + if (ret) + goto clk_disable; sdhci_runtime_resume_host(host); - return 0; + +clk_disable: + clk_disable_unprepare(sprd_host->clk_enable); + +clk_2x_disable: + clk_disable_unprepare(sprd_host->clk_2x_enable); + + return ret; } #endif