Date: Fri, 10 May 2013 14:28:17 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r250454 - projects/pmac_pmu/sys/powerpc/powermac Message-ID: <201305101428.r4AESHsj007554@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Fri May 10 14:28:16 2013 New Revision: 250454 URL: http://svnweb.freebsd.org/changeset/base/250454 Log: Add suspend/resume to the mac-io ATA driver. Modified: projects/pmac_pmu/sys/powerpc/powermac/ata_macio.c Modified: projects/pmac_pmu/sys/powerpc/powermac/ata_macio.c ============================================================================== --- projects/pmac_pmu/sys/powerpc/powermac/ata_macio.c Fri May 10 13:57:44 2013 (r250453) +++ projects/pmac_pmu/sys/powerpc/powermac/ata_macio.c Fri May 10 14:28:16 2013 (r250454) @@ -114,11 +114,15 @@ static int ata_macio_probe(device_t de static int ata_macio_setmode(device_t dev, int target, int mode); static int ata_macio_attach(device_t dev); static int ata_macio_begin_transaction(struct ata_request *request); +static int ata_macio_suspend(device_t dev); +static int ata_macio_resume(device_t dev); static device_method_t ata_macio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ata_macio_probe), DEVMETHOD(device_attach, ata_macio_attach), + DEVMETHOD(device_suspend, ata_macio_suspend), + DEVMETHOD(device_resume, ata_macio_resume), /* ATA interface */ DEVMETHOD(ata_setmode, ata_macio_setmode), @@ -333,3 +337,31 @@ ata_macio_begin_transaction(struct ata_r return ata_begin_transaction(request); } +static int +ata_macio_suspend(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int error; + + if (!ch->attached) + return (0); + + error = ata_suspend(dev); + + return (error); +} + +static int +ata_macio_resume(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int error; + + if (!ch->attached) + return (0); + + error = ata_resume(dev); + + return (error); +} +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305101428.r4AESHsj007554>