summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2026-01-06 10:16:59 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2026-02-23 12:06:54 +0100
commitd3fcd6362aafe5f30d85c2f1639cdcb7288ca4bf (patch)
tree7ba60d00b232abe73fb92f699e128c7d0b85baf1
parentdc1f8aacc9941150be504048a46dd94c111717bc (diff)
mmc: dw_mmc: Move detect_delay_ms from struct dw_mci_board to struct dw_mci
Now, as dw_mmc-pci still provide struct dw_mci_board, so host->detect_delay_ms will not be overwritten. So it's fine to move it. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/dw_mmc-pci.c2
-rw-r--r--drivers/mmc/host/dw_mmc.c4
-rw-r--r--drivers/mmc/host/dw_mmc.h5
3 files changed, 5 insertions, 6 deletions
diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c
index 89ad4993e4e1..616804a07821 100644
--- a/drivers/mmc/host/dw_mmc-pci.c
+++ b/drivers/mmc/host/dw_mmc-pci.c
@@ -27,7 +27,6 @@
static struct dw_mci_board pci_board_data = {
.caps = DW_MCI_CAPABILITIES,
.bus_hz = 33 * 1000 * 1000,
- .detect_delay_ms = 200,
};
static int dw_mci_pci_probe(struct pci_dev *pdev,
@@ -48,6 +47,7 @@ static int dw_mci_pci_probe(struct pci_dev *pdev,
host->irq_flags = IRQF_SHARED;
host->pdata = &pci_board_data;
host->fifo_depth = 32;
+ host->detect_delay_ms = 200;
ret = pcim_iomap_regions(pdev, 1 << PCI_BAR_NO, pci_name(pdev));
if (ret)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 98549a260e37..e67d785a2ff6 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2688,7 +2688,7 @@ static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status)
static void dw_mci_handle_cd(struct dw_mci *host)
{
mmc_detect_change(host->mmc,
- msecs_to_jiffies(host->pdata->detect_delay_ms));
+ msecs_to_jiffies(host->detect_delay_ms));
}
static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
@@ -3175,7 +3175,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
"fifo-depth property not found, using value of FIFOTH register as default\n");
device_property_read_u32(dev, "card-detect-delay",
- &pdata->detect_delay_ms);
+ &host->detect_delay_ms);
device_property_read_u32(dev, "data-addr", &host->data_addr_override);
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index bc82d1df75f0..e364b1696c17 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -132,6 +132,7 @@ struct dw_mci_dma_slave {
* @clk_old: The last clock value that was requested from core.
* @pdev: platform_device registered
* @rstc: Reset controller for this host.
+ * @detect_delay_ms: Delay in mS before detecting cards after interrupt.
*
* Locking
* =======
@@ -253,6 +254,7 @@ struct dw_mci {
unsigned int clk_old;
struct platform_device *pdev;
struct reset_control *rstc;
+ u32 detect_delay_ms;
};
/* DMA ops for Internal/External DMAC interface */
@@ -271,9 +273,6 @@ struct dw_mci_board {
unsigned int bus_hz; /* Clock speed at the cclk_in pad */
u32 caps; /* Capabilities */
-
- /* delay in mS before detecting cards after interrupt */
- u32 detect_delay_ms;
};
/* Support for longer data read timeout */