Skip to content

Commit 06641e8

Browse files
Ard BiesheuvelUlf Hansson
authored andcommitted
sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute
The Socionext SynQuacer SoC inherits this IP from Fujitsu, but requires the F_SDH30_CMD_DAT_DELAY bit to be set in the F_SDH30_ESD_CONTROL control register. So set this bit if the DT node has the 'fujitsu,cmd-dat-delay-select' property. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 167e5b6 commit 06641e8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎drivers/mmc/host/sdhci_f_sdh30.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/err.h>
1414
#include <linux/delay.h>
1515
#include <linux/module.h>
16+
#include <linux/property.h>
1617
#include <linux/clk.h>
1718

1819
#include "sdhci-pltfm.h"
@@ -47,6 +48,7 @@ struct f_sdhost_priv {
4748
struct clk *clk;
4849
u32 vendor_hs200;
4950
struct device *dev;
51+
bool enable_cmd_dat_delay;
5052
};
5153

5254
static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
@@ -84,10 +86,19 @@ static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
8486

8587
static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
8688
{
89+
struct f_sdhost_priv *priv = sdhci_priv(host);
90+
u32 ctl;
91+
8792
if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0)
8893
sdhci_writew(host, 0xBC01, SDHCI_CLOCK_CONTROL);
8994

9095
sdhci_reset(host, mask);
96+
97+
if (priv->enable_cmd_dat_delay) {
98+
ctl = sdhci_readl(host, F_SDH30_ESD_CONTROL);
99+
ctl |= F_SDH30_CMD_DAT_DELAY;
100+
sdhci_writel(host, ctl, F_SDH30_ESD_CONTROL);
101+
}
91102
}
92103

93104
static const struct sdhci_ops sdhci_f_sdh30_ops = {
@@ -126,6 +137,9 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
126137
host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE |
127138
SDHCI_QUIRK2_TUNING_WORK_AROUND;
128139

140+
priv->enable_cmd_dat_delay = device_property_read_bool(dev,
141+
"fujitsu,cmd-dat-delay-select");
142+
129143
ret = mmc_of_parse(host->mmc);
130144
if (ret)
131145
goto err;

0 commit comments

Comments
 (0)