Merge tag 'pinctrl-v3.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
[cascardo/linux.git] / drivers / mmc / host / dw_mmc-rockchip.c
index f0c2cb1..5650ac4 100644 (file)
@@ -37,6 +37,9 @@ static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios)
        unsigned int cclkin;
        u32 bus_hz;
 
+       if (ios->clock == 0)
+               return;
+
        /*
         * cclkin: source clock of mmc controller
         * bus_hz: card interface clock generated by CLKGEN
@@ -65,14 +68,24 @@ static void dw_mci_rk3288_set_ios(struct dw_mci *host, struct mmc_ios *ios)
        }
 }
 
+static int dw_mci_rockchip_init(struct dw_mci *host)
+{
+       /* It is slot 8 on Rockchip SoCs */
+       host->sdio_id0 = 8;
+
+       return 0;
+}
+
 static const struct dw_mci_drv_data rk2928_drv_data = {
        .prepare_command        = dw_mci_rockchip_prepare_command,
+       .init                   = dw_mci_rockchip_init,
 };
 
 static const struct dw_mci_drv_data rk3288_drv_data = {
        .prepare_command        = dw_mci_rockchip_prepare_command,
        .set_ios                = dw_mci_rk3288_set_ios,
        .setup_clock    = dw_mci_rk3288_setup_clock,
+       .init                   = dw_mci_rockchip_init,
 };
 
 static const struct of_device_id dw_mci_rockchip_match[] = {