From a6999fc21e727af91099268ba69c201c8ee81041 Mon Sep 17 00:00:00 2001 From: ambrisko Date: Wed, 24 Jul 2002 21:27:22 +0000 Subject: Fake a resume method for this chip via calling detach/attach. This lets ThinkPads using this chip to have sound after a suspend/resume sequence without resorting to kldunload/kldload. MFC after: 1 week --- sys/dev/sound/pci/csa.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sys/dev/sound/pci/csa.c') diff --git a/sys/dev/sound/pci/csa.c b/sys/dev/sound/pci/csa.c index 58704b9..6361f3e 100644 --- a/sys/dev/sound/pci/csa.c +++ b/sys/dev/sound/pci/csa.c @@ -360,6 +360,15 @@ csa_detach(device_t dev) return bus_generic_detach(dev); } +static int +csa_resume(device_t dev) +{ + csa_detach(dev); + csa_attach(dev); + + return 0; +} + static struct resource * csa_alloc_resource(device_t bus, device_t child, int type, int *rid, u_long start, u_long end, u_long count, u_int flags) @@ -1023,7 +1032,7 @@ static device_method_t csa_methods[] = { DEVMETHOD(device_detach, csa_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_resume, csa_resume), /* Bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), -- cgit v1.1