diff options
-rw-r--r-- | drivers/mmc/core/core.c | 14 | ||||
-rw-r--r-- | include/linux/mmc/core.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index bccfd1858b0..aaed7687cf0 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -1958,6 +1958,20 @@ int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen) | |||
1958 | } | 1958 | } |
1959 | EXPORT_SYMBOL(mmc_set_blocklen); | 1959 | EXPORT_SYMBOL(mmc_set_blocklen); |
1960 | 1960 | ||
1961 | int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, | ||
1962 | bool is_rel_write) | ||
1963 | { | ||
1964 | struct mmc_command cmd = {0}; | ||
1965 | |||
1966 | cmd.opcode = MMC_SET_BLOCK_COUNT; | ||
1967 | cmd.arg = blockcount & 0x0000FFFF; | ||
1968 | if (is_rel_write) | ||
1969 | cmd.arg |= 1 << 31; | ||
1970 | cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC; | ||
1971 | return mmc_wait_for_cmd(card->host, &cmd, 5); | ||
1972 | } | ||
1973 | EXPORT_SYMBOL(mmc_set_blockcount); | ||
1974 | |||
1961 | static void mmc_hw_reset_for_init(struct mmc_host *host) | 1975 | static void mmc_hw_reset_for_init(struct mmc_host *host) |
1962 | { | 1976 | { |
1963 | if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) | 1977 | if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset) |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 9b9cdafc773..5bf7c2274fc 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -170,6 +170,8 @@ extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, | |||
170 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); | 170 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); |
171 | 171 | ||
172 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | 172 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); |
173 | extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount, | ||
174 | bool is_rel_write); | ||
173 | extern int mmc_hw_reset(struct mmc_host *host); | 175 | extern int mmc_hw_reset(struct mmc_host *host); |
174 | extern int mmc_hw_reset_check(struct mmc_host *host); | 176 | extern int mmc_hw_reset_check(struct mmc_host *host); |
175 | extern int mmc_can_reset(struct mmc_card *card); | 177 | extern int mmc_can_reset(struct mmc_card *card); |