Skip to content
Snippets Groups Projects
Commit f5a8f755 authored by Andrew Chant's avatar Andrew Chant Committed by Thierry Strudel
Browse files

BACKPORT: ALSA: usb-audio: UAC2 jack detection

This implements UAC2 jack detection support, presenting
jack status as a boolean read-only mono mixer.

The presence of any channel in the UAC2_TE_CONNECTOR
control for a terminal will result in the mixer saying
the jack is connected.

Mixer naming follows the convention in sound/core/ctljack.c,
terminating the mixer with " Jack".
For additional clues as to which jack is being presented,
the name is prefixed with " - Input Jack" or " - Output Jack"
depending on if it's an input or output terminal.

This is required because terminal names are ambiguous
between inputs and outputs and often duplicated -
Bidirectional terminal types (0x400 -> 0x4FF)
"... may be used separately for input only or output only.
These types require two Terminal descriptors. Both have the same type."
(quote from "USB Device Class Definition for Terminal Types")

Since bidirectional terminal types are common for headphone adapters,
this distinguishes between two otherwise identically-named
jack controls.

Tested with a UAC2 audio device with connector control capability.

(backported from
commit 5a222e849452 ("ALSA: usb-audio: UAC2 jack detection")
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git

 for-next)

Bug: 70632415
Change-Id: I6cff9bd2bcd0597d9f55e7505e89af01749d95eb
Signed-off-by: default avatarAndrew Chant <achant@google.com>
parent e6354316
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment