aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorBing Zhao <bzhao@marvell.com>2010-03-05 16:43:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:36 -0500
commit3fb7fb4a01d09f81d1daaf65e52d929734bd691f (patch)
tree8feac2d211f833fc1ef287aba3b138886454f45c /drivers/mmc
parent729adf1b5f4562f67fe8bf6c1df97edc1128fac7 (diff)
sdio: add quirk to clamp byte mode transfer
Some SDIO cards expect byte transfers not to exceed the configured block transfer size. Add a quirk to that effect. Patches to make use of this quirk will be sent separately. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Nicolas Pitre <nico@marvell.com> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/sdio_io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
index f9aa8a7deffa..87c618904ee2 100644
--- a/drivers/mmc/core/sdio_io.c
+++ b/drivers/mmc/core/sdio_io.c
@@ -189,7 +189,12 @@ static inline unsigned int sdio_max_byte_size(struct sdio_func *func)
189{ 189{
190 unsigned mval = min(func->card->host->max_seg_size, 190 unsigned mval = min(func->card->host->max_seg_size,
191 func->card->host->max_blk_size); 191 func->card->host->max_blk_size);
192 mval = min(mval, func->max_blksize); 192
193 if (mmc_blksz_for_byte_mode(func->card))
194 mval = min(mval, func->cur_blksize);
195 else
196 mval = min(mval, func->max_blksize);
197
193 return min(mval, 512u); /* maximum size for byte mode */ 198 return min(mval, 512u); /* maximum size for byte mode */
194} 199}
195 200