Lines Matching refs:wm8994

107 	struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);  in wm8958_micd_set_rate()  local
108 struct wm8994 *control = wm8994->wm8994; in wm8958_micd_set_rate()
114 idle = !wm8994->jack_mic; in wm8958_micd_set_rate()
118 sysclk = wm8994->aifclk[1]; in wm8958_micd_set_rate()
120 sysclk = wm8994->aifclk[0]; in wm8958_micd_set_rate()
125 } else if (wm8994->jackdet) { in wm8958_micd_set_rate()
158 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_aif_clock() local
168 switch (wm8994->sysclk[aif]) { in configure_aif_clock()
170 rate = wm8994->mclk[0]; in configure_aif_clock()
175 rate = wm8994->mclk[1]; in configure_aif_clock()
180 rate = wm8994->fll[0].out; in configure_aif_clock()
185 rate = wm8994->fll[1].out; in configure_aif_clock()
200 wm8994->aifclk[aif] = rate; in configure_aif_clock()
212 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_clock() local
226 if (wm8994->aifclk[0] == wm8994->aifclk[1]) { in configure_clock()
231 if (wm8994->aifclk[0] < wm8994->aifclk[1]) in configure_clock()
320 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_drc() local
321 struct wm8994 *control = wm8994->wm8994; in wm8994_set_drc()
324 int cfg = wm8994->drc_cfg[drc]; in wm8994_set_drc()
357 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_drc_enum() local
358 struct wm8994 *control = wm8994->wm8994; in wm8994_put_drc_enum()
369 wm8994->drc_cfg[drc] = value; in wm8994_put_drc_enum()
380 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_drc_enum() local
385 ucontrol->value.enumerated.item[0] = wm8994->drc_cfg[drc]; in wm8994_get_drc_enum()
392 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_retune_mobile() local
393 struct wm8994 *control = wm8994->wm8994; in wm8994_set_retune_mobile()
398 if (!pdata || !wm8994->num_retune_mobile_texts) in wm8994_set_retune_mobile()
415 cfg = wm8994->retune_mobile_cfg[block]; in wm8994_set_retune_mobile()
420 wm8994->retune_mobile_texts[cfg]) == 0 && in wm8994_set_retune_mobile()
422 - wm8994->dac_rates[iface]) < best_val) { in wm8994_set_retune_mobile()
425 - wm8994->dac_rates[iface]); in wm8994_set_retune_mobile()
433 wm8994->dac_rates[iface]); in wm8994_set_retune_mobile()
464 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_retune_mobile_enum() local
465 struct wm8994 *control = wm8994->wm8994; in wm8994_put_retune_mobile_enum()
476 wm8994->retune_mobile_cfg[block] = value; in wm8994_put_retune_mobile_enum()
487 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_retune_mobile_enum() local
493 ucontrol->value.enumerated.item[0] = wm8994->retune_mobile_cfg[block]; in wm8994_get_retune_mobile_enum()
746 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_jackdet_set_mode() local
748 if (!wm8994->jackdet || !wm8994->micdet[0].jack) in wm1811_jackdet_set_mode()
751 if (wm8994->active_refcount) in wm1811_jackdet_set_mode()
754 if (mode == wm8994->jackdet_mode) in wm1811_jackdet_set_mode()
757 wm8994->jackdet_mode = mode; in wm1811_jackdet_set_mode()
769 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_reference() local
771 mutex_lock(&wm8994->accdet_lock); in active_reference()
773 wm8994->active_refcount++; in active_reference()
776 wm8994->active_refcount); in active_reference()
781 mutex_unlock(&wm8994->accdet_lock); in active_reference()
786 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_dereference() local
789 mutex_lock(&wm8994->accdet_lock); in active_dereference()
791 wm8994->active_refcount--; in active_dereference()
794 wm8994->active_refcount); in active_dereference()
796 if (wm8994->active_refcount == 0) { in active_dereference()
798 if (wm8994->jack_mic || wm8994->mic_detecting) in active_dereference()
806 mutex_unlock(&wm8994->accdet_lock); in active_dereference()
813 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in clk_sys_event() local
827 if (wm8994->jackdet && !wm8994->clk_has_run) { in clk_sys_event()
829 &wm8994->jackdet_bootstrap, in clk_sys_event()
831 wm8994->clk_has_run = true; in clk_sys_event()
845 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_reference() local
849 wm8994->vmid_refcount++; in vmid_reference()
852 wm8994->vmid_refcount); in vmid_reference()
854 if (wm8994->vmid_refcount == 1) { in vmid_reference()
861 switch (wm8994->vmid_mode) { in vmid_reference()
924 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_dereference() local
926 wm8994->vmid_refcount--; in vmid_dereference()
929 wm8994->vmid_refcount); in vmid_dereference()
931 if (wm8994->vmid_refcount == 0) { in vmid_dereference()
932 if (wm8994->hubs.lineout1_se) in vmid_dereference()
939 if (wm8994->hubs.lineout2_se) in vmid_dereference()
1045 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_ev() local
1046 struct wm8994 *control = wm8994->wm8994; in aif1clk_ev()
1065 if (wm8994->channels[0] <= 2) in aif1clk_ev()
1228 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_late_ev() local
1232 wm8994->aif1clk_enable = 1; in aif1clk_late_ev()
1235 wm8994->aif1clk_disable = 1; in aif1clk_late_ev()
1246 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif2clk_late_ev() local
1250 wm8994->aif2clk_enable = 1; in aif2clk_late_ev()
1253 wm8994->aif2clk_disable = 1; in aif2clk_late_ev()
1264 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_enable_ev() local
1268 if (wm8994->aif1clk_enable) { in late_enable_ev()
1274 wm8994->aif1clk_enable = 0; in late_enable_ev()
1276 if (wm8994->aif2clk_enable) { in late_enable_ev()
1282 wm8994->aif2clk_enable = 0; in late_enable_ev()
1297 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_disable_ev() local
1301 if (wm8994->aif1clk_disable) { in late_disable_ev()
1306 wm8994->aif1clk_disable = 0; in late_disable_ev()
1308 if (wm8994->aif2clk_disable) { in late_disable_ev()
1313 wm8994->aif2clk_disable = 0; in late_disable_ev()
2051 static int wm8994_get_fll_config(struct wm8994 *control, struct fll_div *fll, in wm8994_get_fll_config()
2137 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in _wm8994_set_fll() local
2138 struct wm8994 *control = wm8994->wm8994; in _wm8994_set_fll()
2168 src = wm8994->fll[id].src; in _wm8994_set_fll()
2184 if (wm8994->fll[id].src == src && in _wm8994_set_fll()
2185 wm8994->fll[id].in == freq_in && wm8994->fll[id].out == freq_out) in _wm8994_set_fll()
2195 ret = wm8994_get_fll_config(control, &fll, wm8994->fll[id].in, in _wm8994_set_fll()
2196 wm8994->fll[id].out); in _wm8994_set_fll()
2219 if (wm8994->fll_byp && src == WM8994_FLL_SRC_BCLK && in _wm8994_set_fll()
2261 try_wait_for_completion(&wm8994->fll_locked[id]); in _wm8994_set_fll()
2293 if (wm8994->fll_locked_irq) { in _wm8994_set_fll()
2294 timeout = wait_for_completion_timeout(&wm8994->fll_locked[id], in _wm8994_set_fll()
2321 wm8994->fll[id].in = freq_in; in _wm8994_set_fll()
2322 wm8994->fll[id].out = freq_out; in _wm8994_set_fll()
2323 wm8994->fll[id].src = src; in _wm8994_set_fll()
2331 if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) { in _wm8994_set_fll()
2334 wm8994->aifdiv[0] = snd_soc_component_read32(component, WM8994_AIF1_RATE) in _wm8994_set_fll()
2336 wm8994->aifdiv[1] = snd_soc_component_read32(component, WM8994_AIF2_RATE) in _wm8994_set_fll()
2343 } else if (wm8994->aifdiv[0]) { in _wm8994_set_fll()
2346 wm8994->aifdiv[0]); in _wm8994_set_fll()
2349 wm8994->aifdiv[1]); in _wm8994_set_fll()
2351 wm8994->aifdiv[0] = 0; in _wm8994_set_fll()
2352 wm8994->aifdiv[1] = 0; in _wm8994_set_fll()
2379 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_sysclk() local
2394 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK1; in wm8994_set_dai_sysclk()
2395 wm8994->mclk[0] = freq; in wm8994_set_dai_sysclk()
2402 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK2; in wm8994_set_dai_sysclk()
2403 wm8994->mclk[1] = freq; in wm8994_set_dai_sysclk()
2409 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_FLL1; in wm8994_set_dai_sysclk()
2414 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_FLL2; in wm8994_set_dai_sysclk()
2448 if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) { in wm8994_set_dai_sysclk()
2451 wm8994->aifdiv[0] = snd_soc_component_read32(component, WM8994_AIF1_RATE) in wm8994_set_dai_sysclk()
2453 wm8994->aifdiv[1] = snd_soc_component_read32(component, WM8994_AIF2_RATE) in wm8994_set_dai_sysclk()
2460 } else if (wm8994->aifdiv[0]) { in wm8994_set_dai_sysclk()
2463 wm8994->aifdiv[0]); in wm8994_set_dai_sysclk()
2466 wm8994->aifdiv[1]); in wm8994_set_dai_sysclk()
2468 wm8994->aifdiv[0] = 0; in wm8994_set_dai_sysclk()
2469 wm8994->aifdiv[1] = 0; in wm8994_set_dai_sysclk()
2478 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_bias_level() local
2479 struct wm8994 *control = wm8994->wm8994; in wm8994_set_bias_level()
2551 wm8994->cur_fw = NULL; in wm8994_set_bias_level()
2560 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_vmid_mode() local
2567 if (wm8994->hubs.lineout1_se) { in wm8994_vmid_mode()
2573 if (wm8994->hubs.lineout2_se) { in wm8994_vmid_mode()
2582 wm8994->vmid_mode = mode; in wm8994_vmid_mode()
2590 if (wm8994->hubs.lineout1_se) { in wm8994_vmid_mode()
2596 if (wm8994->hubs.lineout2_se) { in wm8994_vmid_mode()
2603 wm8994->vmid_mode = mode; in wm8994_vmid_mode()
2619 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_fmt() local
2620 struct wm8994 *control = wm8994->wm8994; in wm8994_set_dai_fmt()
2775 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_hw_params() local
2776 struct wm8994 *control = wm8994->wm8994; in wm8994_hw_params()
2799 wm8994->lrclk_shared[0]) { in wm8994_hw_params()
2812 wm8994->lrclk_shared[1]) { in wm8994_hw_params()
2844 wm8994->channels[id] = params_channels(params); in wm8994_hw_params()
2846 wm8994->channels[id] > pdata->max_channels_clocked[id]) { in wm8994_hw_params()
2848 pdata->max_channels_clocked[id], wm8994->channels[id]); in wm8994_hw_params()
2849 wm8994->channels[id] = pdata->max_channels_clocked[id]; in wm8994_hw_params()
2852 switch (wm8994->channels[id]) { in wm8994_hw_params()
2872 dai->id, wm8994->aifclk[id], bclk_rate); in wm8994_hw_params()
2874 if (wm8994->channels[id] == 1 && in wm8994_hw_params()
2878 if (wm8994->aifclk[id] == 0) { in wm8994_hw_params()
2886 - wm8994->aifclk[id]); in wm8994_hw_params()
2889 - wm8994->aifclk[id]); in wm8994_hw_params()
2906 cur_val = (wm8994->aifclk[id] * 10 / bclk_divs[i]) - bclk_rate; in wm8994_hw_params()
2911 bclk_rate = wm8994->aifclk[id] * 10 / bclk_divs[best]; in wm8994_hw_params()
2936 wm8994->dac_rates[0] = params_rate(params); in wm8994_hw_params()
2941 wm8994->dac_rates[1] = params_rate(params); in wm8994_hw_params()
2955 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_aif3_hw_params() local
2956 struct wm8994 *control = wm8994->wm8994; in wm8994_aif3_hw_params()
3159 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_suspend() local
3162 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { in wm8994_component_suspend()
3163 memcpy(&wm8994->fll_suspend[i], &wm8994->fll[i], in wm8994_component_suspend()
3178 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_resume() local
3181 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { in wm8994_component_resume()
3182 if (!wm8994->fll_suspend[i].out) in wm8994_component_resume()
3186 wm8994->fll_suspend[i].src, in wm8994_component_resume()
3187 wm8994->fll_suspend[i].in, in wm8994_component_resume()
3188 wm8994->fll_suspend[i].out); in wm8994_component_resume()
3201 static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994) in wm8994_handle_retune_mobile_pdata() argument
3203 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_retune_mobile_pdata()
3204 struct wm8994 *control = wm8994->wm8994; in wm8994_handle_retune_mobile_pdata()
3208 wm8994->retune_mobile_enum, in wm8994_handle_retune_mobile_pdata()
3212 wm8994->retune_mobile_enum, in wm8994_handle_retune_mobile_pdata()
3216 wm8994->retune_mobile_enum, in wm8994_handle_retune_mobile_pdata()
3227 wm8994->num_retune_mobile_texts = 0; in wm8994_handle_retune_mobile_pdata()
3228 wm8994->retune_mobile_texts = NULL; in wm8994_handle_retune_mobile_pdata()
3230 for (j = 0; j < wm8994->num_retune_mobile_texts; j++) { in wm8994_handle_retune_mobile_pdata()
3232 wm8994->retune_mobile_texts[j]) == 0) in wm8994_handle_retune_mobile_pdata()
3236 if (j != wm8994->num_retune_mobile_texts) in wm8994_handle_retune_mobile_pdata()
3240 t = krealloc(wm8994->retune_mobile_texts, in wm8994_handle_retune_mobile_pdata()
3242 (wm8994->num_retune_mobile_texts + 1), in wm8994_handle_retune_mobile_pdata()
3248 t[wm8994->num_retune_mobile_texts] = in wm8994_handle_retune_mobile_pdata()
3252 wm8994->num_retune_mobile_texts++; in wm8994_handle_retune_mobile_pdata()
3253 wm8994->retune_mobile_texts = t; in wm8994_handle_retune_mobile_pdata()
3257 wm8994->num_retune_mobile_texts); in wm8994_handle_retune_mobile_pdata()
3259 wm8994->retune_mobile_enum.items = wm8994->num_retune_mobile_texts; in wm8994_handle_retune_mobile_pdata()
3260 wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts; in wm8994_handle_retune_mobile_pdata()
3262 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_retune_mobile_pdata()
3265 dev_err(wm8994->hubs.component->dev, in wm8994_handle_retune_mobile_pdata()
3269 static void wm8994_handle_pdata(struct wm8994_priv *wm8994) in wm8994_handle_pdata() argument
3271 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_pdata()
3272 struct wm8994 *control = wm8994->wm8994; in wm8994_handle_pdata()
3294 SOC_ENUM_EXT("AIF1DRC1 Mode", wm8994->drc_enum, in wm8994_handle_pdata()
3296 SOC_ENUM_EXT("AIF1DRC2 Mode", wm8994->drc_enum, in wm8994_handle_pdata()
3298 SOC_ENUM_EXT("AIF2DRC Mode", wm8994->drc_enum, in wm8994_handle_pdata()
3303 wm8994->drc_texts = devm_kcalloc(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3305 if (!wm8994->drc_texts) in wm8994_handle_pdata()
3309 wm8994->drc_texts[i] = pdata->drc_cfgs[i].name; in wm8994_handle_pdata()
3311 wm8994->drc_enum.items = pdata->num_drc_cfgs; in wm8994_handle_pdata()
3312 wm8994->drc_enum.texts = wm8994->drc_texts; in wm8994_handle_pdata()
3314 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_pdata()
3319 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8994_handle_pdata()
3325 dev_err(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3333 wm8994_handle_retune_mobile_pdata(wm8994); in wm8994_handle_pdata()
3335 snd_soc_add_component_controls(wm8994->hubs.component, wm8994_eq_controls, in wm8994_handle_pdata()
3365 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_mic_detect() local
3367 struct wm8994 *control = wm8994->wm8994; in wm8994_mic_detect()
3377 micdet = &wm8994->micdet[0]; in wm8994_mic_detect()
3384 micdet = &wm8994->micdet[1]; in wm8994_mic_detect()
3407 if (wm8994->micdet[0].jack || wm8994->micdet[1].jack) in wm8994_mic_detect()
3431 struct regmap *regmap = priv->wm8994->regmap; in wm8994_mic_work()
3432 struct device *dev = priv->wm8994->dev; in wm8994_mic_work()
3511 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_micd_stop() local
3513 if (!wm8994->jackdet) in wm1811_micd_stop()
3520 if (wm8994->wm8994->pdata.jd_ext_cap) in wm1811_micd_stop()
3526 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_button_det() local
3548 snd_soc_jack_report(wm8994->micdet[0].jack, report, in wm8958_button_det()
3549 wm8994->btn_mask); in wm8958_button_det()
3554 struct wm8994_priv *wm8994 = container_of(work, in wm8958_open_circuit_work() local
3557 struct device *dev = wm8994->wm8994->dev; in wm8958_open_circuit_work()
3559 mutex_lock(&wm8994->accdet_lock); in wm8958_open_circuit_work()
3561 wm1811_micd_stop(wm8994->hubs.component); in wm8958_open_circuit_work()
3565 wm8994->jack_mic = false; in wm8958_open_circuit_work()
3566 wm8994->mic_detecting = true; in wm8958_open_circuit_work()
3568 wm8958_micd_set_rate(wm8994->hubs.component); in wm8958_open_circuit_work()
3570 snd_soc_jack_report(wm8994->micdet[0].jack, 0, in wm8958_open_circuit_work()
3571 wm8994->btn_mask | in wm8958_open_circuit_work()
3574 mutex_unlock(&wm8994->accdet_lock); in wm8958_open_circuit_work()
3580 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_id() local
3588 &wm8994->open_circuit_work, in wm8958_mic_id()
3599 wm8994->mic_detecting = false; in wm8958_mic_id()
3600 wm8994->jack_mic = true; in wm8958_mic_id()
3604 snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_HEADSET, in wm8958_mic_id()
3611 wm8994->mic_detecting = false; in wm8958_mic_id()
3618 snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_HEADPHONE, in wm8958_mic_id()
3626 struct wm8994_priv *wm8994 = container_of(work, struct wm8994_priv, in wm1811_mic_work() local
3628 struct wm8994 *control = wm8994->wm8994; in wm1811_mic_work()
3629 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_mic_work()
3640 mutex_lock(&wm8994->accdet_lock); in wm1811_mic_work()
3645 if (wm8994->micd_cb) { in wm1811_mic_work()
3646 wm8994->micd_cb(wm8994->micd_cb_data); in wm1811_mic_work()
3652 wm8994->mic_detecting = true; in wm1811_mic_work()
3659 mutex_unlock(&wm8994->accdet_lock); in wm1811_mic_work()
3666 struct wm8994_priv *wm8994 = data; in wm1811_jackdet_irq() local
3667 struct wm8994 *control = wm8994->wm8994; in wm1811_jackdet_irq()
3668 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_jackdet_irq()
3675 cancel_delayed_work_sync(&wm8994->mic_complete_work); in wm1811_jackdet_irq()
3677 mutex_lock(&wm8994->accdet_lock); in wm1811_jackdet_irq()
3682 mutex_unlock(&wm8994->accdet_lock); in wm1811_jackdet_irq()
3705 &wm8994->mic_work, in wm1811_jackdet_irq()
3710 cancel_delayed_work_sync(&wm8994->mic_work); in wm1811_jackdet_irq()
3719 wm8994->mic_detecting = false; in wm1811_jackdet_irq()
3720 wm8994->jack_mic = false; in wm1811_jackdet_irq()
3726 mutex_unlock(&wm8994->accdet_lock); in wm1811_jackdet_irq()
3733 snd_soc_jack_report(wm8994->micdet[0].jack, in wm1811_jackdet_irq()
3736 snd_soc_jack_report(wm8994->micdet[0].jack, 0, in wm1811_jackdet_irq()
3738 wm8994->btn_mask); in wm1811_jackdet_irq()
3742 snd_soc_jack_report(wm8994->micdet[0].jack, 0, 0); in wm1811_jackdet_irq()
3750 struct wm8994_priv *wm8994 = container_of(work, in wm1811_jackdet_bootstrap() local
3753 wm1811_jackdet_irq(0, wm8994); in wm1811_jackdet_bootstrap()
3777 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_detect() local
3778 struct wm8994 *control = wm8994->wm8994; in wm8958_mic_detect()
3793 wm8994->micdet[0].jack = jack; in wm8958_mic_detect()
3796 wm8994->micd_cb = det_cb; in wm8958_mic_detect()
3797 wm8994->micd_cb_data = det_cb_data; in wm8958_mic_detect()
3799 wm8994->mic_detecting = true; in wm8958_mic_detect()
3800 wm8994->jack_mic = false; in wm8958_mic_detect()
3804 wm8994->mic_id_cb = id_cb; in wm8958_mic_detect()
3805 wm8994->mic_id_cb_data = id_cb_data; in wm8958_mic_detect()
3807 wm8994->mic_id_cb = wm8958_mic_id; in wm8958_mic_detect()
3808 wm8994->mic_id_cb_data = component; in wm8958_mic_detect()
3819 wm8994->btn_mask = SND_JACK_BTN_0 | SND_JACK_BTN_1 | in wm8958_mic_detect()
3832 if (wm8994->jackdet) { in wm8958_mic_detect()
3863 struct wm8994_priv *wm8994 = container_of(work, in wm8958_mic_work() local
3866 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_work()
3870 mutex_lock(&wm8994->accdet_lock); in wm8958_mic_work()
3872 wm8994->mic_id_cb(wm8994->mic_id_cb_data, wm8994->mic_status); in wm8958_mic_work()
3874 mutex_unlock(&wm8994->accdet_lock); in wm8958_mic_work()
3881 struct wm8994_priv *wm8994 = data; in wm8958_mic_irq() local
3882 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_irq()
3893 cancel_delayed_work_sync(&wm8994->mic_complete_work); in wm8958_mic_irq()
3894 cancel_delayed_work_sync(&wm8994->open_circuit_work); in wm8958_mic_irq()
3931 if (wm8994->jackdet) { in wm8958_mic_irq()
3941 snd_soc_jack_report(wm8994->micdet[0].jack, 0, in wm8958_mic_irq()
3943 wm8994->btn_mask); in wm8958_mic_irq()
3944 wm8994->mic_detecting = true; in wm8958_mic_irq()
3948 wm8994->mic_status = reg; in wm8958_mic_irq()
3949 id_delay = wm8994->wm8994->pdata.mic_id_delay; in wm8958_mic_irq()
3951 if (wm8994->mic_detecting) in wm8958_mic_irq()
3953 &wm8994->mic_complete_work, in wm8958_mic_irq()
3993 struct wm8994 *control = dev_get_drvdata(component->dev->parent); in wm8994_component_probe()
3994 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_probe() local
4000 wm8994->hubs.component = component; in wm8994_component_probe()
4002 mutex_init(&wm8994->accdet_lock); in wm8994_component_probe()
4003 INIT_DELAYED_WORK(&wm8994->jackdet_bootstrap, in wm8994_component_probe()
4005 INIT_DELAYED_WORK(&wm8994->open_circuit_work, in wm8994_component_probe()
4010 INIT_DELAYED_WORK(&wm8994->mic_work, wm8994_mic_work); in wm8994_component_probe()
4013 INIT_DELAYED_WORK(&wm8994->mic_work, wm1811_mic_work); in wm8994_component_probe()
4019 INIT_DELAYED_WORK(&wm8994->mic_complete_work, wm8958_mic_work); in wm8994_component_probe()
4021 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) in wm8994_component_probe()
4022 init_completion(&wm8994->fll_locked[i]); in wm8994_component_probe()
4024 wm8994->micdet_irq = control->pdata.micdet_irq; in wm8994_component_probe()
4040 wm8994->hubs.dcs_codes_l = -5; in wm8994_component_probe()
4041 wm8994->hubs.dcs_codes_r = -5; in wm8994_component_probe()
4042 wm8994->hubs.hp_startup_mode = 1; in wm8994_component_probe()
4043 wm8994->hubs.dcs_readback_mode = 1; in wm8994_component_probe()
4044 wm8994->hubs.series_startup = 1; in wm8994_component_probe()
4047 wm8994->hubs.dcs_readback_mode = 2; in wm8994_component_probe()
4053 wm8994->hubs.dcs_readback_mode = 1; in wm8994_component_probe()
4054 wm8994->hubs.hp_startup_mode = 1; in wm8994_component_probe()
4060 wm8994->fll_byp = true; in wm8994_component_probe()
4066 wm8994->hubs.dcs_readback_mode = 2; in wm8994_component_probe()
4067 wm8994->hubs.no_series_update = 1; in wm8994_component_probe()
4068 wm8994->hubs.hp_startup_mode = 1; in wm8994_component_probe()
4069 wm8994->hubs.no_cache_dac_hp_direct = true; in wm8994_component_probe()
4070 wm8994->fll_byp = true; in wm8994_component_probe()
4072 wm8994->hubs.dcs_codes_l = -9; in wm8994_component_probe()
4073 wm8994->hubs.dcs_codes_r = -7; in wm8994_component_probe()
4083 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, in wm8994_component_probe()
4085 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, in wm8994_component_probe()
4087 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, in wm8994_component_probe()
4092 if (wm8994->micdet_irq) in wm8994_component_probe()
4093 ret = request_threaded_irq(wm8994->micdet_irq, NULL, in wm8994_component_probe()
4098 wm8994); in wm8994_component_probe()
4100 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4103 wm8994); in wm8994_component_probe()
4111 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4114 wm8994); in wm8994_component_probe()
4120 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4123 wm8994); in wm8994_component_probe()
4129 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4132 wm8994); in wm8994_component_probe()
4141 if (wm8994->micdet_irq) { in wm8994_component_probe()
4142 ret = request_threaded_irq(wm8994->micdet_irq, NULL, in wm8994_component_probe()
4147 wm8994); in wm8994_component_probe()
4153 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_MIC1_DET, in wm8994_component_probe()
4155 wm8994); in wm8994_component_probe()
4162 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4165 wm8994); in wm8994_component_probe()
4167 wm8994->jackdet = true; in wm8994_component_probe()
4174 wm8994->fll_locked_irq = true; in wm8994_component_probe()
4175 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) { in wm8994_component_probe()
4176 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4179 &wm8994->fll_locked[i]); in wm8994_component_probe()
4181 wm8994->fll_locked_irq = false; in wm8994_component_probe()
4197 wm8994->lrclk_shared[0] = 1; in wm8994_component_probe()
4200 wm8994->lrclk_shared[0] = 0; in wm8994_component_probe()
4209 wm8994->lrclk_shared[1] = 1; in wm8994_component_probe()
4212 wm8994->lrclk_shared[1] = 0; in wm8994_component_probe()
4260 wm8994->hubs.check_class_w_digital = wm8994_check_class_w_digital; in wm8994_component_probe()
4263 wm8994_handle_pdata(wm8994); in wm8994_component_probe()
4332 ret = wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, in wm8994_component_probe()
4334 &wm8994->hubs); in wm8994_component_probe()
4336 wm8994->hubs.dcs_done_irq = true; in wm8994_component_probe()
4382 if (wm8994->jackdet) in wm8994_component_probe()
4383 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_GPIO(6), wm8994); in wm8994_component_probe()
4384 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_SHRT, wm8994); in wm8994_component_probe()
4385 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_DET, wm8994); in wm8994_component_probe()
4386 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_SHRT, wm8994); in wm8994_component_probe()
4387 if (wm8994->micdet_irq) in wm8994_component_probe()
4388 free_irq(wm8994->micdet_irq, wm8994); in wm8994_component_probe()
4389 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) in wm8994_component_probe()
4390 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i, in wm8994_component_probe()
4391 &wm8994->fll_locked[i]); in wm8994_component_probe()
4392 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, in wm8994_component_probe()
4393 &wm8994->hubs); in wm8994_component_probe()
4394 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_probe()
4395 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_probe()
4396 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_probe()
4403 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_remove() local
4404 struct wm8994 *control = wm8994->wm8994; in wm8994_component_remove()
4407 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) in wm8994_component_remove()
4408 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i, in wm8994_component_remove()
4409 &wm8994->fll_locked[i]); in wm8994_component_remove()
4411 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, in wm8994_component_remove()
4412 &wm8994->hubs); in wm8994_component_remove()
4413 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_remove()
4414 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_remove()
4415 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_remove()
4417 if (wm8994->jackdet) in wm8994_component_remove()
4418 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_GPIO(6), wm8994); in wm8994_component_remove()
4422 if (wm8994->micdet_irq) in wm8994_component_remove()
4423 free_irq(wm8994->micdet_irq, wm8994); in wm8994_component_remove()
4424 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_DET, in wm8994_component_remove()
4425 wm8994); in wm8994_component_remove()
4426 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_SHRT, in wm8994_component_remove()
4427 wm8994); in wm8994_component_remove()
4428 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_DET, in wm8994_component_remove()
4429 wm8994); in wm8994_component_remove()
4434 if (wm8994->micdet_irq) in wm8994_component_remove()
4435 free_irq(wm8994->micdet_irq, wm8994); in wm8994_component_remove()
4438 release_firmware(wm8994->mbc); in wm8994_component_remove()
4439 release_firmware(wm8994->mbc_vss); in wm8994_component_remove()
4440 release_firmware(wm8994->enh_eq); in wm8994_component_remove()
4441 kfree(wm8994->retune_mobile_texts); in wm8994_component_remove()
4458 struct wm8994_priv *wm8994; in wm8994_probe() local
4460 wm8994 = devm_kzalloc(&pdev->dev, sizeof(struct wm8994_priv), in wm8994_probe()
4462 if (wm8994 == NULL) in wm8994_probe()
4464 platform_set_drvdata(pdev, wm8994); in wm8994_probe()
4466 mutex_init(&wm8994->fw_lock); in wm8994_probe()
4468 wm8994->wm8994 = dev_get_drvdata(pdev->dev.parent); in wm8994_probe()
4487 struct wm8994_priv *wm8994 = dev_get_drvdata(dev); in wm8994_suspend() local
4490 if (wm8994->jackdet && !wm8994->active_refcount) in wm8994_suspend()
4491 regmap_update_bits(wm8994->wm8994->regmap, WM8994_ANTIPOP_2, in wm8994_suspend()
4493 wm8994->jackdet_mode); in wm8994_suspend()
4500 struct wm8994_priv *wm8994 = dev_get_drvdata(dev); in wm8994_resume() local
4502 if (wm8994->jackdet && wm8994->jackdet_mode) in wm8994_resume()
4503 regmap_update_bits(wm8994->wm8994->regmap, WM8994_ANTIPOP_2, in wm8994_resume()