Skip to content

Commit a05c846

Browse files
shawn1221storulf
authored andcommitted
mmc: sdhci-of-arasan: implement enhanced strobe callback
Currently sdhci-arasan 5.1 can support enhanced strobe function, and we now limit it just for "arasan,sdhci-5.1". Add mmc-hs400-enhanced-strobe in DT to enable the function if we're sure our controller can support it. Signed-off-by: Shawn Lin <[email protected]> Acked-by: Adrian Hunter <[email protected]> Reviewed-by: Doug Anderson <[email protected]> Tested-by: Doug Anderson <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent bc26235 commit a05c846

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/mmc/host/sdhci-of-arasan.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#include "sdhci-pltfm.h"
2626

2727
#define SDHCI_ARASAN_CLK_CTRL_OFFSET 0x2c
28+
#define SDHCI_ARASAN_VENDOR_REGISTER 0x78
2829

30+
#define VENDOR_ENHANCED_STROBE BIT(0)
2931
#define CLK_CTRL_TIMEOUT_SHIFT 16
3032
#define CLK_CTRL_TIMEOUT_MASK (0xf << CLK_CTRL_TIMEOUT_SHIFT)
3133
#define CLK_CTRL_TIMEOUT_MIN_EXP 13
@@ -79,6 +81,21 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock)
7981
}
8082
}
8183

84+
static void sdhci_arasan_hs400_enhanced_strobe(struct mmc_host *mmc,
85+
struct mmc_ios *ios)
86+
{
87+
u32 vendor;
88+
struct sdhci_host *host = mmc_priv(mmc);
89+
90+
vendor = readl(host->ioaddr + SDHCI_ARASAN_VENDOR_REGISTER);
91+
if (ios->enhanced_strobe)
92+
vendor |= VENDOR_ENHANCED_STROBE;
93+
else
94+
vendor &= ~VENDOR_ENHANCED_STROBE;
95+
96+
writel(vendor, host->ioaddr + SDHCI_ARASAN_VENDOR_REGISTER);
97+
}
98+
8299
static struct sdhci_ops sdhci_arasan_ops = {
83100
.set_clock = sdhci_arasan_set_clock,
84101
.get_max_clock = sdhci_pltfm_clk_get_max_clock,
@@ -245,6 +262,9 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
245262
dev_err(&pdev->dev, "phy_power_on err.\n");
246263
goto err_phy_power;
247264
}
265+
266+
host->mmc_host_ops.hs400_enhanced_strobe =
267+
sdhci_arasan_hs400_enhanced_strobe;
248268
}
249269

250270
ret = sdhci_add_host(host);

0 commit comments

Comments
 (0)