1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Add controller suspend/resume support.

To be able to correctly suspend/resume with card inserted,
respective support should be also implemented at mmc and mmcsd layers.
This commit is contained in:
Alexander Motin 2008-12-01 17:45:56 +00:00
parent 637fd955fe
commit 92bf0e27a0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=185527

View File

@ -801,6 +801,31 @@ sdhci_detach(device_t dev)
return (0);
}
static int
sdhci_suspend(device_t dev)
{
struct sdhci_softc *sc = device_get_softc(dev);
int i, err;
err = bus_generic_suspend(dev);
if (err)
return (err);
for (i = 0; i < sc->num_slots; i++)
sdhci_reset(&sc->slots[i], SDHCI_RESET_ALL);
return (0);
}
static int
sdhci_resume(device_t dev)
{
struct sdhci_softc *sc = device_get_softc(dev);
int i;
for (i = 0; i < sc->num_slots; i++)
sdhci_init(&sc->slots[i]);
return (bus_generic_resume(dev));
}
static int
sdhci_update_ios(device_t brdev, device_t reqdev)
{
@ -1508,6 +1533,8 @@ static device_method_t sdhci_methods[] = {
DEVMETHOD(device_probe, sdhci_probe),
DEVMETHOD(device_attach, sdhci_attach),
DEVMETHOD(device_detach, sdhci_detach),
DEVMETHOD(device_suspend, sdhci_suspend),
DEVMETHOD(device_resume, sdhci_resume),
/* Bus interface */
DEVMETHOD(bus_read_ivar, sdhci_read_ivar),