Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031608AbbD2Bff (ORCPT ); Tue, 28 Apr 2015 21:35:35 -0400 Received: from rtits2.realtek.com ([60.250.210.242]:58626 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031490AbbD2Bep (ORCPT ); Tue, 28 Apr 2015 21:34:45 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.52 with qID t3T1YLkx013419, This message is accepted by code: ctloc85258 From: To: , , CC: , , , , , , , Micky Ching Subject: [PATCH 10/12] mmc: sdhci: disable clock control for SD4.0 mode Date: Wed, 29 Apr 2015 09:23:42 +0800 Message-ID: <8dae3acf6ece45ee4698991c1409dd5d45ff3cfe.1429845922.git.micky_ching@realsil.com.cn> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.29.41.103] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2769 Lines: 80 From: Micky Ching Skip clock control settings for UHSII mode. When card is in UHSII mode, we only allow poweroff. Signed-off-by: Micky Ching Signed-off-by: Wei Wang --- drivers/mmc/host/sdhci.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 3c56944..03df58c 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1346,7 +1346,8 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) host->mmc->actual_clock = 0; - sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); + if (!host->uhsii_if_enabled) + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); if (clock == 0) return; @@ -1686,7 +1687,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) !(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN)) sdhci_enable_preset_value(host, false); - if (!ios->clock || ios->clock != host->clock) { + if (!host->uhsii_if_enabled && + (!ios->clock || ios->clock != host->clock)) { host->ops->set_clock(host, ios->clock); host->clock = ios->clock; @@ -1703,7 +1705,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) } } - sdhci_set_power(host, ios->power_mode, ios->vdd); + if (!(host->uhsii_if_enabled && (ios->power_mode != MMC_POWER_OFF))) + sdhci_set_power(host, ios->power_mode, ios->vdd); if (host->ops->platform_send_init_74_clocks) host->ops->platform_send_init_74_clocks(host, ios->power_mode); @@ -1765,10 +1768,12 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) host->ops->set_clock(host, host->clock); } - /* Reset SD Clock Enable */ - clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); - clk &= ~SDHCI_CLOCK_CARD_EN; - sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); + if (!host->uhsii_if_enabled) { + /* Reset SD Clock Enable */ + clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); + clk &= ~SDHCI_CLOCK_CARD_EN; + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); + } host->ops->set_uhs_signaling(host, ios->timing); host->timing = ios->timing; @@ -1788,7 +1793,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) } /* Re-enable SD Clock */ - host->ops->set_clock(host, host->clock); + if (!host->uhsii_if_enabled) + host->ops->set_clock(host, host->clock); } else sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/