Skip to content

Commit 0718e59

Browse files
Russell Kingcjb
authored andcommitted
mmc: sdhci: move FSL ESDHC reset handling quirk into esdhc code
The Freescale esdhc driver is the only driver which needs the interrupt registers restored after a reset. Move this quirk to be part of the ESDHC driver implementation. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Markus Pargmann <mpa@pengutronix.de> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
1 parent 03231f9 commit 0718e59

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎drivers/mmc/host/sdhci-esdhc-imx.c‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,14 @@ static int esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
876876
return esdhc_change_pinstate(host, uhs);
877877
}
878878

879+
static void esdhc_reset(struct sdhci_host *host, u8 mask)
880+
{
881+
sdhci_reset(host, mask);
882+
883+
sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
884+
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
885+
}
886+
879887
static struct sdhci_ops sdhci_esdhc_ops = {
880888
.read_l = esdhc_readl_le,
881889
.read_w = esdhc_readw_le,
@@ -888,7 +896,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
888896
.get_ro = esdhc_pltfm_get_ro,
889897
.set_bus_width = esdhc_pltfm_set_bus_width,
890898
.set_uhs_signaling = esdhc_set_uhs_signaling,
891-
.reset = sdhci_reset,
899+
.reset = esdhc_reset,
892900
};
893901

894902
static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {

‎drivers/mmc/host/sdhci-esdhc.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
SDHCI_QUIRK_NO_BUSY_IRQ | \
2323
SDHCI_QUIRK_NONSTANDARD_CLOCK | \
2424
SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | \
25-
SDHCI_QUIRK_PIO_NEEDS_DELAY | \
26-
SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET)
25+
SDHCI_QUIRK_PIO_NEEDS_DELAY)
2726

2827
#define ESDHC_SYSTEM_CONTROL 0x2c
2928
#define ESDHC_CLOCK_MASK 0x0000fff0

‎drivers/mmc/host/sdhci.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,6 @@ static void sdhci_do_reset(struct sdhci_host *host, u8 mask)
203203

204204
host->ops->reset(host, mask);
205205

206-
if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET) {
207-
sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
208-
sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
209-
}
210-
211206
if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
212207
if ((host->ops->enable_dma) && (mask & SDHCI_RESET_ALL))
213208
host->ops->enable_dma(host);

‎include/linux/mmc/sdhci.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ struct sdhci_host {
6161
#define SDHCI_QUIRK_NONSTANDARD_CLOCK (1<<17)
6262
/* Controller does not like fast PIO transfers */
6363
#define SDHCI_QUIRK_PIO_NEEDS_DELAY (1<<18)
64-
/* Controller losing signal/interrupt enable states after reset */
65-
#define SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET (1<<19)
6664
/* Controller has to be forced to use block size of 2048 bytes */
6765
#define SDHCI_QUIRK_FORCE_BLK_SZ_2048 (1<<20)
6866
/* Controller cannot do multi-block transfers */

0 commit comments

Comments
 (0)