[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <537FD9A7.3010100@codeaurora.org>
Date: Fri, 23 May 2014 16:28:39 -0700
From: Stephen Boyd <sboyd@...eaurora.org>
To: srinivas.kandagatla@...aro.org
CC: Russell King <linux@....linux.org.uk>,
Ulf Hansson <ulf.hansson@...aro.org>,
linux-mmc@...r.kernel.org, Chris Ball <chris@...ntf.net>,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linus.walleij@...aro.org
Subject: Re: [PATCH v3 13/13] mmc: mmci: Add Qcom specific pio_read function.
On 05/23/14 05:53, srinivas.kandagatla@...aro.org wrote:
> @@ -1022,6 +1025,40 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
> }
> }
>
> +static int mmci_qcom_pio_read(struct mmci_host *host, char *buffer,
> + unsigned int remain)
> +{
> + u32 *ptr = (u32 *) buffer;
> + unsigned int count = 0;
> + unsigned int words, bytes;
> + unsigned int fsize = host->variant->fifosize;
> +
> + words = remain >> 2;
> + bytes = remain % 4;
> + /* read full words followed by leftover bytes */
> + if (words) {
> + while (readl(host->base + MMCISTATUS) & MCI_RXDATAAVLBL) {
> + *ptr = readl(host->base + MMCIFIFO + (count % fsize));
This doesn't look endianness agnostic. Shouldn't we use ioread32_rep()
to read this fifo?
> + ptr++;
> + count += 4;
> + words--;
> + if (!words)
> + break;
> + }
> + }
> +
> + if (unlikely(bytes)) {
> + unsigned char buf[4];
> + if (readl(host->base + MMCISTATUS) & MCI_RXDATAAVLBL) {
> + *buf = readl(host->base + MMCIFIFO + (count % fsize));
> + memcpy(ptr, buf, bytes);
> + count += bytes;
> + }
> + }
> +
> + return count;
> +}
> +
> static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int remain)
> {
> void __iomem *base = host->base;
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists