Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36553
b: refs/heads/master
c: db53f28
h: refs/heads/master
i:
  36551: 82fe240
v: v3
  • Loading branch information
Russell King authored and Russell King committed Sep 16, 2006
1 parent 748e353 commit bb712f7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 132919ba80ad207755fe271277bfefff865a54fe
refs/heads/master: db53f28b3a6d9338cca1b7e917dc063ac99e1871
27 changes: 20 additions & 7 deletions trunk/drivers/mmc/mmc_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/mmc/protocol.h>
#include <linux/mmc/host.h>

#include <asm/system.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -165,6 +166,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
do {
struct mmc_blk_request brq;
struct mmc_command cmd;
u32 readcmd, writecmd;

memset(&brq, 0, sizeof(struct mmc_blk_request));
brq.mrq.cmd = &brq.cmd;
Expand All @@ -180,20 +182,31 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)

mmc_set_data_timeout(&brq.data, card, rq_data_dir(req) != READ);

if (rq_data_dir(req) == READ) {
brq.cmd.opcode = brq.data.blocks > 1 ? MMC_READ_MULTIPLE_BLOCK : MMC_READ_SINGLE_BLOCK;
brq.data.flags |= MMC_DATA_READ;
} else {
brq.cmd.opcode = MMC_WRITE_BLOCK;
brq.data.flags |= MMC_DATA_WRITE;
/*
* If the host doesn't support multiple block writes, force
* block writes to single block.
*/
if (rq_data_dir(req) != READ &&
!(card->host->caps & MMC_CAP_MULTIWRITE))
brq.data.blocks = 1;
}

if (brq.data.blocks > 1) {
brq.data.flags |= MMC_DATA_MULTI;
brq.mrq.stop = &brq.stop;
readcmd = MMC_READ_MULTIPLE_BLOCK;
writecmd = MMC_WRITE_MULTIPLE_BLOCK;
} else {
brq.mrq.stop = NULL;
readcmd = MMC_READ_SINGLE_BLOCK;
writecmd = MMC_WRITE_BLOCK;
}

if (rq_data_dir(req) == READ) {
brq.cmd.opcode = readcmd;
brq.data.flags |= MMC_DATA_READ;
} else {
brq.cmd.opcode = writecmd;
brq.data.flags |= MMC_DATA_WRITE;
}

brq.data.sg = mq->sg;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/mmc/mmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ static int mmci_probe(struct amba_device *dev, void *id)
mmc->f_min = (host->mclk + 511) / 512;
mmc->f_max = min(host->mclk, fmax);
mmc->ocr_avail = plat->ocr_mask;
mmc->caps = MMC_CAP_MULTIWRITE;

/*
* We can do SGIO
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mmc/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
mmc->ops = &sdhci_ops;
mmc->f_min = host->max_clk / 256;
mmc->f_max = host->max_clk;
mmc->caps = MMC_CAP_4_BIT_DATA;
mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE;

mmc->ocr_avail = 0;
if (caps & SDHCI_CAN_VDD_330)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mmc/wbsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ static int __devinit wbsd_alloc_mmc(struct device *dev)
mmc->f_min = 375000;
mmc->f_max = 24000000;
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
mmc->caps = MMC_CAP_4_BIT_DATA;
mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE;

spin_lock_init(&host->lock);

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mmc/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ struct mmc_host {
unsigned long caps; /* Host capabilities */

#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
#define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */

/* host specific block data */
unsigned int max_seg_size; /* see blk_queue_max_segment_size */
Expand Down

0 comments on commit bb712f7

Please sign in to comment.