From: Shawn Lin Date: Tue, 6 Jan 2026 02:16:59 +0000 (+0800) Subject: mmc: dw_mmc: Move detect_delay_ms from struct dw_mci_board to struct dw_mci X-Git-Tag: v7.1-rc1~157^2~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3fcd6362aafe5f30d85c2f1639cdcb7288ca4bf;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c index 89ad4993e4e19..616804a078211 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 98549a260e377..e67d785a2ff6f 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 bc82d1df75f0d..e364b1696c176 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 */