@@ -2819,6 +2819,7 @@ static int dw_mci_init_slot_caps(struct dw_mci_slot *slot)
static int dw_mci_init_slot(struct dw_mci *host)
{
+ const struct dw_mci_drv_data *drv_data = host->drv_data;
struct mmc_host *mmc;
struct dw_mci_slot *slot;
int ret;
@@ -2876,6 +2877,9 @@ static int dw_mci_init_slot(struct dw_mci *host)
mmc->max_seg_size = mmc->max_req_size;
}
+ if (drv_data && drv_data->init_slot)
+ drv_data->init_slot(host);
+
dw_mci_get_cd(mmc);
ret = mmc_add_host(mmc);
@@ -548,6 +548,7 @@ struct dw_mci_slot {
* @caps: mmc subsystem specified capabilities of the controller(s).
* @num_caps: number of capabilities specified by @caps.
* @init: early implementation specific initialization.
+ * @init_slot: platform specific slot initialization.
* @set_ios: handle bus specific extensions.
* @parse_dt: parse implementation specific device tree properties.
* @execute_tuning: implementation specific tuning procedure.
@@ -560,6 +561,7 @@ struct dw_mci_drv_data {
unsigned long *caps;
u32 num_caps;
int (*init)(struct dw_mci *host);
+ void (*init_slot)(struct dw_mci *host);
void (*set_ios)(struct dw_mci *host, struct mmc_ios *ios);
int (*parse_dt)(struct dw_mci *host);
int (*execute_tuning)(struct dw_mci_slot *slot, u32 opcode);
The init_slot() hook allow platform driver override slot defaults provided by generic dw_mmc driver. It's required to fix EDMA based transfer hangs observed on rockchip rk3188. Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com> --- drivers/mmc/host/dw_mmc.c | 4 ++++ drivers/mmc/host/dw_mmc.h | 2 ++ 2 files changed, 6 insertions(+)