Hi Wolfram: It's better that the mdelay(100) is replaced by some litter value such as 10ms and so on, since I encounter one bug ever when this values is set to 100. The audio playback would be noised by the sd/mmc insertion/extraction operations. Best Regards Richard Zhu > -----Original Message----- > From: Chris Ball [mailto:cjb@xxxxxxxxxx] > Sent: Tuesday, October 12, 2010 2:33 AM > To: Wolfram Sang > Cc: linux-mmc@xxxxxxxxxxxxxxx; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; Zhu > Richard-R65037 > Subject: Re: [PATCH v2 5/6] mmc: sdhci-of-esdhc: factor out common stuff > > Hi Wolfram, > > On Mon, Oct 11, 2010 at 07:10:32PM +0200, Wolfram Sang wrote: > > +static inline void esdhc_set_clock(struct sdhci_host *host, unsigned > > +int clock) { > > + int pre_div = 2; > > + int div = 1; > > + u32 temp; > > + > > + temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL); > > + temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN > > + | ESDHC_CLOCK_MASK); > > + sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL); > > + > > + if (clock == 0) > > + goto out; > > + > > + while (host->max_clk / pre_div / 16 > clock && pre_div < 256) > > + pre_div *= 2; > > + > > + while (host->max_clk / pre_div / div > clock && div < 16) > > + div++; > > + > > + dev_dbg(mmc_dev(host->mmc), "desired SD clock: %d, actual: %d\n", > > + clock, host->max_clk / pre_div / div); > > + > > + pre_div >>= 1; > > + div--; > > + > > + temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL); > > + temp |= (ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN > > + | (div << ESDHC_DIVIDER_SHIFT) > > + | (pre_div << ESDHC_PREDIV_SHIFT)); > > + sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL); > > + mdelay(100); > > This isn't directly related to this patchset (the code was there > beforehand), but it would be nice to rework the mdelay(100). > > Thanks, > > -- > Chris Ball <cjb@xxxxxxxxxx> <http://printf.net/> > One Laptop Per Child -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html