diff options
author | njl <njl@FreeBSD.org> | 2007-06-02 19:37:27 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2007-06-02 19:37:27 +0000 |
commit | 9d0fbd0af19e3574d08f785d167045a8e33ed485 (patch) | |
tree | 4e06b7ae8d50d3021d0b0f1c308f889701b7a79f /sys/dev/acpi_support | |
parent | 8c017c22f434c87c88e24ef34bce878f009da09f (diff) | |
download | FreeBSD-src-9d0fbd0af19e3574d08f785d167045a8e33ed485.zip FreeBSD-src-9d0fbd0af19e3574d08f785d167045a8e33ed485.tar.gz |
Mute the main audio during reboot/shutdown. This prevents a burst of static
on the speakers of my Panasonic Y4. It might make sense to do this in the
mixer rc.d script as well.
Diffstat (limited to 'sys/dev/acpi_support')
-rw-r--r-- | sys/dev/acpi_support/acpi_panasonic.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/dev/acpi_support/acpi_panasonic.c b/sys/dev/acpi_support/acpi_panasonic.c index 14ddd83..c076aaf 100644 --- a/sys/dev/acpi_support/acpi_panasonic.c +++ b/sys/dev/acpi_support/acpi_panasonic.c @@ -79,6 +79,7 @@ typedef int hkey_fn_t(ACPI_HANDLE, int, UINT32 *); static int acpi_panasonic_probe(device_t dev); static int acpi_panasonic_attach(device_t dev); static int acpi_panasonic_detach(device_t dev); +static void acpi_panasonic_shutdown(device_t dev); static int acpi_panasonic_sysctl(SYSCTL_HANDLER_ARGS); static ACPI_INTEGER acpi_panasonic_sinf(ACPI_HANDLE h, ACPI_INTEGER index); static void acpi_panasonic_sset(ACPI_HANDLE h, ACPI_INTEGER index, @@ -114,6 +115,7 @@ static device_method_t acpi_panasonic_methods[] = { DEVMETHOD(device_probe, acpi_panasonic_probe), DEVMETHOD(device_attach, acpi_panasonic_attach), DEVMETHOD(device_detach, acpi_panasonic_detach), + DEVMETHOD(device_shutdown, acpi_panasonic_shutdown), {0, 0} }; @@ -181,7 +183,7 @@ acpi_panasonic_attach(device_t dev) } #endif - /* Handle notifies */ + /* Handle notifies */ status = AcpiInstallNotifyHandler(sc->handle, ACPI_DEVICE_NOTIFY, acpi_panasonic_notify, sc); if (ACPI_FAILURE(status)) { @@ -218,6 +220,18 @@ acpi_panasonic_detach(device_t dev) return (0); } +static void +acpi_panasonic_shutdown(device_t dev) +{ + struct acpi_panasonic_softc *sc; + int mute; + + /* Mute the main audio during reboot to prevent static burst to speaker. */ + sc = device_get_softc(dev); + mute = 1; + hkey_sound_mute(sc->handle, HKEY_SET, &mute); +} + static int acpi_panasonic_sysctl(SYSCTL_HANDLER_ARGS) { @@ -230,7 +244,7 @@ acpi_panasonic_sysctl(SYSCTL_HANDLER_ARGS) function = oidp->oid_arg2; handler = sysctl_table[function].handler; - /* Get the current value from the appropriate function. */ + /* Get the current value from the appropriate function. */ ACPI_SERIAL_BEGIN(panasonic); error = handler(sc->handle, HKEY_GET, &arg); if (error != 0) |