hook up card detect gpio

This commit is contained in:
jmcneill 2015-08-08 14:48:41 +00:00
parent a2bdc95972
commit ce8aaf88f7
2 changed files with 10 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: amlogic_sdhc.c,v 1.9 2015/08/08 14:01:44 jmcneill Exp $ */
/* $NetBSD: amlogic_sdhc.c,v 1.10 2015/08/08 14:48:41 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "locators.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: amlogic_sdhc.c,v 1.9 2015/08/08 14:01:44 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: amlogic_sdhc.c,v 1.10 2015/08/08 14:48:41 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -443,7 +443,9 @@ amlogic_sdhc_host_maxblklen(sdmmc_chipset_handle_t sch)
static int
amlogic_sdhc_card_detect(sdmmc_chipset_handle_t sch)
{
return 1;
struct amlogic_sdhc_softc *sc = sch;
return amlogic_sdhc_is_card_present(sc->sc_port);
}
static int

View File

@ -1,4 +1,4 @@
/* $NetBSD: amlogic_sdio.c,v 1.4 2015/08/08 14:01:44 jmcneill Exp $ */
/* $NetBSD: amlogic_sdio.c,v 1.5 2015/08/08 14:48:41 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -29,7 +29,7 @@
#include "locators.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: amlogic_sdio.c,v 1.4 2015/08/08 14:01:44 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: amlogic_sdio.c,v 1.5 2015/08/08 14:48:41 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -331,7 +331,9 @@ amlogic_sdio_host_maxblklen(sdmmc_chipset_handle_t sch)
static int
amlogic_sdio_card_detect(sdmmc_chipset_handle_t sch)
{
return 1;
struct amlogic_sdio_softc *sc = sch;
return amlogic_sdhc_is_card_present(sc->sc_cur_port);
}
static int