Skip to content

Commit 48d685a

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci-pci: Move a function to avoid later forward declaration
Move a function to avoid having to forward declare it in a subsequent patch. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Ludovic Desroches <ludovic.desroches@microchip.com>
1 parent 966d696 commit 48d685a

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

drivers/mmc/host/sdhci-pci-core.c

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,44 @@ static int bxt_get_cd(struct mmc_host *mmc)
515515
return ret;
516516
}
517517

518+
#define SDHCI_INTEL_PWR_TIMEOUT_CNT 20
519+
#define SDHCI_INTEL_PWR_TIMEOUT_UDELAY 100
520+
521+
static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode,
522+
unsigned short vdd)
523+
{
524+
int cntr;
525+
u8 reg;
526+
527+
sdhci_set_power(host, mode, vdd);
528+
529+
if (mode == MMC_POWER_OFF)
530+
return;
531+
532+
/*
533+
* Bus power might not enable after D3 -> D0 transition due to the
534+
* present state not yet having propagated. Retry for up to 2ms.
535+
*/
536+
for (cntr = 0; cntr < SDHCI_INTEL_PWR_TIMEOUT_CNT; cntr++) {
537+
reg = sdhci_readb(host, SDHCI_POWER_CONTROL);
538+
if (reg & SDHCI_POWER_ON)
539+
break;
540+
udelay(SDHCI_INTEL_PWR_TIMEOUT_UDELAY);
541+
reg |= SDHCI_POWER_ON;
542+
sdhci_writeb(host, reg, SDHCI_POWER_CONTROL);
543+
}
544+
}
545+
546+
static const struct sdhci_ops sdhci_intel_byt_ops = {
547+
.set_clock = sdhci_set_clock,
548+
.set_power = sdhci_intel_set_power,
549+
.enable_dma = sdhci_pci_enable_dma,
550+
.set_bus_width = sdhci_pci_set_bus_width,
551+
.reset = sdhci_reset,
552+
.set_uhs_signaling = sdhci_set_uhs_signaling,
553+
.hw_reset = sdhci_pci_hw_reset,
554+
};
555+
518556
static void byt_read_dsm(struct sdhci_pci_slot *slot)
519557
{
520558
struct intel_host *intel_host = sdhci_pci_priv(slot);
@@ -606,44 +644,6 @@ static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
606644
return 0;
607645
}
608646

609-
#define SDHCI_INTEL_PWR_TIMEOUT_CNT 20
610-
#define SDHCI_INTEL_PWR_TIMEOUT_UDELAY 100
611-
612-
static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode,
613-
unsigned short vdd)
614-
{
615-
int cntr;
616-
u8 reg;
617-
618-
sdhci_set_power(host, mode, vdd);
619-
620-
if (mode == MMC_POWER_OFF)
621-
return;
622-
623-
/*
624-
* Bus power might not enable after D3 -> D0 transition due to the
625-
* present state not yet having propagated. Retry for up to 2ms.
626-
*/
627-
for (cntr = 0; cntr < SDHCI_INTEL_PWR_TIMEOUT_CNT; cntr++) {
628-
reg = sdhci_readb(host, SDHCI_POWER_CONTROL);
629-
if (reg & SDHCI_POWER_ON)
630-
break;
631-
udelay(SDHCI_INTEL_PWR_TIMEOUT_UDELAY);
632-
reg |= SDHCI_POWER_ON;
633-
sdhci_writeb(host, reg, SDHCI_POWER_CONTROL);
634-
}
635-
}
636-
637-
static const struct sdhci_ops sdhci_intel_byt_ops = {
638-
.set_clock = sdhci_set_clock,
639-
.set_power = sdhci_intel_set_power,
640-
.enable_dma = sdhci_pci_enable_dma,
641-
.set_bus_width = sdhci_pci_set_bus_width,
642-
.reset = sdhci_reset,
643-
.set_uhs_signaling = sdhci_set_uhs_signaling,
644-
.hw_reset = sdhci_pci_hw_reset,
645-
};
646-
647647
static const struct sdhci_pci_fixes sdhci_intel_byt_emmc = {
648648
.allow_runtime_pm = true,
649649
.probe_slot = byt_emmc_probe_slot,

0 commit comments

Comments
 (0)