From: Chris Ball <cjb@laptop.org>
To: Alan Cox <alan@linux.intel.com>
Cc: Girish K S <girish.shivananjappa@linaro.org>, linux-mmc@vger.kernel.org
Subject: Re: [PATCH] goldfish: emulated MMC device
Date: Mon, 28 Jan 2013 17:04:29 -0500 [thread overview]
Message-ID: <87boc96k2a.fsf@laptop.org> (raw)
In-Reply-To: <20130122224701.5785e345@bob.linux.org.uk> (Alan Cox's message of "Tue, 22 Jan 2013 22:47:01 +0000")
Hi,
On Tue, Jan 22 2013, Alan Cox wrote:
>> does it support dt? i cannot see and table entry here? I think Nall ew
>> drivers added should be dt compatible.
>> there should be a of table entry here
>
> [..]
> Goldfish is an established platform used for most Android development
> work nowdays so we don't get to re-decide how it works just support it.
I agree that we should go ahead and merge this given that it's in
widespread use already.
Does anyone mind if I change the filename to
drivers/mmc/host/android-goldfish.c? Kconfig will stay the same.
I've also made trivial style edits and converted from ISO-8859 to
UTF-8, as attached.
Queued in mmc-next for 3.9, thanks,
- Chris.
diff --git a/drivers/mmc/host/goldfish.c b/drivers/mmc/host/goldfish.c
index 5763f78..ef3aef0 100644
--- a/drivers/mmc/host/goldfish.c
+++ b/drivers/mmc/host/goldfish.c
@@ -4,7 +4,7 @@
*
* based on omap.c driver, which was
* Copyright (C) 2004 Nokia Corporation
- * Written by Tuukka Tikkanen and Juha Yrjölä<juha.yrjola@nokia.com>
+ * Written by Tuukka Tikkanen and Juha Yrjölä <juha.yrjola@nokia.com>
* Misc hacks here and there by Tony Lindgren <tony@atomide.com>
* Other hacks (DMA, SD, etc) by David Brownell
*
@@ -58,7 +58,6 @@
#define GOLDFISH_MMC_READ(host, addr) (readl(host->reg_base + addr))
#define GOLDFISH_MMC_WRITE(host, addr, x) (writel(x, host->reg_base + addr))
-
enum {
/* status register */
MMC_INT_STATUS = 0x00,
@@ -140,12 +139,12 @@ goldfish_mmc_cover_is_open(struct goldfish_mmc_host *host)
static ssize_t
goldfish_mmc_show_cover_switch(struct device *dev,
- struct device_attribute *attr, char *buf)
+ struct device_attribute *attr, char *buf)
{
struct goldfish_mmc_host *host = dev_get_drvdata(dev);
return sprintf(buf, "%s\n", goldfish_mmc_cover_is_open(host) ? "open" :
- "closed");
+ "closed");
}
static DEVICE_ATTR(cover_switch, S_IRUGO, goldfish_mmc_show_cover_switch, NULL);
@@ -208,7 +207,7 @@ goldfish_mmc_start_command(struct goldfish_mmc_host *host, struct mmc_command *c
}
static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
- struct mmc_data *data)
+ struct mmc_data *data)
{
if (host->dma_in_use) {
enum dma_data_direction dma_data_dir;
@@ -228,13 +227,14 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
}
host->data->bytes_xfered += data->sg->length;
dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->sg_len,
- dma_data_dir);
+ dma_data_dir);
}
host->data = NULL;
host->sg_len = 0;
- /* NOTE: MMC layer will sometimes poll-wait CMD13 next, issuing
+ /*
+ * NOTE: MMC layer will sometimes poll-wait CMD13 next, issuing
* dozens of requests until the card finishes writing data.
* It'd be cheaper to just wait till an EOFB interrupt arrives...
*/
@@ -249,7 +249,7 @@ static void goldfish_mmc_xfer_done(struct goldfish_mmc_host *host,
}
static void goldfish_mmc_end_of_data(struct goldfish_mmc_host *host,
- struct mmc_data *data)
+ struct mmc_data *data)
{
if (!host->dma_in_use) {
goldfish_mmc_xfer_done(host, data);
@@ -260,7 +260,7 @@ static void goldfish_mmc_end_of_data(struct goldfish_mmc_host *host,
}
static void goldfish_mmc_cmd_done(struct goldfish_mmc_host *host,
- struct mmc_command *cmd)
+ struct mmc_command *cmd)
{
host->cmd = NULL;
if (cmd->flags & MMC_RSP_PRESENT) {
@@ -364,7 +364,7 @@ static irqreturn_t goldfish_mmc_irq(int irq, void *dev_id)
}
static void goldfish_mmc_prepare_data(struct goldfish_mmc_host *host,
- struct mmc_request *req)
+ struct mmc_request *req)
{
struct mmc_data *data = req->data;
int block_size;
@@ -384,7 +384,8 @@ static void goldfish_mmc_prepare_data(struct goldfish_mmc_host *host,
GOLDFISH_MMC_WRITE(host, MMC_BLOCK_COUNT, data->blocks - 1);
GOLDFISH_MMC_WRITE(host, MMC_BLOCK_LENGTH, block_size - 1);
- /* cope with calling layer confusion; it issues "single
+ /*
+ * Cope with calling layer confusion; it issues "single
* block" writes using multi-block scatterlists.
*/
sg_len = (data->blocks == 1) ? 1 : data->sg_len;
@@ -395,13 +396,15 @@ static void goldfish_mmc_prepare_data(struct goldfish_mmc_host *host,
dma_data_dir = DMA_FROM_DEVICE;
host->sg_len = dma_map_sg(mmc_dev(host->mmc), data->sg,
- sg_len, dma_data_dir);
+ sg_len, dma_data_dir);
host->dma_done = 0;
host->dma_in_use = 1;
if (dma_data_dir == DMA_TO_DEVICE) {
- /* we don't really have DMA, so we need to copy to our
- platform driver buffer */
+ /*
+ * We don't really have DMA, so we need to copy to our
+ * platform driver buffer
+ */
const uint8_t *src = (uint8_t *)sg_virt(data->sg);
memcpy(host->virt_base, src, data->sg->length);
}
@@ -417,10 +420,12 @@ static void goldfish_mmc_request(struct mmc_host *mmc, struct mmc_request *req)
goldfish_mmc_prepare_data(host, req);
goldfish_mmc_start_command(host, req->cmd);
- /* this is to avoid accidentally being detected as an SDIO card
- in mmc_attach_sdio() */
+ /*
+ * This is to avoid accidentally being detected as an SDIO card
+ * in mmc_attach_sdio().
+ */
if (req->cmd->opcode == SD_IO_SEND_OP_COND &&
- req->cmd->flags == (MMC_RSP_SPI_R4 | MMC_RSP_R4 | MMC_CMD_BCR))
+ req->cmd->flags == (MMC_RSP_SPI_R4 | MMC_RSP_R4 | MMC_CMD_BCR))
req->cmd->error = -EINVAL;
}
@@ -477,7 +482,7 @@ static int goldfish_mmc_probe(struct platform_device *pdev)
goto ioremap_failed;
}
host->virt_base = dma_alloc_coherent(&pdev->dev, BUFFER_SIZE,
- &buf_addr, GFP_KERNEL);
+ &buf_addr, GFP_KERNEL);
if (host->virt_base == 0) {
ret = -ENOMEM;
@@ -507,7 +512,6 @@ static int goldfish_mmc_probe(struct platform_device *pdev)
ret = request_irq(host->irq, goldfish_mmc_irq, 0, DRIVER_NAME, host);
if (ret) {
dev_err(&pdev->dev, "Failed IRQ Adding goldfish MMC\n");
-
goto err_request_irq_failed;
}
@@ -517,19 +521,19 @@ static int goldfish_mmc_probe(struct platform_device *pdev)
ret = device_create_file(&pdev->dev, &dev_attr_cover_switch);
if (ret)
dev_warn(mmc_dev(host->mmc),
- "Unable to create sysfs attributes\n");
+ "Unable to create sysfs attributes\n");
GOLDFISH_MMC_WRITE(host, MMC_SET_BUFFER, host->phys_base);
GOLDFISH_MMC_WRITE(host, MMC_INT_ENABLE,
- MMC_STAT_END_OF_CMD | MMC_STAT_END_OF_DATA |
- MMC_STAT_STATE_CHANGE | MMC_STAT_CMD_TIMEOUT);
+ MMC_STAT_END_OF_CMD | MMC_STAT_END_OF_DATA |
+ MMC_STAT_STATE_CHANGE | MMC_STAT_CMD_TIMEOUT);
mmc_add_host(mmc);
return 0;
err_request_irq_failed:
dma_free_coherent(&pdev->dev, BUFFER_SIZE, host->virt_base,
- host->phys_base);
+ host->phys_base);
dma_alloc_failed:
iounmap(host->reg_base);
ioremap_failed:
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
prev parent reply other threads:[~2013-01-28 22:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 23:43 [PATCH] goldfish: emulated MMC device Alan Cox
2013-01-22 9:15 ` Girish K S
2013-01-22 22:47 ` Alan Cox
2013-01-28 22:04 ` Chris Ball [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87boc96k2a.fsf@laptop.org \
--to=cjb@laptop.org \
--cc=alan@linux.intel.com \
--cc=girish.shivananjappa@linaro.org \
--cc=linux-mmc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).