Skip to content

Commit f21adcb

Browse files
lsun100storulf
authored andcommitted
mmc: dw_mmc: Add support for platform specific eMMC HW reset
This commit adds a new callback to allow drivers to support platform specific eMMC HW reset. Reviewed-by: David Thompson <[email protected]> Signed-off-by: Liming Sun <[email protected]> Link: https://lore.kernel.org/r/3df02ffa8bdaa74f5261c8914d2545b97fb3478a.1718213918.git.limings@nvidia.com Signed-off-by: Ulf Hansson <[email protected]>
1 parent 1535085 commit f21adcb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/mmc/host/dw_mmc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,7 @@ static void dw_mci_hw_reset(struct mmc_host *mmc)
16171617
{
16181618
struct dw_mci_slot *slot = mmc_priv(mmc);
16191619
struct dw_mci *host = slot->host;
1620+
const struct dw_mci_drv_data *drv_data = host->drv_data;
16201621
int reset;
16211622

16221623
if (host->use_dma == TRANS_MODE_IDMAC)
@@ -1626,6 +1627,11 @@ static void dw_mci_hw_reset(struct mmc_host *mmc)
16261627
SDMMC_CTRL_FIFO_RESET))
16271628
return;
16281629

1630+
if (drv_data && drv_data->hw_reset) {
1631+
drv_data->hw_reset(host);
1632+
return;
1633+
}
1634+
16291635
/*
16301636
* According to eMMC spec, card reset procedure:
16311637
* tRstW >= 1us: RST_n pulse width

drivers/mmc/host/dw_mmc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ struct dw_mci_slot {
566566
* @execute_tuning: implementation specific tuning procedure.
567567
* @set_data_timeout: implementation specific timeout.
568568
* @get_drto_clks: implementation specific cycle count for data read timeout.
569+
* @hw_reset: implementation specific HW reset.
569570
*
570571
* Provide controller implementation specific extensions. The usage of this
571572
* data structure is fully optional and usage of each member in this structure
@@ -586,5 +587,6 @@ struct dw_mci_drv_data {
586587
void (*set_data_timeout)(struct dw_mci *host,
587588
unsigned int timeout_ns);
588589
u32 (*get_drto_clks)(struct dw_mci *host);
590+
void (*hw_reset)(struct dw_mci *host);
589591
};
590592
#endif /* _DW_MMC_H_ */

0 commit comments

Comments
 (0)