Lines Matching refs:mmc

91 	struct mmc mmc;  member
128 struct mmc *mmc; member
254 static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc, in esdhc_setup_data() argument
340 timeout = fls(mmc->clock/2); in esdhc_setup_data()
389 static int esdhc_send_cmd_common(struct fsl_esdhc_priv *priv, struct mmc *mmc, in esdhc_send_cmd_common() argument
424 err = esdhc_setup_data(priv, mmc, data); in esdhc_send_cmd_common()
443 | (mmc->ddr_mode ? XFERTYP_DDREN : 0)); in esdhc_send_cmd_common()
572 static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) in set_sysctl() argument
586 int ddr_pre_div = mmc->ddr_mode ? 2 : 1; in set_sysctl()
590 if (clock < mmc->cfg->f_min) in set_sysctl()
591 clock = mmc->cfg->f_min; in set_sysctl()
678 static void esdhc_reset_tuning(struct mmc *mmc) in esdhc_reset_tuning() argument
680 struct fsl_esdhc_priv *priv = dev_get_priv(mmc->dev); in esdhc_reset_tuning()
692 static int esdhc_set_timing(struct mmc *mmc) in esdhc_set_timing() argument
694 struct fsl_esdhc_priv *priv = dev_get_priv(mmc->dev); in esdhc_set_timing()
701 switch (mmc->selected_mode) { in esdhc_set_timing()
704 esdhc_reset_tuning(mmc); in esdhc_set_timing()
722 printf("Not supported %d\n", mmc->selected_mode); in esdhc_set_timing()
726 priv->mode = mmc->selected_mode; in esdhc_set_timing()
728 return esdhc_change_pinstate(mmc->dev); in esdhc_set_timing()
731 static int esdhc_set_voltage(struct mmc *mmc) in esdhc_set_voltage() argument
733 struct fsl_esdhc_priv *priv = dev_get_priv(mmc->dev); in esdhc_set_voltage()
737 priv->signal_voltage = mmc->signal_voltage; in esdhc_set_voltage()
738 switch (mmc->signal_voltage) { in esdhc_set_voltage()
782 static void esdhc_stop_tuning(struct mmc *mmc) in esdhc_stop_tuning() argument
790 dm_mmc_send_cmd(mmc->dev, &cmd, NULL); in esdhc_stop_tuning()
798 struct mmc *mmc = &plat->mmc; in fsl_esdhc_execute_tuning() local
805 if (mmc->clock <= 52000000) in fsl_esdhc_execute_tuning()
838 if (mmc->bus_width == 8) in fsl_esdhc_execute_tuning()
840 else if (mmc->bus_width == 4) in fsl_esdhc_execute_tuning()
852 mmc_send_tuning(mmc, opcode, NULL); in fsl_esdhc_execute_tuning()
875 esdhc_stop_tuning(mmc); in fsl_esdhc_execute_tuning()
881 static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) in esdhc_set_ios_common() argument
893 if (priv->clock != mmc->clock) in esdhc_set_ios_common()
894 set_sysctl(priv, mmc, mmc->clock); in esdhc_set_ios_common()
897 if (mmc->clk_disable) { in esdhc_set_ios_common()
912 if (priv->mode != mmc->selected_mode) { in esdhc_set_ios_common()
913 ret = esdhc_set_timing(mmc); in esdhc_set_ios_common()
920 if (priv->signal_voltage != mmc->signal_voltage) { in esdhc_set_ios_common()
921 ret = esdhc_set_voltage(mmc); in esdhc_set_ios_common()
932 if (mmc->bus_width == 4) in esdhc_set_ios_common()
934 else if (mmc->bus_width == 8) in esdhc_set_ios_common()
940 static int esdhc_init_common(struct fsl_esdhc_priv *priv, struct mmc *mmc) in esdhc_init_common() argument
985 mmc_set_clock(mmc, 400000, MMC_CLK_ENABLE); in esdhc_init_common()
1044 static int esdhc_getcd(struct mmc *mmc) in esdhc_getcd() argument
1046 struct fsl_esdhc_priv *priv = mmc->priv; in esdhc_getcd()
1051 static int esdhc_init(struct mmc *mmc) in esdhc_init() argument
1053 struct fsl_esdhc_priv *priv = mmc->priv; in esdhc_init()
1055 return esdhc_init_common(priv, mmc); in esdhc_init()
1058 static int esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, in esdhc_send_cmd() argument
1061 struct fsl_esdhc_priv *priv = mmc->priv; in esdhc_send_cmd()
1063 return esdhc_send_cmd_common(priv, mmc, cmd, data); in esdhc_send_cmd()
1066 static int esdhc_set_ios(struct mmc *mmc) in esdhc_set_ios() argument
1068 struct fsl_esdhc_priv *priv = mmc->priv; in esdhc_set_ios()
1070 return esdhc_set_ios_common(priv, mmc); in esdhc_set_ios()
1223 struct mmc *mmc; in fsl_esdhc_initialize() local
1254 mmc = mmc_create(&plat->cfg, priv); in fsl_esdhc_initialize()
1255 if (!mmc) in fsl_esdhc_initialize()
1258 priv->mmc = mmc; in fsl_esdhc_initialize()
1367 struct mmc *mmc; in fsl_esdhc_probe() local
1477 mmc = &plat->mmc; in fsl_esdhc_probe()
1478 mmc->cfg = &plat->cfg; in fsl_esdhc_probe()
1479 mmc->dev = dev; in fsl_esdhc_probe()
1480 upriv->mmc = mmc; in fsl_esdhc_probe()
1482 return esdhc_init_common(priv, mmc); in fsl_esdhc_probe()
1500 return esdhc_send_cmd_common(priv, &plat->mmc, cmd, data); in fsl_esdhc_send_cmd()
1508 return esdhc_set_ios_common(priv, &plat->mmc); in fsl_esdhc_set_ios()
1545 return mmc_bind(dev, &plat->mmc, &plat->cfg); in fsl_esdhc_bind()