Lines Matching defs:wm8994

3  * wm8994.c  --  WM8994 ALSA SoC Audio driver
30 #include <linux/mfd/wm8994/core.h>
31 #include <linux/mfd/wm8994/registers.h>
32 #include <linux/mfd/wm8994/pdata.h>
33 #include <linux/mfd/wm8994/gpio.h>
35 #include "wm8994.h"
113 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
114 struct wm8994 *control = wm8994->wm8994;
120 idle = !wm8994->jack_mic;
124 sysclk = wm8994->aifclk[1];
126 sysclk = wm8994->aifclk[0];
131 } else if (wm8994->jackdet) {
164 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
174 switch (wm8994->sysclk[aif]) {
176 rate = wm8994->mclk_rate[0];
181 rate = wm8994->mclk_rate[1];
186 rate = wm8994->fll[0].out;
191 rate = wm8994->fll[1].out;
206 wm8994->aifclk[aif] = rate;
218 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
232 if (wm8994->aifclk[0] == wm8994->aifclk[1]) {
237 if (wm8994->aifclk[0] < wm8994->aifclk[1])
325 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
326 struct wm8994 *control = wm8994->wm8994;
329 int cfg = wm8994->drc_cfg[drc];
362 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
363 struct wm8994 *control = wm8994->wm8994;
374 wm8994->drc_cfg[drc] = value;
385 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
390 ucontrol->value.enumerated.item[0] = wm8994->drc_cfg[drc];
397 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
398 struct wm8994 *control = wm8994->wm8994;
403 if (!pdata || !wm8994->num_retune_mobile_texts)
420 cfg = wm8994->retune_mobile_cfg[block];
425 wm8994->retune_mobile_texts[cfg]) == 0 &&
427 - wm8994->dac_rates[iface]) < best_val) {
430 - wm8994->dac_rates[iface]);
438 wm8994->dac_rates[iface]);
469 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
470 struct wm8994 *control = wm8994->wm8994;
481 wm8994->retune_mobile_cfg[block] = value;
492 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
498 ucontrol->value.enumerated.item[0] = wm8994->retune_mobile_cfg[block];
744 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
746 if (!wm8994->jackdet || !wm8994->micdet[0].jack)
749 if (wm8994->active_refcount)
752 if (mode == wm8994->jackdet_mode)
755 wm8994->jackdet_mode = mode;
767 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
769 mutex_lock(&wm8994->accdet_lock);
771 wm8994->active_refcount++;
774 wm8994->active_refcount);
779 mutex_unlock(&wm8994->accdet_lock);
784 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
787 mutex_lock(&wm8994->accdet_lock);
789 wm8994->active_refcount--;
792 wm8994->active_refcount);
794 if (wm8994->active_refcount == 0) {
796 if (wm8994->jack_mic || wm8994->mic_detecting)
804 mutex_unlock(&wm8994->accdet_lock);
811 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
825 if (wm8994->jackdet && !wm8994->clk_has_run) {
827 &wm8994->jackdet_bootstrap,
829 wm8994->clk_has_run = true;
843 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
847 wm8994->vmid_refcount++;
850 wm8994->vmid_refcount);
852 if (wm8994->vmid_refcount == 1) {
859 switch (wm8994->vmid_mode) {
922 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
924 wm8994->vmid_refcount--;
927 wm8994->vmid_refcount);
929 if (wm8994->vmid_refcount == 0) {
930 if (wm8994->hubs.lineout1_se)
937 if (wm8994->hubs.lineout2_se)
1041 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
1042 struct wm8994 *control = wm8994->wm8994;
1061 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
1085 ret = clk_prepare_enable(wm8994->mclk[clk_idx].clk);
1092 clk_disable_unprepare(wm8994->mclk[clk_idx].clk);
1102 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
1103 struct wm8994 *control = wm8994->wm8994;
1126 if (wm8994->channels[0] <= 2)
1299 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
1303 wm8994->aif1clk_enable = 1;
1306 wm8994->aif1clk_disable = 1;
1317 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
1321 wm8994->aif2clk_enable = 1;
1324 wm8994->aif2clk_disable = 1;
1335 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
1339 if (wm8994->aif1clk_enable) {
1345 wm8994->aif1clk_enable = 0;
1347 if (wm8994->aif2clk_enable) {
1353 wm8994->aif2clk_enable = 0;
1368 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
1372 if (wm8994->aif1clk_disable) {
1377 wm8994->aif1clk_disable = 0;
1379 if (wm8994->aif2clk_disable) {
1384 wm8994->aif2clk_disable = 0;
2122 static int wm8994_get_fll_config(struct wm8994 *control, struct fll_div *fll,
2208 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
2209 struct wm8994 *control = wm8994->wm8994;
2240 src = wm8994->fll[id].src;
2256 if (wm8994->fll[id].src == src &&
2257 wm8994->fll[id].in == freq_in && wm8994->fll[id].out == freq_out)
2267 ret = wm8994_get_fll_config(control, &fll, wm8994->fll[id].in,
2268 wm8994->fll[id].out);
2300 mclk = wm8994->mclk[WM8994_MCLK1].clk;
2303 mclk = wm8994->mclk[WM8994_MCLK2].clk;
2312 if (wm8994->fll_byp && src == WM8994_FLL_SRC_BCLK &&
2354 try_wait_for_completion(&wm8994->fll_locked[id]);
2358 mclk = wm8994->mclk[WM8994_MCLK1].clk;
2361 mclk = wm8994->mclk[WM8994_MCLK2].clk;
2405 if (wm8994->fll_locked_irq) {
2406 timeout = wait_for_completion_timeout(&wm8994->fll_locked[id],
2433 wm8994->fll[id].in = freq_in;
2434 wm8994->fll[id].out = freq_out;
2435 wm8994->fll[id].src = src;
2443 if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) {
2446 wm8994->aifdiv[0] = snd_soc_component_read(component, WM8994_AIF1_RATE)
2448 wm8994->aifdiv[1] = snd_soc_component_read(component, WM8994_AIF2_RATE)
2455 } else if (wm8994->aifdiv[0]) {
2458 wm8994->aifdiv[0]);
2461 wm8994->aifdiv[1]);
2463 wm8994->aifdiv[0] = 0;
2464 wm8994->aifdiv[1] = 0;
2487 static int wm8994_set_mclk_rate(struct wm8994_priv *wm8994, unsigned int id,
2492 if (!wm8994->mclk[id].clk || *freq == wm8994->mclk_rate[id])
2495 ret = clk_set_rate(wm8994->mclk[id].clk, *freq);
2499 *freq = clk_get_rate(wm8994->mclk[id].clk);
2508 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
2523 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK1;
2525 ret = wm8994_set_mclk_rate(wm8994, dai->id - 1, &freq);
2529 wm8994->mclk_rate[0] = freq;
2536 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_MCLK2;
2538 ret = wm8994_set_mclk_rate(wm8994, dai->id - 1, &freq);
2542 wm8994->mclk_rate[1] = freq;
2548 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_FLL1;
2553 wm8994->sysclk[dai->id - 1] = WM8994_SYSCLK_FLL2;
2587 if (max(wm8994->aifclk[0], wm8994->aifclk[1]) < 50000) {
2590 wm8994->aifdiv[0] = snd_soc_component_read(component, WM8994_AIF1_RATE)
2592 wm8994->aifdiv[1] = snd_soc_component_read(component, WM8994_AIF2_RATE)
2599 } else if (wm8994->aifdiv[0]) {
2602 wm8994->aifdiv[0]);
2605 wm8994->aifdiv[1]);
2607 wm8994->aifdiv[0] = 0;
2608 wm8994->aifdiv[1] = 0;
2617 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
2618 struct wm8994 *control = wm8994->wm8994;
2690 wm8994->cur_fw = NULL;
2699 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
2706 if (wm8994->hubs.lineout1_se) {
2712 if (wm8994->hubs.lineout2_se) {
2721 wm8994->vmid_mode = mode;
2729 if (wm8994->hubs.lineout1_se) {
2735 if (wm8994->hubs.lineout2_se) {
2742 wm8994->vmid_mode = mode;
2758 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
2759 struct wm8994 *control = wm8994->wm8994;
2914 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
2915 struct wm8994 *control = wm8994->wm8994;
2938 wm8994->lrclk_shared[0]) {
2951 wm8994->lrclk_shared[1]) {
2983 wm8994->channels[id] = params_channels(params);
2985 wm8994->channels[id] > pdata->max_channels_clocked[id]) {
2987 pdata->max_channels_clocked[id], wm8994->channels[id]);
2988 wm8994->channels[id] = pdata->max_channels_clocked[id];
2991 switch (wm8994->channels[id]) {
3011 dai->id, wm8994->aifclk[id], bclk_rate);
3013 if (wm8994->channels[id] == 1 &&
3017 if (wm8994->aifclk[id] == 0) {
3025 - wm8994->aifclk[id]);
3028 - wm8994->aifclk[id]);
3045 cur_val = (wm8994->aifclk[id] * 10 / bclk_divs[i]) - bclk_rate;
3050 bclk_rate = wm8994->aifclk[id] * 10 / bclk_divs[best];
3075 wm8994->dac_rates[0] = params_rate(params);
3080 wm8994->dac_rates[1] = params_rate(params);
3094 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
3095 struct wm8994 *control = wm8994->wm8994;
3234 .name = "wm8994-aif1",
3255 .name = "wm8994-aif2",
3276 .name = "wm8994-aif3",
3301 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
3304 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) {
3305 memcpy(&wm8994->fll_suspend[i], &wm8994->fll[i],
3320 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
3323 for (i = 0; i < ARRAY_SIZE(wm8994->fll); i++) {
3324 if (!wm8994->fll_suspend[i].out)
3328 wm8994->fll_suspend[i].src,
3329 wm8994->fll_suspend[i].in,
3330 wm8994->fll_suspend[i].out);
3343 static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994)
3345 struct snd_soc_component *component = wm8994->hubs.component;
3346 struct wm8994 *control = wm8994->wm8994;
3350 wm8994->retune_mobile_enum,
3354 wm8994->retune_mobile_enum,
3358 wm8994->retune_mobile_enum,
3369 wm8994->num_retune_mobile_texts = 0;
3370 wm8994->retune_mobile_texts = NULL;
3372 for (j = 0; j < wm8994->num_retune_mobile_texts; j++) {
3374 wm8994->retune_mobile_texts[j]) == 0)
3378 if (j != wm8994->num_retune_mobile_texts)
3382 t = krealloc(wm8994->retune_mobile_texts,
3384 (wm8994->num_retune_mobile_texts + 1),
3390 t[wm8994->num_retune_mobile_texts] =
3394 wm8994->num_retune_mobile_texts++;
3395 wm8994->retune_mobile_texts = t;
3399 wm8994->num_retune_mobile_texts);
3401 wm8994->retune_mobile_enum.items = wm8994->num_retune_mobile_texts;
3402 wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts;
3404 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls,
3407 dev_err(wm8994->hubs.component->dev,
3411 static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
3413 struct snd_soc_component *component = wm8994->hubs.component;
3414 struct wm8994 *control = wm8994->wm8994;
3436 SOC_ENUM_EXT("AIF1DRC1 Mode", wm8994->drc_enum,
3438 SOC_ENUM_EXT("AIF1DRC2 Mode", wm8994->drc_enum,
3440 SOC_ENUM_EXT("AIF2DRC Mode", wm8994->drc_enum,
3445 wm8994->drc_texts = devm_kcalloc(wm8994->hubs.component->dev,
3447 if (!wm8994->drc_texts)
3451 wm8994->drc_texts[i] = pdata->drc_cfgs[i].name;
3453 wm8994->drc_enum.items = pdata->num_drc_cfgs;
3454 wm8994->drc_enum.texts = wm8994->drc_texts;
3456 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls,
3461 ret = snd_soc_add_component_controls(wm8994->hubs.component,
3467 dev_err(wm8994->hubs.component->dev,
3475 wm8994_handle_retune_mobile_pdata(wm8994);
3477 snd_soc_add_component_controls(wm8994->hubs.component, wm8994_eq_controls,
3507 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
3509 struct wm8994 *control = wm8994->wm8994;
3521 micdet = &wm8994->micdet[0];
3528 micdet = &wm8994->micdet[1];
3551 if (wm8994->micdet[0].jack || wm8994->micdet[1].jack)
3577 struct regmap *regmap = priv->wm8994->regmap;
3578 struct device *dev = priv->wm8994->dev;
3657 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
3659 if (!wm8994->jackdet)
3666 if (wm8994->wm8994->pdata.jd_ext_cap)
3672 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
3694 snd_soc_jack_report(wm8994->micdet[0].jack, report,
3695 wm8994->btn_mask);
3700 struct wm8994_priv *wm8994 = container_of(work,
3703 struct device *dev = wm8994->wm8994->dev;
3705 mutex_lock(&wm8994->accdet_lock);
3707 wm1811_micd_stop(wm8994->hubs.component);
3711 wm8994->jack_mic = false;
3712 wm8994->mic_detecting = true;
3714 wm8958_micd_set_rate(wm8994->hubs.component);
3716 snd_soc_jack_report(wm8994->micdet[0].jack, 0,
3717 wm8994->btn_mask |
3720 mutex_unlock(&wm8994->accdet_lock);
3726 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
3734 &wm8994->open_circuit_work,
3745 wm8994->mic_detecting = false;
3746 wm8994->jack_mic = true;
3750 snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_HEADSET,
3757 wm8994->mic_detecting = false;
3764 snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_HEADPHONE,
3772 struct wm8994_priv *wm8994 = container_of(work, struct wm8994_priv,
3774 struct wm8994 *control = wm8994->wm8994;
3775 struct snd_soc_component *component = wm8994->hubs.component;
3786 mutex_lock(&wm8994->accdet_lock);
3791 if (wm8994->micd_cb) {
3792 wm8994->micd_cb(wm8994->micd_cb_data);
3798 wm8994->mic_detecting = true;
3805 mutex_unlock(&wm8994->accdet_lock);
3812 struct wm8994_priv *wm8994 = data;
3813 struct wm8994 *control = wm8994->wm8994;
3814 struct snd_soc_component *component = wm8994->hubs.component;
3821 cancel_delayed_work_sync(&wm8994->mic_complete_work);
3823 mutex_lock(&wm8994->accdet_lock);
3828 mutex_unlock(&wm8994->accdet_lock);
3851 &wm8994->mic_work,
3856 /* Release wm8994->accdet_lock to avoid deadlock:
3857 * cancel_delayed_work_sync() takes wm8994->mic_work internal
3858 * lock and wm1811_mic_work takes wm8994->accdet_lock */
3859 mutex_unlock(&wm8994->accdet_lock);
3860 cancel_delayed_work_sync(&wm8994->mic_work);
3861 mutex_lock(&wm8994->accdet_lock);
3870 wm8994->mic_detecting = false;
3871 wm8994->jack_mic = false;
3877 mutex_unlock(&wm8994->accdet_lock);
3884 snd_soc_jack_report(wm8994->micdet[0].jack,
3887 snd_soc_jack_report(wm8994->micdet[0].jack, 0,
3889 wm8994->btn_mask);
3893 snd_soc_jack_report(wm8994->micdet[0].jack, 0, 0);
3901 struct wm8994_priv *wm8994 = container_of(work,
3904 wm1811_jackdet_irq(0, wm8994);
3932 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
3933 struct wm8994 *control = wm8994->wm8994;
3950 wm8994->micdet[0].jack = jack;
3953 wm8994->micd_cb = det_cb;
3954 wm8994->micd_cb_data = det_cb_data;
3956 wm8994->mic_detecting = true;
3957 wm8994->jack_mic = false;
3961 wm8994->mic_id_cb = id_cb;
3962 wm8994->mic_id_cb_data = id_cb_data;
3964 wm8994->mic_id_cb = wm8958_mic_id;
3965 wm8994->mic_id_cb_data = component;
3976 wm8994->btn_mask = SND_JACK_BTN_0 | SND_JACK_BTN_1 |
3989 if (wm8994->jackdet) {
4022 struct wm8994_priv *wm8994 = container_of(work,
4025 struct snd_soc_component *component = wm8994->hubs.component;
4029 mutex_lock(&wm8994->accdet_lock);
4031 wm8994->mic_id_cb(wm8994->mic_id_cb_data, wm8994->mic_status);
4033 mutex_unlock(&wm8994->accdet_lock);
4040 struct wm8994_priv *wm8994 = data;
4041 struct snd_soc_component *component = wm8994->hubs.component;
4052 cancel_delayed_work_sync(&wm8994->mic_complete_work);
4053 cancel_delayed_work_sync(&wm8994->open_circuit_work);
4090 if (wm8994->jackdet) {
4100 snd_soc_jack_report(wm8994->micdet[0].jack, 0,
4102 wm8994->btn_mask);
4103 wm8994->mic_detecting = true;
4107 wm8994->mic_status = reg;
4108 id_delay = wm8994->wm8994->pdata.mic_id_delay;
4110 if (wm8994->mic_detecting)
4112 &wm8994->mic_complete_work,
4152 struct wm8994 *control = dev_get_drvdata(component->dev->parent);
4153 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
4159 wm8994->hubs.component = component;
4161 mutex_init(&wm8994->accdet_lock);
4162 INIT_DELAYED_WORK(&wm8994->jackdet_bootstrap,
4164 INIT_DELAYED_WORK(&wm8994->open_circuit_work,
4169 INIT_DELAYED_WORK(&wm8994->mic_work, wm8994_mic_work);
4172 INIT_DELAYED_WORK(&wm8994->mic_work, wm1811_mic_work);
4178 INIT_DELAYED_WORK(&wm8994->mic_complete_work, wm8958_mic_work);
4180 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++)
4181 init_completion(&wm8994->fll_locked[i]);
4183 wm8994->micdet_irq = control->pdata.micdet_irq;
4199 wm8994->hubs.dcs_codes_l = -5;
4200 wm8994->hubs.dcs_codes_r = -5;
4201 wm8994->hubs.hp_startup_mode = 1;
4202 wm8994->hubs.dcs_readback_mode = 1;
4203 wm8994->hubs.series_startup = 1;
4206 wm8994->hubs.dcs_readback_mode = 2;
4209 wm8994->hubs.micd_scthr = true;
4213 wm8994->hubs.dcs_readback_mode = 1;
4214 wm8994->hubs.hp_startup_mode = 1;
4215 wm8994->hubs.micd_scthr = true;
4221 wm8994->fll_byp = true;
4227 wm8994->hubs.dcs_readback_mode = 2;
4228 wm8994->hubs.no_series_update = 1;
4229 wm8994->hubs.hp_startup_mode = 1;
4230 wm8994->hubs.no_cache_dac_hp_direct = true;
4231 wm8994->fll_byp = true;
4233 wm8994->hubs.dcs_codes_l = -9;
4234 wm8994->hubs.dcs_codes_r = -7;
4244 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR,
4246 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN,
4248 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT,
4253 if (wm8994->micdet_irq)
4254 ret = request_threaded_irq(wm8994->micdet_irq, NULL,
4259 wm8994);
4261 ret = wm8994_request_irq(wm8994->wm8994,
4264 wm8994);
4272 ret = wm8994_request_irq(wm8994->wm8994,
4275 wm8994);
4281 ret = wm8994_request_irq(wm8994->wm8994,
4284 wm8994);
4290 ret = wm8994_request_irq(wm8994->wm8994,
4293 wm8994);
4302 if (wm8994->micdet_irq) {
4303 ret = request_threaded_irq(wm8994->micdet_irq, NULL,
4308 wm8994);
4314 wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_MIC1_DET,
4316 wm8994);
4323 ret = wm8994_request_irq(wm8994->wm8994,
4326 wm8994);
4328 wm8994->jackdet = true;
4335 wm8994->fll_locked_irq = true;
4336 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++) {
4337 ret = wm8994_request_irq(wm8994->wm8994,
4340 &wm8994->fll_locked[i]);
4342 wm8994->fll_locked_irq = false;
4358 wm8994->lrclk_shared[0] = 1;
4361 wm8994->lrclk_shared[0] = 0;
4370 wm8994->lrclk_shared[1] = 1;
4373 wm8994->lrclk_shared[1] = 0;
4429 wm8994->hubs.check_class_w_digital = wm8994_check_class_w_digital;
4432 wm8994_handle_pdata(wm8994);
4501 ret = wm8994_request_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE,
4503 &wm8994->hubs);
4505 wm8994->hubs.dcs_done_irq = true;
4551 if (wm8994->jackdet)
4552 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_GPIO(6), wm8994);
4553 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_SHRT, wm8994);
4554 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_DET, wm8994);
4555 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_SHRT, wm8994);
4556 if (wm8994->micdet_irq)
4557 free_irq(wm8994->micdet_irq, wm8994);
4558 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++)
4559 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i,
4560 &wm8994->fll_locked[i]);
4561 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE,
4562 &wm8994->hubs);
4563 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component);
4564 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component);
4565 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component);
4572 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component);
4573 struct wm8994 *control = wm8994->wm8994;
4576 for (i = 0; i < ARRAY_SIZE(wm8994->fll_locked); i++)
4577 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FLL1_LOCK + i,
4578 &wm8994->fll_locked[i]);
4580 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_DCS_DONE,
4581 &wm8994->hubs);
4582 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component);
4583 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component);
4584 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component);
4586 if (wm8994->jackdet)
4587 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_GPIO(6), wm8994);
4591 if (wm8994->micdet_irq)
4592 free_irq(wm8994->micdet_irq, wm8994);
4593 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC2_DET,
4594 wm8994);
4595 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_SHRT,
4596 wm8994);
4597 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_MIC1_DET,
4598 wm8994);
4603 if (wm8994->micdet_irq)
4604 free_irq(wm8994->micdet_irq, wm8994);
4607 release_firmware(wm8994->mbc);
4608 release_firmware(wm8994->mbc_vss);
4609 release_firmware(wm8994->enh_eq);
4610 kfree(wm8994->retune_mobile_texts);
4626 struct wm8994_priv *wm8994;
4629 wm8994 = devm_kzalloc(&pdev->dev, sizeof(struct wm8994_priv),
4631 if (wm8994 == NULL)
4633 platform_set_drvdata(pdev, wm8994);
4635 mutex_init(&wm8994->fw_lock);
4637 wm8994->wm8994 = dev_get_drvdata(pdev->dev.parent);
4639 wm8994->mclk[WM8994_MCLK1].id = "MCLK1";
4640 wm8994->mclk[WM8994_MCLK2].id = "MCLK2";
4642 ret = devm_clk_bulk_get_optional(pdev->dev.parent, ARRAY_SIZE(wm8994->mclk),
4643 wm8994->mclk);
4668 struct wm8994_priv *wm8994 = dev_get_drvdata(dev);
4671 if (wm8994->jackdet && !wm8994->active_refcount)
4672 regmap_update_bits(wm8994->wm8994->regmap, WM8994_ANTIPOP_2,
4674 wm8994->jackdet_mode);
4681 struct wm8994_priv *wm8994 = dev_get_drvdata(dev);
4683 if (wm8994->jackdet && wm8994->jackdet_mode)
4684 regmap_update_bits(wm8994->wm8994->regmap, WM8994_ANTIPOP_2,
4698 .name = "wm8994-codec",
4710 MODULE_ALIAS("platform:wm8994-codec");