diff options
-rw-r--r-- | drivers/mmc/core/sdio_io.c | 2 | ||||
-rw-r--r-- | include/linux/mmc/card.h | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c index f61fc2d4cd0a..f9aa8a7deffa 100644 --- a/drivers/mmc/core/sdio_io.c +++ b/drivers/mmc/core/sdio_io.c | |||
@@ -624,7 +624,7 @@ void sdio_f0_writeb(struct sdio_func *func, unsigned char b, unsigned int addr, | |||
624 | 624 | ||
625 | BUG_ON(!func); | 625 | BUG_ON(!func); |
626 | 626 | ||
627 | if (addr < 0xF0 || addr > 0xFF) { | 627 | if ((addr < 0xF0 || addr > 0xFF) && (!mmc_card_lenient_fn0(func->card))) { |
628 | if (err_ret) | 628 | if (err_ret) |
629 | *err_ret = -EINVAL; | 629 | *err_ret = -EINVAL; |
630 | return; | 630 | return; |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 00db39cceadc..2ee22e8af110 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -97,6 +97,8 @@ struct mmc_card { | |||
97 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ | 97 | #define MMC_STATE_READONLY (1<<1) /* card is read-only */ |
98 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ | 98 | #define MMC_STATE_HIGHSPEED (1<<2) /* card is in high speed mode */ |
99 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ | 99 | #define MMC_STATE_BLOCKADDR (1<<3) /* card uses block-addressing */ |
100 | unsigned int quirks; /* card quirks */ | ||
101 | #define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */ | ||
100 | 102 | ||
101 | u32 raw_cid[4]; /* raw card CID */ | 103 | u32 raw_cid[4]; /* raw card CID */ |
102 | u32 raw_csd[4]; /* raw card CSD */ | 104 | u32 raw_csd[4]; /* raw card CSD */ |
@@ -132,6 +134,11 @@ struct mmc_card { | |||
132 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 134 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
133 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 135 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
134 | 136 | ||
137 | static inline int mmc_card_lenient_fn0(const struct mmc_card *c) | ||
138 | { | ||
139 | return c->quirks & MMC_QUIRK_LENIENT_FN0; | ||
140 | } | ||
141 | |||
135 | #define mmc_card_name(c) ((c)->cid.prod_name) | 142 | #define mmc_card_name(c) ((c)->cid.prod_name) |
136 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 143 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
137 | 144 | ||