12 #include <linux/export.h>
32 mmc_claim_host(func->
card->host);
74 reg |= 1 << func->
num;
86 if (reg & (1 << func->
num))
124 reg &= ~(1 << func->
num);
163 if (blksz > func->
card->host->max_blk_size)
168 blksz =
min(blksz, 512
u);
178 (blksz >> 8) & 0xff,
NULL);
189 static inline unsigned int sdio_max_byte_size(
struct sdio_func *
func)
191 unsigned mval =
min(func->
card->host->max_seg_size,
192 func->
card->host->max_blk_size);
194 if (mmc_blksz_for_byte_mode(func->
card))
199 if (mmc_card_broken_byte_mode_512(func->
card))
200 return min(mval, 511
u);
202 return min(mval, 512
u);
221 unsigned int orig_sz;
222 unsigned int blk_sz, byte_sz;
238 if (sz <= sdio_max_byte_size(func))
241 if (func->
card->cccr.multi_block) {
269 if (byte_sz <= sdio_max_byte_size(func)) {
279 sdio_max_byte_size(func));
280 if (chunk_sz == sdio_max_byte_size(func)) {
284 byte_sz = orig_sz % chunk_sz;
290 return (orig_sz / chunk_sz) * chunk_sz + byte_sz;
304 static int sdio_io_rw_ext_helper(
struct sdio_func *func,
int write,
307 unsigned remainder =
size;
312 if (func->
card->cccr.multi_block && (size > sdio_max_byte_size(func))) {
316 max_blocks =
min(func->
card->host->max_blk_count,
318 max_blocks =
min(max_blocks, 511
u);
324 if (blocks > max_blocks)
329 func->
num, addr, incr_addr, buf,
342 while (remainder > 0) {
343 size =
min(remainder, sdio_max_byte_size(func));
347 incr_addr, buf, 0, size);
427 unsigned int addr,
int *err_ret)
454 unsigned int addr,
int count)
456 return sdio_io_rw_ext_helper(func, 0, addr, 1, dst, count);
473 return sdio_io_rw_ext_helper(func, 1, addr, 1, src, count);
490 return sdio_io_rw_ext_helper(func, 0, addr, 0, dst, count);
507 return sdio_io_rw_ext_helper(func, 1, addr, 0, src, count);
667 if ((addr < 0xF0 || addr > 0xFF) && (!mmc_card_lenient_fn0(func->
card))) {
694 return func->
card->host->pm_caps;
717 host = func->
card->host;