Merge tag 'iwlwifi-next-for-kalle-2016-07-01' of git://git.kernel.org/pub/scm/linux...
[deliverable/linux.git] / drivers / mmc / host / dw_mmc-exynos.c
index 8790f2afc057f3909f64b50d0bab558ea74fe53c..7e3a3247b852d76f8521d93cdf5d9d6cef73ccba 100644 (file)
@@ -91,10 +91,14 @@ static inline u8 dw_mci_exynos_get_ciu_div(struct dw_mci *host)
                return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL)) + 1;
 }
 
-static int dw_mci_exynos_priv_init(struct dw_mci *host)
+static void dw_mci_exynos_config_smu(struct dw_mci *host)
 {
        struct dw_mci_exynos_priv_data *priv = host->priv;
 
+       /*
+        * If Exynos is provided the Security management,
+        * set for non-ecryption mode at this time.
+        */
        if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS5420_SMU ||
                priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU) {
                mci_writel(host, MPSBEGIN0, 0);
@@ -104,6 +108,13 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host)
                           SDMMC_MPSCTRL_VALID |
                           SDMMC_MPSCTRL_NON_SECURE_WRITE_BIT);
        }
+}
+
+static int dw_mci_exynos_priv_init(struct dw_mci *host)
+{
+       struct dw_mci_exynos_priv_data *priv = host->priv;
+
+       dw_mci_exynos_config_smu(host);
 
        if (priv->ctrl_type >= DW_MCI_TYPE_EXYNOS5420) {
                priv->saved_strobe_ctrl = mci_readl(host, HS400_DLINE_CTRL);
@@ -115,13 +126,6 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host)
                                DQS_CTRL_GET_RD_DELAY(priv->saved_strobe_ctrl);
        }
 
-       return 0;
-}
-
-static int dw_mci_exynos_setup_clock(struct dw_mci *host)
-{
-       struct dw_mci_exynos_priv_data *priv = host->priv;
-
        host->bus_hz /= (priv->ciu_div + 1);
 
        return 0;
@@ -169,7 +173,7 @@ static int dw_mci_exynos_resume(struct device *dev)
 {
        struct dw_mci *host = dev_get_drvdata(dev);
 
-       dw_mci_exynos_priv_init(host);
+       dw_mci_exynos_config_smu(host);
        return dw_mci_resume(host);
 }
 
@@ -489,7 +493,6 @@ static unsigned long exynos_dwmmc_caps[4] = {
 static const struct dw_mci_drv_data exynos_drv_data = {
        .caps                   = exynos_dwmmc_caps,
        .init                   = dw_mci_exynos_priv_init,
-       .setup_clock            = dw_mci_exynos_setup_clock,
        .set_ios                = dw_mci_exynos_set_ios,
        .parse_dt               = dw_mci_exynos_parse_dt,
        .execute_tuning         = dw_mci_exynos_execute_tuning,
This page took 0.02499 seconds and 5 git commands to generate.