Skip to content

Commit 4ee7dde

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci: Let drivers define their DMA mask
Add host operation ->set_dma_mask() so that drivers can define their own DMA masks. Signed-off-by: Adrian Hunter <[email protected]> Tested-by: Nicolin Chen <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Cc: [email protected] # v4.15 + Signed-off-by: Ulf Hansson <[email protected]>
1 parent 121bd08 commit 4ee7dde

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

drivers/mmc/host/sdhci.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3781,18 +3781,14 @@ int sdhci_setup_host(struct sdhci_host *host)
37813781
host->flags &= ~SDHCI_USE_ADMA;
37823782
}
37833783

3784-
/*
3785-
* It is assumed that a 64-bit capable device has set a 64-bit DMA mask
3786-
* and *must* do 64-bit DMA. A driver has the opportunity to change
3787-
* that during the first call to ->enable_dma(). Similarly
3788-
* SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to
3789-
* implement.
3790-
*/
37913784
if (sdhci_can_64bit_dma(host))
37923785
host->flags |= SDHCI_USE_64_BIT_DMA;
37933786

37943787
if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
3795-
ret = sdhci_set_dma_mask(host);
3788+
if (host->ops->set_dma_mask)
3789+
ret = host->ops->set_dma_mask(host);
3790+
else
3791+
ret = sdhci_set_dma_mask(host);
37963792

37973793
if (!ret && host->ops->enable_dma)
37983794
ret = host->ops->enable_dma(host);

drivers/mmc/host/sdhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ struct sdhci_ops {
622622

623623
u32 (*irq)(struct sdhci_host *host, u32 intmask);
624624

625+
int (*set_dma_mask)(struct sdhci_host *host);
625626
int (*enable_dma)(struct sdhci_host *host);
626627
unsigned int (*get_max_clock)(struct sdhci_host *host);
627628
unsigned int (*get_min_clock)(struct sdhci_host *host);

0 commit comments

Comments
 (0)