mmc: sdhci: Add support for optional controller specific set_ios_post()
authorStefan Roese <sr@denx.de>
Mon, 12 Dec 2016 07:24:56 +0000 (08:24 +0100)
committerStefan Roese <sr@denx.de>
Wed, 25 Jan 2017 06:03:44 +0000 (07:03 +0100)
Some SDHCI drivers might need to do some special controller configuration
after the common clock set_ios() function has been called (speed / width
configuration). This patch adds a call to the newly created function
set_ios_port() when its configured in the host driver.

This will be used by the Xenon SDHCI controller driver used on the
Marvell Armada 3700 and 7k/8k ARM64 SoCs.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/sdhci.c
include/sdhci.h

index 9902dbd..93cefd8 100644 (file)
@@ -458,6 +458,10 @@ static int sdhci_set_ios(struct mmc *mmc)
 
        sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
 
+       /* If available, call the driver specific "post" set_ios() function */
+       if (host->ops && host->ops->set_ios_post)
+               host->ops->set_ios_post(host);
+
        return 0;
 }
 
index fdef7c4..6a43271 100644 (file)
@@ -235,6 +235,7 @@ struct sdhci_ops {
 #endif
        int     (*get_cd)(struct sdhci_host *host);
        void    (*set_control_reg)(struct sdhci_host *host);
+       void    (*set_ios_post)(struct sdhci_host *host);
        void    (*set_clock)(struct sdhci_host *host, u32 div);
 };