diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2017-08-10 15:25:53 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2017-08-10 15:25:53 +0000 |
commit | 46a69cab8cbcfedce745801a8a7cfa69c29af0da (patch) | |
tree | 07268be9e70e98c91116b09d14f50734d19e830b /sys | |
parent | 71d264ae501741372833df17bb48239b085e8ec9 (diff) |
Power off all codecs on shutdown to eliminate static noise in speakers
or headphones on reboot.
From Manuel Giraud <manuel () ledu-giraud ! fr>
Tweaks & ok ratchov
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/azalia.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c index 308e0adf462..79b29986add 100644 --- a/sys/dev/pci/azalia.c +++ b/sys/dev/pci/azalia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.c,v 1.235 2017/04/11 14:43:49 dhill Exp $ */ +/* $OpenBSD: azalia.c,v 1.236 2017/08/10 15:25:52 tb Exp $ */ /* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */ /*- @@ -697,6 +697,8 @@ azalia_shutdown(void *v) { azalia_t *az = (azalia_t *)v; uint32_t gctl; + codec_t *codec; + int i; /* disable unsolicited response */ gctl = AZ_READ_4(az, GCTL); @@ -704,6 +706,15 @@ azalia_shutdown(void *v) timeout_del(&az->unsol_to); + /* power off all codecs */ + for (i = 0; i < az->ncodecs; i++) { + codec = &az->codecs[i]; + if (codec->audiofunc < 0) + continue; + azalia_comresp(codec, codec->audiofunc, CORB_SET_POWER_STATE, + CORB_PS_D3, NULL); + } + /* halt CORB/RIRB */ azalia_halt_corb(az); azalia_halt_rirb(az); |