Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751957AbdLUJBk (ORCPT ); Thu, 21 Dec 2017 04:01:40 -0500 Received: from mga01.intel.com ([192.55.52.88]:50118 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163AbdLUJBf (ORCPT ); Thu, 21 Dec 2017 04:01:35 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,435,1508828400"; d="scan'208";a="15441604" Subject: Re: [PATCH 03/12] mmc: sdhci-omap: Add custom set_uhs_signaling sdhci_host ops To: Kishon Vijay Abraham I , Ulf Hansson , Rob Herring , Tony Lindgren Cc: Mark Rutland , Russell King , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nsekhar@ti.com References: <20171214130941.26666-1-kishon@ti.com> <20171214130941.26666-4-kishon@ti.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <7120e913-56c5-f04f-b61e-0e35b474ce84@intel.com> Date: Thu, 21 Dec 2017 11:01:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171214130941.26666-4-kishon@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2651 Lines: 79 On 14/12/17 15:09, Kishon Vijay Abraham I wrote: > UHS-1 DDR50 and MMC DDR52 mode require DDR bit to be > set in the configuration register (MMCHS_CON). Add > sdhci-omap specific set_uhs_signaling ops to set > this bit. Also while setting the UHSMS bit, clock should be > disabled. > > Signed-off-by: Kishon Vijay Abraham I Apart from 1 minor comment below: Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-omap.c | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c > index defe4eac020d..8f7239e2edc2 100644 > --- a/drivers/mmc/host/sdhci-omap.c > +++ b/drivers/mmc/host/sdhci-omap.c > @@ -31,6 +31,7 @@ > #define SDHCI_OMAP_CON 0x12c > #define CON_DW8 BIT(5) > #define CON_DMA_MASTER BIT(20) > +#define CON_DDR BIT(19) > #define CON_CLKEXTFREE BIT(16) > #define CON_PADEN BIT(15) > #define CON_INIT BIT(1) > @@ -93,6 +94,9 @@ struct sdhci_omap_host { > u8 power_mode; > }; > > +static void sdhci_omap_start_clock(struct sdhci_omap_host *omap_host); > +static void sdhci_omap_stop_clock(struct sdhci_omap_host *omap_host); These forward declarations aren't needed are they. > + > static inline u32 sdhci_omap_readl(struct sdhci_omap_host *host, > unsigned int offset) > { > @@ -471,6 +475,26 @@ static void sdhci_omap_init_74_clocks(struct sdhci_host *host, u8 power_mode) > enable_irq(host->irq); > } > > +static void sdhci_omap_set_uhs_signaling(struct sdhci_host *host, > + unsigned int timing) > +{ > + u32 reg; > + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > + struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host); > + > + sdhci_omap_stop_clock(omap_host); > + > + reg = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON); > + if (timing == MMC_TIMING_UHS_DDR50 || timing == MMC_TIMING_MMC_DDR52) > + reg |= CON_DDR; > + else > + reg &= ~CON_DDR; > + sdhci_omap_writel(omap_host, SDHCI_OMAP_CON, reg); > + > + sdhci_set_uhs_signaling(host, timing); > + sdhci_omap_start_clock(omap_host); > +} > + > static struct sdhci_ops sdhci_omap_ops = { > .set_clock = sdhci_omap_set_clock, > .set_power = sdhci_omap_set_power, > @@ -480,7 +504,7 @@ static struct sdhci_ops sdhci_omap_ops = { > .set_bus_width = sdhci_omap_set_bus_width, > .platform_send_init_74_clocks = sdhci_omap_init_74_clocks, > .reset = sdhci_reset, > - .set_uhs_signaling = sdhci_set_uhs_signaling, > + .set_uhs_signaling = sdhci_omap_set_uhs_signaling, > }; > > static int sdhci_omap_set_capabilities(struct sdhci_omap_host *omap_host) >