Re: [PATCH 3/3] drivers/mci: add PXA host controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Robert,

On Tue, Dec 06, 2011 at 09:11:58PM +0100, Robert Jarzmik wrote:
> Add a simple PIO based host controller for MMC and SD cards
> on PXA SoCs. Reads and writes are available, and no usage is
> made of DMA or IRQs.
> SPI mode is not supported yet.
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@xxxxxxx>
> ---
>  drivers/mci/Kconfig  |    7 +
>  drivers/mci/Makefile |    1 +
>  drivers/mci/pxamci.c |  357 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  drivers/mci/pxamci.h |   99 ++++++++++++++
>  4 files changed, 464 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/mci/pxamci.c
>  create mode 100644 drivers/mci/pxamci.h
> 
> +
> +static void pxamci_stop_clock(struct pxamci_host *host)
> +{
> +	unsigned long timeout = 10000;
> +	unsigned int v;
> +
> +	if (mmc_readl(MMC_STAT) & STAT_CLK_EN) {
> +		writel(STOP_CLOCK, host->base + MMC_STRPCL);
> +
> +		do {
> +			v = mmc_readl(MMC_STAT);
> +			if (!(v & STAT_CLK_EN))
> +				break;
> +			udelay(1);
> +		} while (timeout--);

please use this for timeout loops:

	uint64_t start = get_time_ns(void);

	while (!is_timeout(start, 10 * MSECOND)
		poll_something();

Otherwise the driver looks good to me.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux