diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-08-18 14:42:57 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2024-08-18 14:42:57 +0000 |
commit | 88e9320c54ece9b3b15e021bd809d9560a1409bc (patch) | |
tree | 7bca1d5b035a193fe2c53e63a42111e60cd9c3d4 /sys | |
parent | 1fb6f43d9fa8d0a59508b8f6b21fc7f8d1d706c8 (diff) |
Most audio drivers were incorrectly (or not at all) informing their children
about suspend/resume related events, and they all have audio.c as a child,
which definately needs to know!
ok ratchov
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/auixp.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/azalia.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/cs4280.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/cs4281.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/esa.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/eso.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/maestro.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/yds.c | 4 |
8 files changed, 31 insertions, 14 deletions
diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c index 8d46f8567b6..9cd54932dbc 100644 --- a/sys/dev/pci/auixp.c +++ b/sys/dev/pci/auixp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auixp.c,v 1.53 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: auixp.c,v 1.54 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: auixp.c,v 1.9 2005/06/27 21:13:09 thorpej Exp $ */ /* @@ -911,6 +911,7 @@ auixp_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); auixp_disable_interrupts(sc); break; case DVACT_RESUME: diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index c1731e556b5..ff4a4361267 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.289 2024/08/18 14:35:14 deraadt Exp $ */ +/* $OpenBSD: azalia.c,v 1.290 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -611,15 +611,17 @@ azalia_pci_activate(struct device *self, int act) (void) AZ_READ_4(sc, INTSTS); break; case DVACT_SUSPEND: + rv = config_activate_children(self, act); azalia_suspend(sc); break; - case DVACT_POWERDOWN: - azalia_shutdown(sc); - break; case DVACT_RESUME: azalia_resume(sc); rv = config_activate_children(self, act); break; + case DVACT_POWERDOWN: + rv = config_activate_children(self, act); + azalia_shutdown(sc); + break; default: rv = config_activate_children(self, act); break; diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c index 4e7dba08c7d..fefe948c358 100644 --- a/sys/dev/pci/cs4280.c +++ b/sys/dev/pci/cs4280.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4280.c,v 1.61 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: cs4280.c,v 1.62 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: cs4280.c,v 1.5 2000/06/26 04:56:23 simonb Exp $ */ /* @@ -1571,6 +1571,7 @@ cs4280_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); /* should I powerdown here ? */ cs4280_write_codec(sc, AC97_REG_POWER, CS4280_POWER_DOWN_ALL); break; diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c index 7404774520c..7e1051ee984 100644 --- a/sys/dev/pci/cs4281.c +++ b/sys/dev/pci/cs4281.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cs4281.c,v 1.46 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: cs4281.c,v 1.47 2024/08/18 14:42:56 deraadt Exp $ */ /* $Tera: cs4281.c,v 1.18 2000/12/27 14:24:45 tacha Exp $ */ /* @@ -960,6 +960,7 @@ cs4281_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); /* should I powerdown here ? */ cs4281_write_codec(sc, AC97_REG_POWER, CS4281_POWER_DOWN_ALL); break; diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index 3bdf82cfb79..0c6b6ee50d4 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: esa.c,v 1.43 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: esa.c,v 1.44 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: esa.c,v 1.12 2002/03/24 14:17:35 jmcneill Exp $ */ /* @@ -1489,16 +1489,22 @@ int esa_activate(struct device *self, int act) { struct esa_softc *sc = (struct esa_softc *)self; + int rv; switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); esa_suspend(sc); break; case DVACT_RESUME: esa_resume(sc); + rv = config_activate_children(self, act); + break; + default: + rv = config_activate_children(self, act); break; } - return 0; + return rv; } void diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c index 4bcb08c94af..c6b46156228 100644 --- a/sys/dev/pci/eso.c +++ b/sys/dev/pci/eso.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eso.c,v 1.55 2024/05/24 06:02:53 jsg Exp $ */ +/* $OpenBSD: eso.c,v 1.56 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: eso.c,v 1.48 2006/12/18 23:13:39 kleink Exp $ */ /* @@ -1966,6 +1966,7 @@ eso_activate(struct device *self, int act) bus_space_write_1(sc->sc_iot, sc->sc_ioh, ESO_IO_IRQCTL, tmp); break; case DVACT_SUSPEND: + rv = config_activate_children(self, act); bus_space_write_1(sc->sc_iot, sc->sc_ioh, ESO_IO_A2DMAM, 0); bus_space_write_1(sc->sc_dmac_iot, sc->sc_dmac_ioh, ESO_DMAC_CLEAR, 0); diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c index 3ed4a4c4465..b5945bb7133 100644 --- a/sys/dev/pci/maestro.c +++ b/sys/dev/pci/maestro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: maestro.c,v 1.52 2024/05/24 06:02:58 jsg Exp $ */ +/* $OpenBSD: maestro.c,v 1.53 2024/08/18 14:42:56 deraadt Exp $ */ /* $FreeBSD: /c/ncvs/src/sys/dev/sound/pci/maestro.c,v 1.3 2000/11/21 12:22:11 julian Exp $ */ /* * FreeBSD's ESS Agogo/Maestro driver @@ -1352,6 +1352,7 @@ maestro_activate(struct device *self, int act) switch (act) { case DVACT_SUSPEND: + rv = config_activate_children(self, act); /* Power down device on shutdown. */ DPRINTF(("maestro: power down\n")); if (sc->record.mode & MAESTRO_RUNNING) { @@ -1382,9 +1383,13 @@ maestro_activate(struct device *self, int act) if (sc->record.mode & MAESTRO_RUNNING) maestro_channel_start(&sc->record); maestro_update_timer(sc); + rv = config_activate_children(self, act); + break; + default: + rv = config_activate_children(self, act); break; } - return 0; + return rv; } void diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index eae06855f1d..42c755fbf0b 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yds.c,v 1.65 2024/06/26 01:40:49 jsg Exp $ */ +/* $OpenBSD: yds.c,v 1.66 2024/08/18 14:42:56 deraadt Exp $ */ /* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */ /* @@ -1571,11 +1571,11 @@ yds_activate(struct device *self, int act) switch (act) { case DVACT_QUIESCE: + rv = config_activate_children(self, act); if (sc->sc_play.intr || sc->sc_rec.intr) sc->sc_resume_active = 1; else sc->sc_resume_active = 0; - rv = config_activate_children(self, act); if (sc->sc_resume_active) yds_close(sc); break; |