diff options
Diffstat (limited to 'drivers/mmc/host/atmel-mci.c')
-rw-r--r-- | drivers/mmc/host/atmel-mci.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 0bd06f5bd62f..00008967ef7a 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -195,7 +195,9 @@ static int atmci_regs_show(struct seq_file *s, void *v) | |||
195 | 195 | ||
196 | /* Grab a more or less consistent snapshot */ | 196 | /* Grab a more or less consistent snapshot */ |
197 | spin_lock_irq(&host->mmc->lock); | 197 | spin_lock_irq(&host->mmc->lock); |
198 | clk_enable(host->mck); | ||
198 | memcpy_fromio(buf, host->regs, MCI_REGS_SIZE); | 199 | memcpy_fromio(buf, host->regs, MCI_REGS_SIZE); |
200 | clk_disable(host->mck); | ||
199 | spin_unlock_irq(&host->mmc->lock); | 201 | spin_unlock_irq(&host->mmc->lock); |
200 | 202 | ||
201 | seq_printf(s, "MR:\t0x%08x%s%s CLKDIV=%u\n", | 203 | seq_printf(s, "MR:\t0x%08x%s%s CLKDIV=%u\n", |
@@ -216,6 +218,8 @@ static int atmci_regs_show(struct seq_file *s, void *v) | |||
216 | atmci_show_status_reg(s, "SR", buf[MCI_SR / 4]); | 218 | atmci_show_status_reg(s, "SR", buf[MCI_SR / 4]); |
217 | atmci_show_status_reg(s, "IMR", buf[MCI_IMR / 4]); | 219 | atmci_show_status_reg(s, "IMR", buf[MCI_IMR / 4]); |
218 | 220 | ||
221 | kfree(buf); | ||
222 | |||
219 | return 0; | 223 | return 0; |
220 | } | 224 | } |
221 | 225 | ||
@@ -237,7 +241,6 @@ static void atmci_init_debugfs(struct atmel_mci *host) | |||
237 | struct mmc_host *mmc; | 241 | struct mmc_host *mmc; |
238 | struct dentry *root; | 242 | struct dentry *root; |
239 | struct dentry *node; | 243 | struct dentry *node; |
240 | struct resource *res; | ||
241 | 244 | ||
242 | mmc = host->mmc; | 245 | mmc = host->mmc; |
243 | root = mmc->debugfs_root; | 246 | root = mmc->debugfs_root; |
@@ -251,9 +254,6 @@ static void atmci_init_debugfs(struct atmel_mci *host) | |||
251 | if (!node) | 254 | if (!node) |
252 | goto err; | 255 | goto err; |
253 | 256 | ||
254 | res = platform_get_resource(host->pdev, IORESOURCE_MEM, 0); | ||
255 | node->d_inode->i_size = res->end - res->start + 1; | ||
256 | |||
257 | node = debugfs_create_file("req", S_IRUSR, root, host, &atmci_req_fops); | 257 | node = debugfs_create_file("req", S_IRUSR, root, host, &atmci_req_fops); |
258 | if (!node) | 258 | if (!node) |
259 | goto err; | 259 | goto err; |
@@ -426,8 +426,6 @@ static u32 atmci_submit_data(struct mmc_host *mmc, struct mmc_data *data) | |||
426 | host->sg = NULL; | 426 | host->sg = NULL; |
427 | host->data = data; | 427 | host->data = data; |
428 | 428 | ||
429 | mci_writel(host, BLKR, MCI_BCNT(data->blocks) | ||
430 | | MCI_BLKLEN(data->blksz)); | ||
431 | dev_vdbg(&mmc->class_dev, "BLKR=0x%08x\n", | 429 | dev_vdbg(&mmc->class_dev, "BLKR=0x%08x\n", |
432 | MCI_BCNT(data->blocks) | MCI_BLKLEN(data->blksz)); | 430 | MCI_BCNT(data->blocks) | MCI_BLKLEN(data->blksz)); |
433 | 431 | ||
@@ -483,6 +481,10 @@ static void atmci_request(struct mmc_host *mmc, struct mmc_request *mrq) | |||
483 | if (data->blocks > 1 && data->blksz & 3) | 481 | if (data->blocks > 1 && data->blksz & 3) |
484 | goto fail; | 482 | goto fail; |
485 | atmci_set_timeout(host, data); | 483 | atmci_set_timeout(host, data); |
484 | |||
485 | /* Must set block count/size before sending command */ | ||
486 | mci_writel(host, BLKR, MCI_BCNT(data->blocks) | ||
487 | | MCI_BLKLEN(data->blksz)); | ||
486 | } | 488 | } |
487 | 489 | ||
488 | iflags = MCI_CMDRDY; | 490 | iflags = MCI_CMDRDY; |
@@ -1059,6 +1061,10 @@ static int __init atmci_probe(struct platform_device *pdev) | |||
1059 | host->present = !gpio_get_value(host->detect_pin); | 1061 | host->present = !gpio_get_value(host->detect_pin); |
1060 | } | 1062 | } |
1061 | } | 1063 | } |
1064 | |||
1065 | if (!gpio_is_valid(host->detect_pin)) | ||
1066 | mmc->caps |= MMC_CAP_NEEDS_POLL; | ||
1067 | |||
1062 | if (gpio_is_valid(host->wp_pin)) { | 1068 | if (gpio_is_valid(host->wp_pin)) { |
1063 | if (gpio_request(host->wp_pin, "mmc_wp")) { | 1069 | if (gpio_request(host->wp_pin, "mmc_wp")) { |
1064 | dev_dbg(&mmc->class_dev, "no WP pin available\n"); | 1070 | dev_dbg(&mmc->class_dev, "no WP pin available\n"); |