diff options
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_mmc.c | 10 | ||||
-rw-r--r-- | sys/arch/arm/xscale/pxammcvar.h | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_mmc.c b/sys/arch/arm/xscale/pxa2x0_mmc.c index f614158150d..b8be421d9d4 100644 --- a/sys/arch/arm/xscale/pxa2x0_mmc.c +++ b/sys/arch/arm/xscale/pxa2x0_mmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_mmc.c,v 1.8 2009/09/03 20:17:25 deraadt Exp $ */ +/* $OpenBSD: pxa2x0_mmc.c,v 1.9 2009/09/03 21:40:29 marex Exp $ */ /* * Copyright (c) 2007 Uwe Stuehler <uwe@openbsd.org> @@ -44,7 +44,6 @@ #include <dev/sdmmc/sdmmcvar.h> /* GPIO pins */ -#define PXAMMC_CARD_DETECT 9 /* XXX zaurus-specific */ #define PXAMMC_MMCLK 32 #define PXAMMC_MMCMD 112 #define PXAMMC_MMDAT0 92 @@ -135,8 +134,8 @@ pxammc_attach(struct pxammc_softc *sc, void *aux) */ s = splsdmmc(); - pxa2x0_gpio_set_function(PXAMMC_CARD_DETECT, GPIO_IN); - sc->sc_card_ih = pxa2x0_gpio_intr_establish(PXAMMC_CARD_DETECT, + pxa2x0_gpio_set_function(sc->sc_gpio_detect, GPIO_IN); + sc->sc_card_ih = pxa2x0_gpio_intr_establish(sc->sc_gpio_detect, IST_EDGE_BOTH, IPL_SDMMC, pxammc_card_intr, sc, "mmccd"); if (sc->sc_card_ih == NULL) { splx(s); @@ -255,7 +254,8 @@ pxammc_host_ocr(sdmmc_chipset_handle_t sch) int pxammc_card_detect(sdmmc_chipset_handle_t sch) { - return !pxa2x0_gpio_get_bit(PXAMMC_CARD_DETECT); + struct pxammc_softc *sc = sch; + return !pxa2x0_gpio_get_bit(sc->sc_gpio_detect); } int diff --git a/sys/arch/arm/xscale/pxammcvar.h b/sys/arch/arm/xscale/pxammcvar.h index 96031e381d4..e80ea71cf61 100644 --- a/sys/arch/arm/xscale/pxammcvar.h +++ b/sys/arch/arm/xscale/pxammcvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pxammcvar.h,v 1.1 2007/03/18 20:53:10 uwe Exp $ */ +/* $OpenBSD: pxammcvar.h,v 1.2 2009/09/03 21:40:29 marex Exp $ */ /* * Copyright (c) 2007 Uwe Stuehler <uwe@openbsd.org> @@ -36,6 +36,7 @@ struct pxammc_softc { #define PMF_CARD_INITED 0x0001 /* card init sequence sent */ int sc_clkdiv; /* current clock divider */ struct sdmmc_command * volatile sc_cmd; /* command in progress */ + int sc_gpio_detect; /* card detect GPIO */ }; int pxammc_match(void); |