]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mmc/s5p_sdhci.c
dm: exynos: Make sure that GPIOs are requested
[karo-tx-uboot.git] / drivers / mmc / s5p_sdhci.c
index 2ff0ec2a4221dad2c4e1c00bddba3f28374a1e35..0dea45d079f33e9c4f8b3b55288d7f508e4abc2d 100644 (file)
@@ -14,9 +14,7 @@
 #include <asm/arch/mmc.h>
 #include <asm/arch/clk.h>
 #include <errno.h>
-#ifdef CONFIG_OF_CONTROL
 #include <asm/arch/pinmux.h>
-#endif
 
 static char *S5P_NAME = "SAMSUNG SDHCI";
 static void s5p_sdhci_set_control_reg(struct sdhci_host *host)
@@ -104,6 +102,7 @@ struct sdhci_host sdhci_host[SDHCI_MAX_HOSTS];
 
 static int do_sdhci_init(struct sdhci_host *host)
 {
+       char str[20];
        int dev_id, flag;
        int err = 0;
 
@@ -111,6 +110,8 @@ static int do_sdhci_init(struct sdhci_host *host)
        dev_id = host->index + PERIPH_ID_SDMMC0;
 
        if (fdt_gpio_isvalid(&host->pwr_gpio)) {
+               sprintf(str, "sdhci%d_power", host->index & 0xf);
+               gpio_request(host->pwr_gpio.gpio, str);
                gpio_direction_output(host->pwr_gpio.gpio, 1);
                err = exynos_pinmux_config(dev_id, flag);
                if (err) {
@@ -120,7 +121,9 @@ static int do_sdhci_init(struct sdhci_host *host)
        }
 
        if (fdt_gpio_isvalid(&host->cd_gpio)) {
-               gpio_direction_output(host->cd_gpio.gpio, 0xf);
+               sprintf(str, "sdhci%d_cd", host->index & 0xf);
+               gpio_request(host->cd_gpio.gpio, str);
+               gpio_direction_output(host->cd_gpio.gpio, 1);
                if (gpio_get_value(host->cd_gpio.gpio))
                        return -ENODEV;