mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
mmc: core: Add mmc_set_blockcount feature
Provide support for automatically sending Set Block Count (CMD23) messages. Used at least for RPMB support. Signed-off-by: Alex Macro <[email protected]> Signed-off-by: Loic Pallardy <[email protected]> Reviewed-by: Namjae Jeon <[email protected]> Acked-by: Linus Walleij <[email protected]> Acked-by: Johan Rudholm <[email protected]> Acked-by: Krishna Konda <[email protected]> Signed-off-by: Chris Ball <[email protected]>
This commit is contained in:
parent
188cc0424e
commit
67c79db8d9
2 changed files with 16 additions and 0 deletions
|
|
@ -1958,6 +1958,20 @@ int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen)
|
|||
}
|
||||
EXPORT_SYMBOL(mmc_set_blocklen);
|
||||
|
||||
int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount,
|
||||
bool is_rel_write)
|
||||
{
|
||||
struct mmc_command cmd = {0};
|
||||
|
||||
cmd.opcode = MMC_SET_BLOCK_COUNT;
|
||||
cmd.arg = blockcount & 0x0000FFFF;
|
||||
if (is_rel_write)
|
||||
cmd.arg |= 1 << 31;
|
||||
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
|
||||
return mmc_wait_for_cmd(card->host, &cmd, 5);
|
||||
}
|
||||
EXPORT_SYMBOL(mmc_set_blockcount);
|
||||
|
||||
static void mmc_hw_reset_for_init(struct mmc_host *host)
|
||||
{
|
||||
if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
|
||||
|
|
|
|||
Loading…
Reference in a new issue