]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mmc: dw_mmc: add switch_voltage
authorZhangfei Gao <zhangfei.gao@linaro.org>
Thu, 14 May 2015 08:45:18 +0000 (16:45 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Jun 2015 07:07:04 +0000 (09:07 +0200)
switch_voltage is required on some platform since special register accessing

Signed-off-by: Jorge A. Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Signed-off-by: Dan Yuan <yuandan@hisilicon.com>
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/dw_mmc.h

index 5f5adafb253afec16429c3bb357e15be8d07bbb7..ce66565d50ef572f102a210695ddf48eb7f86cb2 100644 (file)
@@ -1236,11 +1236,15 @@ static int dw_mci_switch_voltage(struct mmc_host *mmc, struct mmc_ios *ios)
 {
        struct dw_mci_slot *slot = mmc_priv(mmc);
        struct dw_mci *host = slot->host;
+       const struct dw_mci_drv_data *drv_data = host->drv_data;
        u32 uhs;
        u32 v18 = SDMMC_UHS_18V << slot->id;
        int min_uv, max_uv;
        int ret;
 
+       if (drv_data && drv_data->switch_voltage)
+               return drv_data->switch_voltage(mmc, ios);
+
        /*
         * Program the voltage.  Note that some instances of dw_mmc may use
         * the UHS_REG for this.  For other instances (like exynos) the UHS_REG
index f45ab91de33946ac86abc72ae8305eb1f18aa55e..c7236170bf98c7f5c98b77df5c7bfd60fb5a79ad 100644 (file)
@@ -287,5 +287,7 @@ struct dw_mci_drv_data {
        int             (*execute_tuning)(struct dw_mci_slot *slot);
        int             (*prepare_hs400_tuning)(struct dw_mci *host,
                                                struct mmc_ios *ios);
+       int             (*switch_voltage)(struct mmc_host *mmc,
+                                         struct mmc_ios *ios);
 };
 #endif /* _DW_MMC_H_ */