Lines Matching refs:wm8994

113 	struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);  in wm8958_micd_set_rate()  local
114 struct wm8994 *control = wm8994->wm8994; in wm8958_micd_set_rate()
120 idle = !wm8994->jack_mic; in wm8958_micd_set_rate()
124 sysclk = wm8994->aifclk[1]; in wm8958_micd_set_rate()
126 sysclk = wm8994->aifclk[0]; in wm8958_micd_set_rate()
131 } else if (wm8994->jackdet) { in wm8958_micd_set_rate()
164 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_aif_clock() local
174 switch (wm8994->sysclk[aif]) { in configure_aif_clock()
176 rate = wm8994->mclk_rate[0]; in configure_aif_clock()
181 rate = wm8994->mclk_rate[1]; in configure_aif_clock()
186 rate = wm8994->fll[0].out; in configure_aif_clock()
191 rate = wm8994->fll[1].out; in configure_aif_clock()
206 wm8994->aifclk[aif] = rate; in configure_aif_clock()
218 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_clock() local
232 if (wm8994->aifclk[0] == wm8994->aifclk[1]) { in configure_clock()
237 if (wm8994->aifclk[0] < wm8994->aifclk[1]) in configure_clock()
325 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_drc() local
326 struct wm8994 *control = wm8994->wm8994; in wm8994_set_drc()
329 int cfg = wm8994->drc_cfg[drc]; in wm8994_set_drc()
362 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_drc_enum() local
363 struct wm8994 *control = wm8994->wm8994; in wm8994_put_drc_enum()
374 wm8994->drc_cfg[drc] = value; in wm8994_put_drc_enum()
385 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_drc_enum() local
390 ucontrol->value.enumerated.item[0] = wm8994->drc_cfg[drc]; in wm8994_get_drc_enum()
397 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_retune_mobile() local
398 struct wm8994 *control = wm8994->wm8994; in wm8994_set_retune_mobile()
403 if (!pdata || !wm8994->num_retune_mobile_texts) in wm8994_set_retune_mobile()
420 cfg = wm8994->retune_mobile_cfg[block]; in wm8994_set_retune_mobile()
425 wm8994->retune_mobile_texts[cfg]) == 0 && in wm8994_set_retune_mobile()
427 - wm8994->dac_rates[iface]) < best_val) { in wm8994_set_retune_mobile()
430 - wm8994->dac_rates[iface]); in wm8994_set_retune_mobile()
438 wm8994->dac_rates[iface]); in wm8994_set_retune_mobile()
469 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_retune_mobile_enum() local
470 struct wm8994 *control = wm8994->wm8994; in wm8994_put_retune_mobile_enum()
481 wm8994->retune_mobile_cfg[block] = value; in wm8994_put_retune_mobile_enum()
492 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_retune_mobile_enum() local
498 ucontrol->value.enumerated.item[0] = wm8994->retune_mobile_cfg[block]; in wm8994_get_retune_mobile_enum()
744 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_jackdet_set_mode() local
746 if (!wm8994->jackdet || !wm8994->micdet[0].jack) in wm1811_jackdet_set_mode()
749 if (wm8994->active_refcount) in wm1811_jackdet_set_mode()
752 if (mode == wm8994->jackdet_mode) in wm1811_jackdet_set_mode()
755 wm8994->jackdet_mode = mode; in wm1811_jackdet_set_mode()
767 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_reference() local
769 mutex_lock(&wm8994->accdet_lock); in active_reference()
771 wm8994->active_refcount++; in active_reference()
774 wm8994->active_refcount); in active_reference()
779 mutex_unlock(&wm8994->accdet_lock); in active_reference()
784 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_dereference() local
787 mutex_lock(&wm8994->accdet_lock); in active_dereference()
789 wm8994->active_refcount--; in active_dereference()
792 wm8994->active_refcount); in active_dereference()
794 if (wm8994->active_refcount == 0) { in active_dereference()
796 if (wm8994->jack_mic || wm8994->mic_detecting) in active_dereference()
804 mutex_unlock(&wm8994->accdet_lock); in active_dereference()
811 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in clk_sys_event() local
825 if (wm8994->jackdet && !wm8994->clk_has_run) { in clk_sys_event()
827 &wm8994->jackdet_bootstrap, in clk_sys_event()
829 wm8994->clk_has_run = true; in clk_sys_event()
843 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_reference() local
847 wm8994->vmid_refcount++; in vmid_reference()
850 wm8994->vmid_refcount); in vmid_reference()
852 if (wm8994->vmid_refcount == 1) { in vmid_reference()
859 switch (wm8994->vmid_mode) { in vmid_reference()
922 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_dereference() local
924 wm8994->vmid_refcount--; in vmid_dereference()
927 wm8994->vmid_refcount); in vmid_dereference()
929 if (wm8994->vmid_refcount == 0) { in vmid_dereference()
930 if (wm8994->hubs.lineout1_se) in vmid_dereference()
937 if (wm8994->hubs.lineout2_se) in vmid_dereference()
1041 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_update_vu_bits() local
1042 struct wm8994 *control = wm8994->wm8994; in wm8994_update_vu_bits()
1061 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif_mclk_set() local
1085 ret = clk_prepare_enable(wm8994->mclk[clk_idx].clk); in aif_mclk_set()
1092 clk_disable_unprepare(wm8994->mclk[clk_idx].clk); in aif_mclk_set()
1102 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_ev() local
1103 struct wm8994 *control = wm8994->wm8994; in aif1clk_ev()
1126 if (wm8994->channels[0] <= 2) in aif1clk_ev()
1299 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_late_ev() local
1303 wm8994->aif1clk_enable = 1; in aif1clk_late_ev()
1306 wm8994->aif1clk_disable = 1; in aif1clk_late_ev()
1317 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif2clk_late_ev() local
1321 wm8994->aif2clk_enable = 1; in aif2clk_late_ev()
1324 wm8994->aif2clk_disable = 1; in aif2clk_late_ev()
1335 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_enable_ev() local
1339 if (wm8994->aif1clk_enable) { in late_enable_ev()
1345 wm8994->aif1clk_enable = 0; in late_enable_ev()
1347 if (wm8994->aif2clk_enable) { in late_enable_ev()
1353 wm8994->aif2clk_enable = 0; in late_enable_ev()
1368 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_disable_ev() local
1372 if (wm8994->aif1clk_disable) { in late_disable_ev()
1377 wm8994->aif1clk_disable = 0; in late_disable_ev()
1379 if (wm8994->aif2clk_disable) { in late_disable_ev()
1384 wm8994->aif2clk_disable = 0; in late_disable_ev()
2122 static int wm8994_get_fll_config(struct wm8994 *control, struct fll_div *fll, in wm8994_get_fll_config()
2208 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in _wm8994_set_fll() local
2209 struct wm8994 *control = wm8994->wm8994; in _wm8994_set_fll()
2240 src = wm8994->fll[id].src; in _wm8994_set_fll()
2256 if (wm8994->fll[id].src == src && in _wm8994_set_fll()
2257 wm8994->fll[id].in == freq_in && wm8994->fll[id].out == freq_out) in _wm8994_set_fll()
2267 ret = wm8994_get_fll_config(control, &fll, wm8994->fll[id].in, in _wm8994_set_fll()
2268 wm8994->fll[id].out); in _wm8994_set_fll()
2300 mclk = wm8994->mclk[WM8994_MCLK1].clk; in _wm8994_set_fll()
2303 mclk = wm8994->mclk[WM8994_MCLK2].clk; in _wm8994_set_fll()
2312 if (wm8994->fll_byp && src == WM8994_FLL_SRC_BCLK && in _wm8994_set_fll()
2354 try_wait_for_completion(&wm8994->fll_locked[id]); in _wm8994_set_fll()
2358 mclk = wm8994->mclk[WM8994_MCLK1].clk; in _wm8994_set_fll()
2361 mclk = wm8994->mclk[WM8994_MCLK2].clk; in _wm8994_set_fll()
2405 if (wm8994->fll_locked_irq) { in _wm8994_set_fll()
2406 timeout = wait_for_completion_timeout(&wm8994->fll_locked[id], in _wm8994_set_fll()
2433 wm8994->fll[id].in = freq_in; in _wm8994_set_fll()
2434 wm8994->fll[id].out = freq_out; in _wm8994_set_fll()
2435 wm8994->fll[id].src = src; in _wm8994_set_fll()
2443 if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) { in _wm8994_set_fll()
2446 wm8994->aifdiv[0] = snd_soc_component_read(component, WM8994_AIF1_RATE) in _wm8994_set_fll()
2448 wm8994->aifdiv[1] = snd_soc_component_read(component, WM8994_AIF2_RATE) in _wm8994_set_fll()
2455 } else if (wm8994->aifdiv[0]) { in _wm8994_set_fll()
2458 wm8994->aifdiv[0]); in _wm8994_set_fll()
2461 wm8994->aifdiv[1]); in _wm8994_set_fll()
2463 wm8994->aifdiv[0] = 0; in _wm8994_set_fll()
2464 wm8994->aifdiv[1] = 0; in _wm8994_set_fll()
2487 static int wm8994_set_mclk_rate(struct wm8994_priv *wm8994, unsigned int id, in wm8994_set_mclk_rate() argument
2492 if (!wm8994->mclk[id].clk || *freq == wm8994->mclk_rate[id]) in wm8994_set_mclk_rate()
2495 ret = clk_set_rate(wm8994->mclk[id].clk, *freq); in wm8994_set_mclk_rate()
2499 *freq = clk_get_rate(wm8994->mclk[id].clk); in wm8994_set_mclk_rate()
2508 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_sysclk() local
2523 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK1; in wm8994_set_dai_sysclk()
2525 ret = wm8994_set_mclk_rate(wm8994, dai->id - 1, &freq); in wm8994_set_dai_sysclk()
2529 wm8994->mclk_rate[0] = freq; in wm8994_set_dai_sysclk()
2536 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK2; in wm8994_set_dai_sysclk()
2538 ret = wm8994_set_mclk_rate(wm8994, dai->id - 1, &freq); in wm8994_set_dai_sysclk()
2542 wm8994->mclk_rate[1] = freq; in wm8994_set_dai_sysclk()
2548 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_FLL1; in wm8994_set_dai_sysclk()
2553 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_FLL2; in wm8994_set_dai_sysclk()
2587 if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) { in wm8994_set_dai_sysclk()
2590 wm8994->aifdiv[0] = snd_soc_component_read(component, WM8994_AIF1_RATE) in wm8994_set_dai_sysclk()
2592 wm8994->aifdiv[1] = snd_soc_component_read(component, WM8994_AIF2_RATE) in wm8994_set_dai_sysclk()
2599 } else if (wm8994->aifdiv[0]) { in wm8994_set_dai_sysclk()
2602 wm8994->aifdiv[0]); in wm8994_set_dai_sysclk()
2605 wm8994->aifdiv[1]); in wm8994_set_dai_sysclk()
2607 wm8994->aifdiv[0] = 0; in wm8994_set_dai_sysclk()
2608 wm8994->aifdiv[1] = 0; in wm8994_set_dai_sysclk()
2617 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_bias_level() local
2618 struct wm8994 *control = wm8994->wm8994; in wm8994_set_bias_level()
2690 wm8994->cur_fw = NULL; in wm8994_set_bias_level()
2699 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_vmid_mode() local
2706 if (wm8994->hubs.lineout1_se) { in wm8994_vmid_mode()
2712 if (wm8994->hubs.lineout2_se) { in wm8994_vmid_mode()
2721 wm8994->vmid_mode = mode; in wm8994_vmid_mode()
2729 if (wm8994->hubs.lineout1_se) { in wm8994_vmid_mode()
2735 if (wm8994->hubs.lineout2_se) { in wm8994_vmid_mode()
2742 wm8994->vmid_mode = mode; in wm8994_vmid_mode()
2758 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_fmt() local
2759 struct wm8994 *control = wm8994->wm8994; in wm8994_set_dai_fmt()
2914 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_hw_params() local
2915 struct wm8994 *control = wm8994->wm8994; in wm8994_hw_params()
2938 wm8994->lrclk_shared[0]) { in wm8994_hw_params()
2951 wm8994->lrclk_shared[1]) { in wm8994_hw_params()
2983 wm8994->channels[id] = params_channels(params); in wm8994_hw_params()
2985 wm8994->channels[id] > pdata->max_channels_clocked[id]) { in wm8994_hw_params()
2987 pdata->max_channels_clocked[id], wm8994->channels[id]); in wm8994_hw_params()
2988 wm8994->channels[id] = pdata->max_channels_clocked[id]; in wm8994_hw_params()
2991 switch (wm8994->channels[id]) { in wm8994_hw_params()
3011 dai->id, wm8994->aifclk[id], bclk_rate); in wm8994_hw_params()
3013 if (wm8994->channels[id] == 1 && in wm8994_hw_params()
3017 if (wm8994->aifclk[id] == 0) { in wm8994_hw_params()
3025 - wm8994->aifclk[id]); in wm8994_hw_params()
3028 - wm8994->aifclk[id]); in wm8994_hw_params()
3045 cur_val = (wm8994->aifclk[id] * 10 / bclk_divs[i]) - bclk_rate; in wm8994_hw_params()
3050 bclk_rate = wm8994->aifclk[id] * 10 / bclk_divs[best]; in wm8994_hw_params()
3075 wm8994->dac_rates[0] = params_rate(params); in wm8994_hw_params()
3080 wm8994->dac_rates[1] = params_rate(params); in wm8994_hw_params()
3094 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_aif3_hw_params() local
3095 struct wm8994 *control = wm8994->wm8994; in wm8994_aif3_hw_params()
3301 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_suspend() local
3304 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { in wm8994_component_suspend()
3305 memcpy(&wm8994->fll_suspend[i], &wm8994->fll[i], in wm8994_component_suspend()
3320 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_resume() local
3323 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) { in wm8994_component_resume()
3324 if (!wm8994->fll_suspend[i].out) in wm8994_component_resume()
3328 wm8994->fll_suspend[i].src, in wm8994_component_resume()
3329 wm8994->fll_suspend[i].in, in wm8994_component_resume()
3330 wm8994->fll_suspend[i].out); in wm8994_component_resume()
3343 static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994) in wm8994_handle_retune_mobile_pdata() argument
3345 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_retune_mobile_pdata()
3346 struct wm8994 *control = wm8994->wm8994; in wm8994_handle_retune_mobile_pdata()
3350 wm8994->retune_mobile_enum, in wm8994_handle_retune_mobile_pdata()
3354 wm8994->retune_mobile_enum, in wm8994_handle_retune_mobile_pdata()
3358 wm8994->retune_mobile_enum, in wm8994_handle_retune_mobile_pdata()
3369 wm8994->num_retune_mobile_texts = 0; in wm8994_handle_retune_mobile_pdata()
3370 wm8994->retune_mobile_texts = NULL; in wm8994_handle_retune_mobile_pdata()
3372 for (j = 0; j < wm8994->num_retune_mobile_texts; j++) { in wm8994_handle_retune_mobile_pdata()
3374 wm8994->retune_mobile_texts[j]) == 0) in wm8994_handle_retune_mobile_pdata()
3378 if (j != wm8994->num_retune_mobile_texts) in wm8994_handle_retune_mobile_pdata()
3382 t = krealloc(wm8994->retune_mobile_texts, in wm8994_handle_retune_mobile_pdata()
3384 (wm8994->num_retune_mobile_texts + 1), in wm8994_handle_retune_mobile_pdata()
3390 t[wm8994->num_retune_mobile_texts] = in wm8994_handle_retune_mobile_pdata()
3394 wm8994->num_retune_mobile_texts++; in wm8994_handle_retune_mobile_pdata()
3395 wm8994->retune_mobile_texts = t; in wm8994_handle_retune_mobile_pdata()
3399 wm8994->num_retune_mobile_texts); in wm8994_handle_retune_mobile_pdata()
3401 wm8994->retune_mobile_enum.items = wm8994->num_retune_mobile_texts; in wm8994_handle_retune_mobile_pdata()
3402 wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts; in wm8994_handle_retune_mobile_pdata()
3404 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_retune_mobile_pdata()
3407 dev_err(wm8994->hubs.component->dev, in wm8994_handle_retune_mobile_pdata()
3411 static void wm8994_handle_pdata(struct wm8994_priv *wm8994) in wm8994_handle_pdata() argument
3413 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_pdata()
3414 struct wm8994 *control = wm8994->wm8994; in wm8994_handle_pdata()
3436 SOC_ENUM_EXT("AIF1DRC1 Mode", wm8994->drc_enum, in wm8994_handle_pdata()
3438 SOC_ENUM_EXT("AIF1DRC2 Mode", wm8994->drc_enum, in wm8994_handle_pdata()
3440 SOC_ENUM_EXT("AIF2DRC Mode", wm8994->drc_enum, in wm8994_handle_pdata()
3445 wm8994->drc_texts = devm_kcalloc(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3447 if (!wm8994->drc_texts) in wm8994_handle_pdata()
3451 wm8994->drc_texts[i] = pdata->drc_cfgs[i].name; in wm8994_handle_pdata()
3453 wm8994->drc_enum.items = pdata->num_drc_cfgs; in wm8994_handle_pdata()
3454 wm8994->drc_enum.texts = wm8994->drc_texts; in wm8994_handle_pdata()
3456 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_pdata()
3461 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8994_handle_pdata()
3467 dev_err(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3475 wm8994_handle_retune_mobile_pdata(wm8994); in wm8994_handle_pdata()
3477 snd_soc_add_component_controls(wm8994->hubs.component, wm8994_eq_controls, in wm8994_handle_pdata()
3507 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_mic_detect() local
3509 struct wm8994 *control = wm8994->wm8994; in wm8994_mic_detect()
3521 micdet = &wm8994->micdet[0]; in wm8994_mic_detect()
3528 micdet = &wm8994->micdet[1]; in wm8994_mic_detect()
3551 if (wm8994->micdet[0].jack || wm8994->micdet[1].jack) in wm8994_mic_detect()
3577 struct regmap *regmap = priv->wm8994->regmap; in wm8994_mic_work()
3578 struct device *dev = priv->wm8994->dev; in wm8994_mic_work()
3657 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_micd_stop() local
3659 if (!wm8994->jackdet) in wm1811_micd_stop()
3666 if (wm8994->wm8994->pdata.jd_ext_cap) in wm1811_micd_stop()
3672 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_button_det() local
3694 snd_soc_jack_report(wm8994->micdet[0].jack, report, in wm8958_button_det()
3695 wm8994->btn_mask); in wm8958_button_det()
3700 struct wm8994_priv *wm8994 = container_of(work, in wm8958_open_circuit_work() local
3703 struct device *dev = wm8994->wm8994->dev; in wm8958_open_circuit_work()
3705 mutex_lock(&wm8994->accdet_lock); in wm8958_open_circuit_work()
3707 wm1811_micd_stop(wm8994->hubs.component); in wm8958_open_circuit_work()
3711 wm8994->jack_mic = false; in wm8958_open_circuit_work()
3712 wm8994->mic_detecting = true; in wm8958_open_circuit_work()
3714 wm8958_micd_set_rate(wm8994->hubs.component); in wm8958_open_circuit_work()
3716 snd_soc_jack_report(wm8994->micdet[0].jack, 0, in wm8958_open_circuit_work()
3717 wm8994->btn_mask | in wm8958_open_circuit_work()
3720 mutex_unlock(&wm8994->accdet_lock); in wm8958_open_circuit_work()
3726 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_id() local
3734 &wm8994->open_circuit_work, in wm8958_mic_id()
3745 wm8994->mic_detecting = false; in wm8958_mic_id()
3746 wm8994->jack_mic = true; in wm8958_mic_id()
3750 snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_HEADSET, in wm8958_mic_id()
3757 wm8994->mic_detecting = false; in wm8958_mic_id()
3764 snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_HEADPHONE, in wm8958_mic_id()
3772 struct wm8994_priv *wm8994 = container_of(work, struct wm8994_priv, in wm1811_mic_work() local
3774 struct wm8994 *control = wm8994->wm8994; in wm1811_mic_work()
3775 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_mic_work()
3786 mutex_lock(&wm8994->accdet_lock); in wm1811_mic_work()
3791 if (wm8994->micd_cb) { in wm1811_mic_work()
3792 wm8994->micd_cb(wm8994->micd_cb_data); in wm1811_mic_work()
3798 wm8994->mic_detecting = true; in wm1811_mic_work()
3805 mutex_unlock(&wm8994->accdet_lock); in wm1811_mic_work()
3812 struct wm8994_priv *wm8994 = data; in wm1811_jackdet_irq() local
3813 struct wm8994 *control = wm8994->wm8994; in wm1811_jackdet_irq()
3814 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_jackdet_irq()
3821 cancel_delayed_work_sync(&wm8994->mic_complete_work); in wm1811_jackdet_irq()
3823 mutex_lock(&wm8994->accdet_lock); in wm1811_jackdet_irq()
3828 mutex_unlock(&wm8994->accdet_lock); in wm1811_jackdet_irq()
3851 &wm8994->mic_work, in wm1811_jackdet_irq()
3856 cancel_delayed_work_sync(&wm8994->mic_work); in wm1811_jackdet_irq()
3865 wm8994->mic_detecting = false; in wm1811_jackdet_irq()
3866 wm8994->jack_mic = false; in wm1811_jackdet_irq()
3872 mutex_unlock(&wm8994->accdet_lock); in wm1811_jackdet_irq()
3879 snd_soc_jack_report(wm8994->micdet[0].jack, in wm1811_jackdet_irq()
3882 snd_soc_jack_report(wm8994->micdet[0].jack, 0, in wm1811_jackdet_irq()
3884 wm8994->btn_mask); in wm1811_jackdet_irq()
3888 snd_soc_jack_report(wm8994->micdet[0].jack, 0, 0); in wm1811_jackdet_irq()
3896 struct wm8994_priv *wm8994 = container_of(work, in wm1811_jackdet_bootstrap() local
3899 wm1811_jackdet_irq(0, wm8994); in wm1811_jackdet_bootstrap()
3927 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_detect() local
3928 struct wm8994 *control = wm8994->wm8994; in wm8958_mic_detect()
3945 wm8994->micdet[0].jack = jack; in wm8958_mic_detect()
3948 wm8994->micd_cb = det_cb; in wm8958_mic_detect()
3949 wm8994->micd_cb_data = det_cb_data; in wm8958_mic_detect()
3951 wm8994->mic_detecting = true; in wm8958_mic_detect()
3952 wm8994->jack_mic = false; in wm8958_mic_detect()
3956 wm8994->mic_id_cb = id_cb; in wm8958_mic_detect()
3957 wm8994->mic_id_cb_data = id_cb_data; in wm8958_mic_detect()
3959 wm8994->mic_id_cb = wm8958_mic_id; in wm8958_mic_detect()
3960 wm8994->mic_id_cb_data = component; in wm8958_mic_detect()
3971 wm8994->btn_mask = SND_JACK_BTN_0 | SND_JACK_BTN_1 | in wm8958_mic_detect()
3984 if (wm8994->jackdet) { in wm8958_mic_detect()
4017 struct wm8994_priv *wm8994 = container_of(work, in wm8958_mic_work() local
4020 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_work()
4024 mutex_lock(&wm8994->accdet_lock); in wm8958_mic_work()
4026 wm8994->mic_id_cb(wm8994->mic_id_cb_data, wm8994->mic_status); in wm8958_mic_work()
4028 mutex_unlock(&wm8994->accdet_lock); in wm8958_mic_work()
4035 struct wm8994_priv *wm8994 = data; in wm8958_mic_irq() local
4036 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_irq()
4047 cancel_delayed_work_sync(&wm8994->mic_complete_work); in wm8958_mic_irq()
4048 cancel_delayed_work_sync(&wm8994->open_circuit_work); in wm8958_mic_irq()
4085 if (wm8994->jackdet) { in wm8958_mic_irq()
4095 snd_soc_jack_report(wm8994->micdet[0].jack, 0, in wm8958_mic_irq()
4097 wm8994->btn_mask); in wm8958_mic_irq()
4098 wm8994->mic_detecting = true; in wm8958_mic_irq()
4102 wm8994->mic_status = reg; in wm8958_mic_irq()
4103 id_delay = wm8994->wm8994->pdata.mic_id_delay; in wm8958_mic_irq()
4105 if (wm8994->mic_detecting) in wm8958_mic_irq()
4107 &wm8994->mic_complete_work, in wm8958_mic_irq()
4147 struct wm8994 *control = dev_get_drvdata(component->dev->parent); in wm8994_component_probe()
4148 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_probe() local
4154 wm8994->hubs.component = component; in wm8994_component_probe()
4156 mutex_init(&wm8994->accdet_lock); in wm8994_component_probe()
4157 INIT_DELAYED_WORK(&wm8994->jackdet_bootstrap, in wm8994_component_probe()
4159 INIT_DELAYED_WORK(&wm8994->open_circuit_work, in wm8994_component_probe()
4164 INIT_DELAYED_WORK(&wm8994->mic_work, wm8994_mic_work); in wm8994_component_probe()
4167 INIT_DELAYED_WORK(&wm8994->mic_work, wm1811_mic_work); in wm8994_component_probe()
4173 INIT_DELAYED_WORK(&wm8994->mic_complete_work, wm8958_mic_work); in wm8994_component_probe()
4175 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) in wm8994_component_probe()
4176 init_completion(&wm8994->fll_locked[i]); in wm8994_component_probe()
4178 wm8994->micdet_irq = control->pdata.micdet_irq; in wm8994_component_probe()
4194 wm8994->hubs.dcs_codes_l = -5; in wm8994_component_probe()
4195 wm8994->hubs.dcs_codes_r = -5; in wm8994_component_probe()
4196 wm8994->hubs.hp_startup_mode = 1; in wm8994_component_probe()
4197 wm8994->hubs.dcs_readback_mode = 1; in wm8994_component_probe()
4198 wm8994->hubs.series_startup = 1; in wm8994_component_probe()
4201 wm8994->hubs.dcs_readback_mode = 2; in wm8994_component_probe()
4204 wm8994->hubs.micd_scthr = true; in wm8994_component_probe()
4208 wm8994->hubs.dcs_readback_mode = 1; in wm8994_component_probe()
4209 wm8994->hubs.hp_startup_mode = 1; in wm8994_component_probe()
4210 wm8994->hubs.micd_scthr = true; in wm8994_component_probe()
4216 wm8994->fll_byp = true; in wm8994_component_probe()
4222 wm8994->hubs.dcs_readback_mode = 2; in wm8994_component_probe()
4223 wm8994->hubs.no_series_update = 1; in wm8994_component_probe()
4224 wm8994->hubs.hp_startup_mode = 1; in wm8994_component_probe()
4225 wm8994->hubs.no_cache_dac_hp_direct = true; in wm8994_component_probe()
4226 wm8994->fll_byp = true; in wm8994_component_probe()
4228 wm8994->hubs.dcs_codes_l = -9; in wm8994_component_probe()
4229 wm8994->hubs.dcs_codes_r = -7; in wm8994_component_probe()
4239 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, in wm8994_component_probe()
4241 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, in wm8994_component_probe()
4243 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, in wm8994_component_probe()
4248 if (wm8994->micdet_irq) in wm8994_component_probe()
4249 ret = request_threaded_irq(wm8994->micdet_irq, NULL, in wm8994_component_probe()
4254 wm8994); in wm8994_component_probe()
4256 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4259 wm8994); in wm8994_component_probe()
4267 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4270 wm8994); in wm8994_component_probe()
4276 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4279 wm8994); in wm8994_component_probe()
4285 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4288 wm8994); in wm8994_component_probe()
4297 if (wm8994->micdet_irq) { in wm8994_component_probe()
4298 ret = request_threaded_irq(wm8994->micdet_irq, NULL, in wm8994_component_probe()
4303 wm8994); in wm8994_component_probe()
4309 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_MIC1_DET, in wm8994_component_probe()
4311 wm8994); in wm8994_component_probe()
4318 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4321 wm8994); in wm8994_component_probe()
4323 wm8994->jackdet = true; in wm8994_component_probe()
4330 wm8994->fll_locked_irq = true; in wm8994_component_probe()
4331 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) { in wm8994_component_probe()
4332 ret = wm8994_request_irq(wm8994->wm8994, in wm8994_component_probe()
4335 &wm8994->fll_locked[i]); in wm8994_component_probe()
4337 wm8994->fll_locked_irq = false; in wm8994_component_probe()
4353 wm8994->lrclk_shared[0] = 1; in wm8994_component_probe()
4356 wm8994->lrclk_shared[0] = 0; in wm8994_component_probe()
4365 wm8994->lrclk_shared[1] = 1; in wm8994_component_probe()
4368 wm8994->lrclk_shared[1] = 0; in wm8994_component_probe()
4424 wm8994->hubs.check_class_w_digital = wm8994_check_class_w_digital; in wm8994_component_probe()
4427 wm8994_handle_pdata(wm8994); in wm8994_component_probe()
4496 ret = wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, in wm8994_component_probe()
4498 &wm8994->hubs); in wm8994_component_probe()
4500 wm8994->hubs.dcs_done_irq = true; in wm8994_component_probe()
4546 if (wm8994->jackdet) in wm8994_component_probe()
4547 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_GPIO(6), wm8994); in wm8994_component_probe()
4548 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_SHRT, wm8994); in wm8994_component_probe()
4549 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_DET, wm8994); in wm8994_component_probe()
4550 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_SHRT, wm8994); in wm8994_component_probe()
4551 if (wm8994->micdet_irq) in wm8994_component_probe()
4552 free_irq(wm8994->micdet_irq, wm8994); in wm8994_component_probe()
4553 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) in wm8994_component_probe()
4554 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i, in wm8994_component_probe()
4555 &wm8994->fll_locked[i]); in wm8994_component_probe()
4556 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, in wm8994_component_probe()
4557 &wm8994->hubs); in wm8994_component_probe()
4558 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_probe()
4559 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_probe()
4560 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_probe()
4567 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_remove() local
4568 struct wm8994 *control = wm8994->wm8994; in wm8994_component_remove()
4571 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) in wm8994_component_remove()
4572 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i, in wm8994_component_remove()
4573 &wm8994->fll_locked[i]); in wm8994_component_remove()
4575 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE, in wm8994_component_remove()
4576 &wm8994->hubs); in wm8994_component_remove()
4577 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_remove()
4578 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_remove()
4579 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_remove()
4581 if (wm8994->jackdet) in wm8994_component_remove()
4582 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_GPIO(6), wm8994); in wm8994_component_remove()
4586 if (wm8994->micdet_irq) in wm8994_component_remove()
4587 free_irq(wm8994->micdet_irq, wm8994); in wm8994_component_remove()
4588 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_DET, in wm8994_component_remove()
4589 wm8994); in wm8994_component_remove()
4590 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_SHRT, in wm8994_component_remove()
4591 wm8994); in wm8994_component_remove()
4592 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_DET, in wm8994_component_remove()
4593 wm8994); in wm8994_component_remove()
4598 if (wm8994->micdet_irq) in wm8994_component_remove()
4599 free_irq(wm8994->micdet_irq, wm8994); in wm8994_component_remove()
4602 release_firmware(wm8994->mbc); in wm8994_component_remove()
4603 release_firmware(wm8994->mbc_vss); in wm8994_component_remove()
4604 release_firmware(wm8994->enh_eq); in wm8994_component_remove()
4605 kfree(wm8994->retune_mobile_texts); in wm8994_component_remove()
4622 struct wm8994_priv *wm8994; in wm8994_probe() local
4625 wm8994 = devm_kzalloc(&pdev->dev, sizeof(struct wm8994_priv), in wm8994_probe()
4627 if (wm8994 == NULL) in wm8994_probe()
4629 platform_set_drvdata(pdev, wm8994); in wm8994_probe()
4631 mutex_init(&wm8994->fw_lock); in wm8994_probe()
4633 wm8994->wm8994 = dev_get_drvdata(pdev->dev.parent); in wm8994_probe()
4635 wm8994->mclk[WM8994_MCLK1].id = "MCLK1"; in wm8994_probe()
4636 wm8994->mclk[WM8994_MCLK2].id = "MCLK2"; in wm8994_probe()
4638 ret = devm_clk_bulk_get_optional(pdev->dev.parent, ARRAY_SIZE(wm8994->mclk), in wm8994_probe()
4639 wm8994->mclk); in wm8994_probe()
4662 struct wm8994_priv *wm8994 = dev_get_drvdata(dev); in wm8994_suspend() local
4665 if (wm8994->jackdet && !wm8994->active_refcount) in wm8994_suspend()
4666 regmap_update_bits(wm8994->wm8994->regmap, WM8994_ANTIPOP_2, in wm8994_suspend()
4668 wm8994->jackdet_mode); in wm8994_suspend()
4675 struct wm8994_priv *wm8994 = dev_get_drvdata(dev); in wm8994_resume() local
4677 if (wm8994->jackdet && wm8994->jackdet_mode) in wm8994_resume()
4678 regmap_update_bits(wm8994->wm8994->regmap, WM8994_ANTIPOP_2, in wm8994_resume()