mmc: sdhci: Add a callback to select drive strength
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 6 Feb 2015 12:12:59 +0000 (14:12 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 1 Jun 2015 07:07:14 +0000 (09:07 +0200)
Add a callbak to let host drivers select drive
strength.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h

index b35ec79e72052a52a861757f6877a2e7db132b4e..1b4861ddfb388be3079aa1814f1d55e0150879d9 100644 (file)
@@ -2048,6 +2048,18 @@ out_unlock:
        return err;
 }
 
+static int sdhci_select_drive_strength(struct mmc_card *card,
+                                      unsigned int max_dtr, int host_drv,
+                                      int card_drv, int *drv_type)
+{
+       struct sdhci_host *host = mmc_priv(card->host);
+
+       if (!host->ops->select_drive_strength)
+               return 0;
+
+       return host->ops->select_drive_strength(host, card, max_dtr, host_drv,
+                                               card_drv, drv_type);
+}
 
 static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable)
 {
@@ -2192,6 +2204,7 @@ static const struct mmc_host_ops sdhci_ops = {
        .start_signal_voltage_switch    = sdhci_start_signal_voltage_switch,
        .prepare_hs400_tuning           = sdhci_prepare_hs400_tuning,
        .execute_tuning                 = sdhci_execute_tuning,
+       .select_drive_strength          = sdhci_select_drive_strength,
        .card_event                     = sdhci_card_event,
        .card_busy      = sdhci_card_busy,
 };
index 923ff223aea417ff87fa83a331aa7f5fbfbc2f1e..5521d29368e466d0d752839e34210a452823d62f 100644 (file)
@@ -538,6 +538,10 @@ struct sdhci_ops {
        void    (*platform_init)(struct sdhci_host *host);
        void    (*card_event)(struct sdhci_host *host);
        void    (*voltage_switch)(struct sdhci_host *host);
+       int     (*select_drive_strength)(struct sdhci_host *host,
+                                        struct mmc_card *card,
+                                        unsigned int max_dtr, int host_drv,
+                                        int card_drv, int *drv_type);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS