mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
sound: codecs: wm8962: Assorted fixes
Merge series from Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>: Bunch of patches developed while working on Purism's Librem 5 phone.
This commit is contained in:
commit
eb4cd1a4a9
|
|
@ -67,6 +67,8 @@ struct wm8962_priv {
|
|||
struct mutex dsp2_ena_lock;
|
||||
u16 dsp2_ena;
|
||||
|
||||
int mic_status;
|
||||
|
||||
struct delayed_work mic_work;
|
||||
struct snd_soc_jack *jack;
|
||||
|
||||
|
|
@ -1760,7 +1762,7 @@ SND_SOC_BYTES("EQR Coefficients", WM8962_EQ24, 18),
|
|||
|
||||
|
||||
SOC_SINGLE("3D Switch", WM8962_THREED1, 0, 1, 0),
|
||||
SND_SOC_BYTES_MASK("3D Coefficients", WM8962_THREED1, 4, WM8962_THREED_ENA),
|
||||
SND_SOC_BYTES_MASK("3D Coefficients", WM8962_THREED1, 4, WM8962_THREED_ENA | WM8962_ADC_MONOMIX),
|
||||
|
||||
SOC_SINGLE("DF1 Switch", WM8962_DF1, 0, 1, 0),
|
||||
SND_SOC_BYTES_MASK("DF1 Coefficients", WM8962_DF1, 7, WM8962_DF1_ENA),
|
||||
|
|
@ -3081,8 +3083,16 @@ static void wm8962_mic_work(struct work_struct *work)
|
|||
if (reg & WM8962_MICSHORT_STS) {
|
||||
status |= SND_JACK_BTN_0;
|
||||
irq_pol |= WM8962_MICSCD_IRQ_POL;
|
||||
|
||||
/* Don't report a microphone if it's shorted right after
|
||||
* plugging in, as this may be a TRS plug in a TRRS socket.
|
||||
*/
|
||||
if (!(wm8962->mic_status & WM8962_MICDET_STS))
|
||||
status = 0;
|
||||
}
|
||||
|
||||
wm8962->mic_status = status;
|
||||
|
||||
snd_soc_jack_report(wm8962->jack, status,
|
||||
SND_JACK_MICROPHONE | SND_JACK_BTN_0);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user