]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: dw_mmc: Move detect_delay_ms from struct dw_mci_board to struct dw_mci
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 6 Jan 2026 02:16:59 +0000 (10:16 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 11:06:54 +0000 (12:06 +0100)
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>
drivers/mmc/host/dw_mmc-pci.c
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/dw_mmc.h

index 89ad4993e4e19fb7d0c3b219a2a9424f89724bdf..616804a0782112a9d5a30bbff6e8cdf4b58e1a80 100644 (file)
@@ -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)
index 98549a260e377f963863c2e1bbc7d52d2e91f8e6..e67d785a2ff6f1875661886dc0da2c810f31e85f 100644 (file)
@@ -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);
 
index bc82d1df75f0d370e83d8102f63b84a6f81b3088..e364b1696c176331f33996624515b885bd2c6fae 100644 (file)
@@ -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 */