diff --git a/share/man/man4/acpi_ibm.4 b/share/man/man4/acpi_ibm.4 --- a/share/man/man4/acpi_ibm.4 +++ b/share/man/man4/acpi_ibm.4 @@ -270,12 +270,15 @@ .It Va dev.acpi_ibm.0.volume Speaker volume. .It Va dev.acpi_ibm.0.mute -Indicates, whether the speakers are muted or not. -.It Va dev.acpi_ibm.0.mic_mute -Indicates, whether the microphone led (present on some model) is on or not. +Indicates whether the speakers are muted or not. +.It Va dev.acpi_ibm.0.mute_led +Indicates whether the audio mute led (present on some models) is on or not. +Note that this does not mean that the audio is muted. +.It Va dev.acpi_ibm.0.mic_led +Indicates whether the microphone led (present on some models) is on or not. Note that this does not mean that the microphone input is muted. .It Va dev.acpi_ibm.0.thinklight -Indicates, whether the ThinkLight keyboard light is activated or not. +Indicates whether the ThinkLight keyboard light is activated or not. .It Va dev.acpi_ibm.0.bluetooth Toggle Bluetooth chip activity. .It Va dev.acpi_ibm.0.wlan diff --git a/sys/dev/acpi_support/acpi_ibm.c b/sys/dev/acpi_support/acpi_ibm.c --- a/sys/dev/acpi_support/acpi_ibm.c +++ b/sys/dev/acpi_support/acpi_ibm.c @@ -81,6 +81,7 @@ #define ACPI_IBM_METHOD_HANDLEREVENTS 14 #define ACPI_IBM_METHOD_MIC_LED 15 #define ACPI_IBM_METHOD_PRIVACYGUARD 16 +#define ACPI_IBM_METHOD_MUTE_LED 17 /* Hotkeys/Buttons */ #define IBM_RTC_HOTKEY1 0x64 @@ -192,6 +193,10 @@ ACPI_HANDLE mic_led_handle; int mic_led_state; + /* Mute led handle */ + ACPI_HANDLE mute_led_handle; + int mute_led_state; + int wlan_bt_flags; int thermal_updt_supported; @@ -289,6 +294,11 @@ .method = ACPI_IBM_METHOD_PRIVACYGUARD, .description = "PrivacyGuard enable", }, + { + .name = "mute_led", + .method = ACPI_IBM_METHOD_MUTE_LED, + .description = "Mute led", + }, { NULL, 0, NULL, 0 } }; @@ -419,7 +429,7 @@ } static int -acpi_ibm_mic_led_set(struct acpi_ibm_softc *sc, int arg) +acpi_ibm_led_set(struct acpi_ibm_softc *sc, ACPI_STRING path, int on_value, int arg) { ACPI_OBJECT_LIST input; ACPI_OBJECT params[1]; @@ -431,14 +441,14 @@ if (sc->mic_led_handle) { params[0].Type = ACPI_TYPE_INTEGER; params[0].Integer.Value = 0; - /* mic led: 0 off, 2 on */ + /* For the microphone LED 2 is on */ if (arg == 1) - params[0].Integer.Value = 2; + params[0].Integer.Value = on_value; input.Pointer = params; input.Count = 1; - status = AcpiEvaluateObject(sc->handle, "MMTS", &input, NULL); + status = AcpiEvaluateObject(sc->handle, path, &input, NULL); if (ACPI_SUCCESS(status)) sc->mic_led_state = arg; return (status); @@ -447,6 +457,18 @@ return (0); } +static int +acpi_ibm_mic_led_set(struct acpi_ibm_softc *sc, int arg) +{ + return (acpi_ibm_led_set(sc, "MMTS", 2, arg)); +} + +static int +acpi_ibm_mute_led_set(struct acpi_ibm_softc *sc, int arg) +{ + return (acpi_ibm_led_set(sc, "SSMS", 1, arg)); +} + static int acpi_ibm_probe(device_t dev) { @@ -680,8 +702,9 @@ } ACPI_SERIAL_END(ibm); - /* The mic led does not turn back on when sysctl_set is called in the above loop */ + /* The mute leds do not turn back on when sysctl_set is called in the above loop */ acpi_ibm_mic_led_set(sc, sc->mic_led_state); + acpi_ibm_mute_led_set(sc, sc->mute_led_state); return (0); } @@ -882,6 +905,13 @@ case ACPI_IBM_METHOD_PRIVACYGUARD: val = acpi_ibm_privacyguard_get(sc); break; + + case ACPI_IBM_METHOD_MUTE_LED: + if (sc->mute_led_handle) + return sc->mute_led_state; + else + val = -1; + break; } return (val); @@ -930,6 +960,10 @@ return acpi_ibm_mic_led_set(sc, arg); break; + case ACPI_IBM_METHOD_MUTE_LED: + return acpi_ibm_mute_led_set(sc, arg); + break; + case ACPI_IBM_METHOD_THINKLIGHT: return acpi_ibm_thinklight_set(sc, arg); break; @@ -1011,6 +1045,13 @@ sc->mic_led_handle = NULL; return (FALSE); + case ACPI_IBM_METHOD_MUTE_LED: + if (ACPI_SUCCESS(AcpiGetHandle(sc->handle, "SSMS", &sc->mute_led_handle))) + return (TRUE); + else + sc->mute_led_handle = NULL; + return (FALSE); + case ACPI_IBM_METHOD_THINKLIGHT: sc->cmos_handle = NULL; sc->light_get_supported = ACPI_SUCCESS(acpi_GetInteger(