aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-12-01 12:37:11 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-12-01 12:37:11 +0000
commitc22c300c7d262f0dc8d8f6d36dbd1748bf030949 (patch)
tree64ea18953db1ecb5fd3e97376b4f33df35bf9818
parent289a83616d6a0350175a329cea6a607a2a0cc4f3 (diff)
downloadsrc-c22c300c7d262f0dc8d8f6d36dbd1748bf030949.tar.gz
src-c22c300c7d262f0dc8d8f6d36dbd1748bf030949.zip
MFC r367615:
Add a tunable sysctl, hw.usb.uaudio.handle_hid, to allow disabling the the HID volume keys support in the USB audio driver. While at it re-organize the USB audio sysctls a bit. Differential Revision: https://reviews.freebsd.org/D27180 Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes: svn path=/stable/11/; revision=368212
-rw-r--r--sys/dev/sound/usb/uaudio.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index 236553bc2fc9..955ecd84e01d 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -96,14 +96,11 @@ static int uaudio_default_rate = 0; /* use rate list */
static int uaudio_default_bits = 32;
static int uaudio_default_channels = 0; /* use default */
static int uaudio_buffer_ms = 8;
-
-#ifdef USB_DEBUG
-static int uaudio_debug;
+static bool uaudio_handle_hid = true;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio");
-
-SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RWTUN,
- &uaudio_debug, 0, "uaudio debug level");
+SYSCTL_BOOL(_hw_usb_uaudio, OID_AUTO, handle_hid, CTLFLAG_RWTUN,
+ &uaudio_handle_hid, 0, "uaudio handles any HID volume/mute keys, if set");
SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RWTUN,
&uaudio_default_rate, 0, "uaudio default sample rate");
SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RWTUN,
@@ -134,6 +131,12 @@ uaudio_buffer_ms_sysctl(SYSCTL_HANDLER_ARGS)
SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), uaudio_buffer_ms_sysctl, "I",
"uaudio buffering delay from 2ms to 8ms");
+
+#ifdef USB_DEBUG
+static int uaudio_debug;
+
+SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RWTUN,
+ &uaudio_debug, 0, "uaudio debug level");
#else
#define uaudio_debug 0
#endif
@@ -1118,10 +1121,12 @@ uaudio_attach(device_t dev)
goto detach;
}
- if (uaudio_hid_probe(sc, uaa) == 0) {
- device_printf(dev, "HID volume keys found.\n");
- } else {
- device_printf(dev, "No HID volume keys found.\n");
+ if (uaudio_handle_hid) {
+ if (uaudio_hid_probe(sc, uaa) == 0) {
+ device_printf(dev, "HID volume keys found.\n");
+ } else {
+ device_printf(dev, "No HID volume keys found.\n");
+ }
}
/* reload all mixer settings */