Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/sunxi If an mmc-pwrseq provider is available, u...
details: https://anonhg.NetBSD.org/src/rev/bb913083736d
branches: trunk
changeset: 356960:bb913083736d
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Oct 22 13:57:25 2017 +0000
description:
If an mmc-pwrseq provider is available, use it
diffstat:
sys/arch/arm/sunxi/sunxi_mmc.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diffs (53 lines):
diff -r 5012ff667c38 -r bb913083736d sys/arch/arm/sunxi/sunxi_mmc.c
--- a/sys/arch/arm/sunxi/sunxi_mmc.c Sun Oct 22 13:56:49 2017 +0000
+++ b/sys/arch/arm/sunxi/sunxi_mmc.c Sun Oct 22 13:57:25 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mmc.c,v 1.11 2017/10/21 11:47:17 jmcneill Exp $ */
+/* $NetBSD: sunxi_mmc.c,v 1.12 2017/10/22 13:57:25 jmcneill Exp $ */
/*-
* Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.11 2017/10/21 11:47:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.12 2017/10/22 13:57:25 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -168,6 +168,8 @@
int sc_gpio_wp_inverted;
struct fdtbus_regulator *sc_reg_vqmmc;
+
+ struct fdtbus_mmc_pwrseq *sc_pwrseq;
};
CFATTACH_DECL_NEW(sunxi_mmc, sizeof(struct sunxi_mmc_softc),
@@ -266,6 +268,8 @@
sc->sc_reg_vqmmc = fdtbus_regulator_acquire(phandle, "vqmmc-supply");
+ sc->sc_pwrseq = fdtbus_mmc_pwrseq_get(phandle);
+
if (clk_enable(sc->sc_clk_ahb) != 0 ||
clk_enable(sc->sc_clk_mmc) != 0) {
aprint_error(": couldn't enable clocks\n");
@@ -414,10 +418,16 @@
struct sdmmcbus_attach_args saa;
uint32_t width;
+ if (sc->sc_pwrseq)
+ fdtbus_mmc_pwrseq_pre_power_on(sc->sc_pwrseq);
+
sunxi_mmc_host_reset(sc);
sunxi_mmc_bus_width(sc, 1);
sunxi_mmc_set_clock(sc, 400, false);
+ if (sc->sc_pwrseq)
+ fdtbus_mmc_pwrseq_post_power_on(sc->sc_pwrseq);
+
if (of_getprop_uint32(sc->sc_phandle, "bus-width", &width) != 0)
width = 4;
Home |
Main Index |
Thread Index |
Old Index