Verified Commit 14aab52a authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak
Browse files

hack: ASoC: wm8962: Trigger mic detection on out_pga_event

The SND_SOC_DAPM_POST_REG event is called when the headphone output path
is being (de)configured, which is a good place to hack trigger detection
in until we get a dedicated card driver.
parent 277d96ea
Pipeline #76000 passed with stage
in 78 minutes and 37 seconds
......@@ -1958,6 +1958,7 @@ static int out_pga_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct wm8962_priv *wm8962 = snd_soc_component_get_drvdata(component);
int reg;
switch (w->shift) {
......@@ -1982,6 +1983,9 @@ static int out_pga_event(struct snd_soc_dapm_widget *w,
case SND_SOC_DAPM_POST_PMU:
return snd_soc_component_write(component, reg,
snd_soc_component_read(component, reg));
case SND_SOC_DAPM_POST_REG:
queue_delayed_work(system_unbound_wq, &wm8962->mic_work, 0);
return 0;
default:
WARN(1, "Invalid event %d\n", event);
return -EINVAL;
......@@ -2181,7 +2185,7 @@ SND_SOC_DAPM_MIXER("HPMIXR", WM8962_MIXER_ENABLES, 2, 0,
SND_SOC_DAPM_MUX_E("HPOUTL PGA", WM8962_PWR_MGMT_2, 6, 0, &hpoutl_mux,
out_pga_event, SND_SOC_DAPM_POST_PMU),
SND_SOC_DAPM_MUX_E("HPOUTR PGA", WM8962_PWR_MGMT_2, 5, 0, &hpoutr_mux,
out_pga_event, SND_SOC_DAPM_POST_PMU),
out_pga_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_REG),
SND_SOC_DAPM_PGA_E("HPOUT", SND_SOC_NOPM, 0, 0, NULL, 0, hp_event,
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment