Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166337733
D30562.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D30562.diff
View Options
diff --git a/sys/dev/sdhci/sdhci_xenon.c b/sys/dev/sdhci/sdhci_xenon.c
--- a/sys/dev/sdhci/sdhci_xenon.c
+++ b/sys/dev/sdhci/sdhci_xenon.c
@@ -53,6 +53,7 @@
#include <dev/ofw/ofw_bus_subr.h>
#include <dev/mmc/bridge.h>
+#include <dev/mmc/mmc_fdt_helpers.h>
#include <dev/mmc/mmcbrvar.h>
#include <dev/mmc/mmcreg.h>
@@ -91,12 +92,12 @@
struct sdhci_slot *slot; /* SDHCI internal data */
struct resource *mem_res; /* Memory resource */
- regulator_t reg_vqmmc; /* vqmmc-supply regulator */
uint8_t znr; /* PHY ZNR */
uint8_t zpr; /* PHY ZPR */
bool no_18v; /* No 1.8V support */
bool slow_mode; /* PHY slow mode */
- bool wp_inverted; /* WP pin is inverted */
+
+ struct mmc_fdt_helper mmc_helper; /* MMC helper for parsing FDT */
};
static uint8_t
@@ -189,7 +190,8 @@
{
struct sdhci_xenon_softc *sc = device_get_softc(bus);
- return (sdhci_generic_get_ro(bus, dev) ^ sc->wp_inverted);
+ return (sdhci_generic_get_ro(bus, dev) ^
+ (sc->mmc_helper.props & MMC_PROP_WP_INVERTED));
}
static bool
@@ -356,15 +358,19 @@
if (bootverbose)
device_printf(sc->dev, "Powering down sd/mmc\n");
- if (sc->reg_vqmmc)
- regulator_disable(sc->reg_vqmmc);
+ if (sc->mmc_helper.vmmc_supply)
+ regulator_disable(sc->mmc_helper.vmmc_supply);
+ if (sc->mmc_helper.vqmmc_supply)
+ regulator_disable(sc->mmc_helper.vqmmc_supply);
break;
case power_up:
if (bootverbose)
device_printf(sc->dev, "Powering up sd/mmc\n");
- if (sc->reg_vqmmc)
- regulator_enable(sc->reg_vqmmc);
+ if (sc->mmc_helper.vmmc_supply)
+ regulator_enable(sc->mmc_helper.vmmc_supply);
+ if (sc->mmc_helper.vqmmc_supply)
+ regulator_enable(sc->mmc_helper.vqmmc_supply);
break;
};
@@ -391,7 +397,7 @@
sc = device_get_softc(brdev);
- if (sc->reg_vqmmc == NULL)
+ if (sc->mmc_helper.vqmmc_supply == NULL)
return EOPNOTSUPP;
slot = device_get_ivars(reqdev);
@@ -406,7 +412,7 @@
return EINVAL;
}
- err = regulator_set_voltage(sc->reg_vqmmc, uvolt, uvolt);
+ err = regulator_set_voltage(sc->mmc_helper.vqmmc_supply, uvolt, uvolt);
if (err != 0) {
device_printf(sc->dev,
"Cannot set vqmmc to %d<->%d\n",
@@ -444,8 +450,6 @@
sc->max_clk = cid;
if (OF_hasprop(sc->node, "no-1-8-v"))
sc->no_18v = true;
- if (OF_hasprop(sc->node, "wp-inverted"))
- sc->wp_inverted = true;
if (OF_hasprop(sc->node, "marvell,xenon-phy-slow-mode"))
sc->slow_mode = true;
sc->znr = XENON_ZNR_DEF_VALUE;
@@ -456,11 +460,6 @@
if ((OF_getencprop(sc->node, "marvell,xenon-phy-zpr", &cid,
sizeof(cid))) > 0)
sc->zpr = cid & XENON_ZPR_MASK;
- if (regulator_get_by_ofw_property(dev, 0, "vqmmc-supply",
- &sc->reg_vqmmc) == 0 && bootverbose) {
- if (bootverbose)
- device_printf(dev, "vqmmc-supply regulator found\n");
- }
return (0);
}
@@ -515,6 +514,8 @@
*/
sc->gpio = sdhci_fdt_gpio_setup(dev, slot);
+ mmc_fdt_parse(dev, 0, &sc->mmc_helper, &sc->slot->host);
+
if (sdhci_init_slot(dev, sc->slot, 0))
goto fail;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Aug 14, 12:08 AM (50 m, 25 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36591941
Default Alt Text
D30562.diff (2 KB)
Attached To
Mode
D30562: sdhci_xenon: enable MMC FDT parsing
Attached
Detach File
Event Timeline
Log In to Comment