aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/core/mmc_ops.h
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2021-05-04 18:12:12 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2021-06-14 13:57:35 +0200
commite62f1e0b2384e25fe61042da3ecf08b7d8262f8d (patch)
tree6411894d927f4cc69d959cb7636c06e0c484ecd0 /drivers/mmc/core/mmc_ops.h
parent94ee6782e045645abd9180ab9369b01293d862bd (diff)
mmc: core: Drop open coding when preparing commands with busy signaling
Similar code for validating the host->max_busy_timeout towards the current command's busy timeout, exists in mmc_do_erase(), mmc_sleep() and __mmc_switch(). Let's move the common code into a helper function. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Acked-by: Avri Altman <avri.altman@wdc.com> Link: https://lore.kernel.org/r/20210504161222.101536-2-ulf.hansson@linaro.org
Diffstat (limited to 'drivers/mmc/core/mmc_ops.h')
-rw-r--r--drivers/mmc/core/mmc_ops.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
index 7bc1cfb0654c..ba898c435658 100644
--- a/drivers/mmc/core/mmc_ops.h
+++ b/drivers/mmc/core/mmc_ops.h
@@ -18,6 +18,7 @@ enum mmc_busy_cmd {
struct mmc_host;
struct mmc_card;
+struct mmc_command;
int mmc_select_card(struct mmc_card *card);
int mmc_deselect_cards(struct mmc_host *host);
@@ -35,6 +36,8 @@ int mmc_bus_test(struct mmc_card *card, u8 bus_width);
int mmc_can_ext_csd(struct mmc_card *card);
int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
int mmc_switch_status(struct mmc_card *card, bool crc_err_fatal);
+bool mmc_prepare_busy_cmd(struct mmc_host *host, struct mmc_command *cmd,
+ unsigned int timeout_ms);
int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
enum mmc_busy_cmd busy_cmd);
int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,