Lines Matching refs:component
109 static void wm8958_micd_set_rate(struct snd_soc_component *component) in wm8958_micd_set_rate() argument
111 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_micd_set_rate()
120 sysclk = snd_soc_component_read32(component, WM8994_CLOCKING_1); in wm8958_micd_set_rate()
151 dev_dbg(component->dev, "MICD rate %d,%d for %dHz %s\n", in wm8958_micd_set_rate()
155 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_micd_set_rate()
160 static int configure_aif_clock(struct snd_soc_component *component, int aif) in configure_aif_clock() argument
162 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_aif_clock()
200 dev_dbg(component->dev, "Dividing AIF%d clock to %dHz\n", in configure_aif_clock()
206 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1 + offset, in configure_aif_clock()
213 static int configure_clock(struct snd_soc_component *component) in configure_clock() argument
215 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in configure_clock()
216 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_clock()
220 configure_aif_clock(component, 0); in configure_clock()
221 configure_aif_clock(component, 1); in configure_clock()
231 wm8958_micd_set_rate(component); in configure_clock()
240 change = snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in configure_clock()
245 wm8958_micd_set_rate(component); in configure_clock()
253 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_clk_sys() local
254 int reg = snd_soc_component_read32(component, WM8994_CLOCKING_1); in check_clk_sys()
303 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_drc_sw() local
313 ret = snd_soc_component_read32(component, mc->reg); in wm8994_put_drc_sw()
322 static void wm8994_set_drc(struct snd_soc_component *component, int drc) in wm8994_set_drc() argument
324 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_drc()
332 save = snd_soc_component_read32(component, base); in wm8994_set_drc()
337 snd_soc_component_update_bits(component, base + i, 0xffff, in wm8994_set_drc()
340 snd_soc_component_update_bits(component, base, WM8994_AIF1DAC1_DRC_ENA | in wm8994_set_drc()
360 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_drc_enum() local
361 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_drc_enum()
375 wm8994_set_drc(component, drc); in wm8994_put_drc_enum()
383 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_get_drc_enum() local
384 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_drc_enum()
394 static void wm8994_set_retune_mobile(struct snd_soc_component *component, int block) in wm8994_set_retune_mobile() argument
396 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_retune_mobile()
433 dev_dbg(component->dev, "ReTune Mobile %d %s/%dHz for %dHz sample rate\n", in wm8994_set_retune_mobile()
442 save = snd_soc_component_read32(component, base); in wm8994_set_retune_mobile()
446 snd_soc_component_update_bits(component, base + i, 0xffff, in wm8994_set_retune_mobile()
449 snd_soc_component_update_bits(component, base, WM8994_AIF1DAC1_EQ_ENA, save); in wm8994_set_retune_mobile()
467 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_retune_mobile_enum() local
468 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_retune_mobile_enum()
482 wm8994_set_retune_mobile(component, block); in wm8994_put_retune_mobile_enum()
490 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_get_retune_mobile_enum() local
491 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_retune_mobile_enum()
743 static void wm1811_jackdet_set_mode(struct snd_soc_component *component, u16 mode) in wm1811_jackdet_set_mode() argument
745 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_jackdet_set_mode()
762 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in wm1811_jackdet_set_mode()
766 static void active_reference(struct snd_soc_component *component) in active_reference() argument
768 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_reference()
774 dev_dbg(component->dev, "Active refcount incremented, now %d\n", in active_reference()
778 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_AUDIO); in active_reference()
783 static void active_dereference(struct snd_soc_component *component) in active_dereference() argument
785 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_dereference()
792 dev_dbg(component->dev, "Active refcount decremented, now %d\n", in active_dereference()
802 wm1811_jackdet_set_mode(component, mode); in active_dereference()
811 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in clk_sys_event() local
812 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in clk_sys_event()
816 return configure_clock(component); in clk_sys_event()
835 configure_clock(component); in clk_sys_event()
842 static void vmid_reference(struct snd_soc_component *component) in vmid_reference() argument
844 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_reference()
846 pm_runtime_get_sync(component->dev); in vmid_reference()
850 dev_dbg(component->dev, "Referencing VMID, refcount is now %d\n", in vmid_reference()
854 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in vmid_reference()
858 wm_hubs_vmid_ena(component); in vmid_reference()
866 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
878 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_reference()
885 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
893 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
905 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_reference()
912 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
921 static void vmid_dereference(struct snd_soc_component *component) in vmid_dereference() argument
923 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_dereference()
927 dev_dbg(component->dev, "Dereferencing VMID, refcount is now %d\n", in vmid_dereference()
932 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
939 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
946 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_dereference()
952 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_dereference()
958 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in vmid_dereference()
964 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
971 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_dereference()
977 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_dereference()
981 pm_runtime_put(component->dev); in vmid_dereference()
987 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vmid_event() local
991 vmid_reference(component); in vmid_event()
995 vmid_dereference(component); in vmid_event()
1002 static bool wm8994_check_class_w_digital(struct snd_soc_component *component) in wm8994_check_class_w_digital() argument
1008 reg = snd_soc_component_read32(component, WM8994_DAC1_LEFT_MIXER_ROUTING); in wm8994_check_class_w_digital()
1011 dev_vdbg(component->dev, "Class W source AIF2DAC\n"); in wm8994_check_class_w_digital()
1015 dev_vdbg(component->dev, "Class W source AIF1DAC2\n"); in wm8994_check_class_w_digital()
1019 dev_vdbg(component->dev, "Class W source AIF1DAC1\n"); in wm8994_check_class_w_digital()
1023 dev_vdbg(component->dev, "DAC mixer setting: %x\n", reg); in wm8994_check_class_w_digital()
1027 reg_r = snd_soc_component_read32(component, WM8994_DAC1_RIGHT_MIXER_ROUTING); in wm8994_check_class_w_digital()
1029 dev_vdbg(component->dev, "Left and right DAC mixers different\n"); in wm8994_check_class_w_digital()
1034 snd_soc_component_update_bits(component, WM8994_CLASS_W_1, in wm8994_check_class_w_digital()
1043 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif1clk_ev() local
1044 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_ev()
1067 val = snd_soc_component_read32(component, WM8994_AIF1_CONTROL_1); in aif1clk_ev()
1078 val = snd_soc_component_read32(component, WM8994_AIF1_CONTROL_2); in aif1clk_ev()
1089 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif1clk_ev()
1091 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif1clk_ev()
1093 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif1clk_ev()
1098 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, mask, in aif1clk_ev()
1103 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, mask, in aif1clk_ev()
1112 snd_soc_component_write(component, wm8994_vu_bits[i].reg, in aif1clk_ev()
1113 snd_soc_component_read32(component, in aif1clk_ev()
1119 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif1clk_ev()
1121 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif1clk_ev()
1124 val = snd_soc_component_read32(component, WM8994_CLOCKING_1); in aif1clk_ev()
1129 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif1clk_ev()
1141 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif2clk_ev() local
1149 val = snd_soc_component_read32(component, WM8994_AIF2_CONTROL_1); in aif2clk_ev()
1160 val = snd_soc_component_read32(component, WM8994_AIF2_CONTROL_2); in aif2clk_ev()
1170 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1173 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1176 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif2clk_ev()
1181 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1186 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1195 snd_soc_component_write(component, wm8994_vu_bits[i].reg, in aif2clk_ev()
1196 snd_soc_component_read32(component, in aif2clk_ev()
1202 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1205 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1209 val = snd_soc_component_read32(component, WM8994_CLOCKING_1); in aif2clk_ev()
1214 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif2clk_ev()
1226 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif1clk_late_ev() local
1227 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_late_ev()
1244 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif2clk_late_ev() local
1245 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif2clk_late_ev()
1262 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in late_enable_ev() local
1263 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_enable_ev()
1269 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1, in late_enable_ev()
1277 snd_soc_component_update_bits(component, WM8994_AIF2_CLOCKING_1, in late_enable_ev()
1295 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in late_disable_ev() local
1296 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_disable_ev()
1302 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1, in late_disable_ev()
1309 snd_soc_component_update_bits(component, WM8994_AIF2_CLOCKING_1, in late_disable_ev()
1337 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in dac_ev() local
1340 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in dac_ev()
1378 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in post_ev() local
1379 dev_dbg(component->dev, "SRC status: %x\n", in post_ev()
1380 snd_soc_component_read32(component, in post_ev()
1446 struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); in wm8994_put_class_w() local
1451 wm_hubs_update_class_w(component); in wm8994_put_class_w()
2133 static int _wm8994_set_fll(struct snd_soc_component *component, int id, int src, in _wm8994_set_fll() argument
2136 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in _wm8994_set_fll()
2159 reg = snd_soc_component_read32(component, WM8994_FLL1_CONTROL_1 + reg_offset); in _wm8994_set_fll()
2200 clk1 = snd_soc_component_read32(component, WM8994_CLOCKING_1); in _wm8994_set_fll()
2205 reg = snd_soc_component_read32(component, aif_reg); in _wm8994_set_fll()
2209 dev_err(component->dev, "FLL%d is currently providing SYSCLK\n", in _wm8994_set_fll()
2215 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_1 + reg_offset, in _wm8994_set_fll()
2220 dev_dbg(component->dev, "Bypassing FLL%d\n", id + 1); in _wm8994_set_fll()
2221 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_5 + reg_offset, in _wm8994_set_fll()
2228 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_2 + reg_offset, in _wm8994_set_fll()
2232 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_3 + reg_offset, in _wm8994_set_fll()
2235 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_4 + reg_offset, in _wm8994_set_fll()
2240 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_1 + reg_offset, in _wm8994_set_fll()
2243 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_2 + reg_offset, in _wm8994_set_fll()
2246 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_2 + reg_offset, in _wm8994_set_fll()
2250 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_5 + reg_offset, in _wm8994_set_fll()
2266 active_reference(component); in _wm8994_set_fll()
2270 vmid_reference(component); in _wm8994_set_fll()
2274 vmid_reference(component); in _wm8994_set_fll()
2288 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_1 + reg_offset, in _wm8994_set_fll()
2296 dev_warn(component->dev, in _wm8994_set_fll()
2305 vmid_dereference(component); in _wm8994_set_fll()
2309 vmid_dereference(component); in _wm8994_set_fll()
2315 active_dereference(component); in _wm8994_set_fll()
2324 configure_clock(component); in _wm8994_set_fll()
2331 dev_dbg(component->dev, "Configuring AIFs for 128fs\n"); in _wm8994_set_fll()
2333 wm8994->aifdiv[0] = snd_soc_component_read32(component, WM8994_AIF1_RATE) in _wm8994_set_fll()
2335 wm8994->aifdiv[1] = snd_soc_component_read32(component, WM8994_AIF2_RATE) in _wm8994_set_fll()
2338 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in _wm8994_set_fll()
2340 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in _wm8994_set_fll()
2343 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in _wm8994_set_fll()
2346 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in _wm8994_set_fll()
2371 return _wm8994_set_fll(dai->component, id, src, freq_in, freq_out); in wm8994_set_fll()
2377 struct snd_soc_component *component = dai->component; in wm8994_set_dai_sysclk() local
2378 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_sysclk()
2427 snd_soc_component_update_bits(component, WM8994_CLOCKING_2, in wm8994_set_dai_sysclk()
2429 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2, in wm8994_set_dai_sysclk()
2432 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2, in wm8994_set_dai_sysclk()
2441 configure_clock(component); in wm8994_set_dai_sysclk()
2448 dev_dbg(component->dev, "Configuring AIFs for 128fs\n"); in wm8994_set_dai_sysclk()
2450 wm8994->aifdiv[0] = snd_soc_component_read32(component, WM8994_AIF1_RATE) in wm8994_set_dai_sysclk()
2452 wm8994->aifdiv[1] = snd_soc_component_read32(component, WM8994_AIF2_RATE) in wm8994_set_dai_sysclk()
2455 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in wm8994_set_dai_sysclk()
2457 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in wm8994_set_dai_sysclk()
2460 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in wm8994_set_dai_sysclk()
2463 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in wm8994_set_dai_sysclk()
2474 static int wm8994_set_bias_level(struct snd_soc_component *component, in wm8994_set_bias_level() argument
2477 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_bias_level()
2480 wm_hubs_set_bias_level(component, level); in wm8994_set_bias_level()
2491 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_set_bias_level()
2493 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_set_bias_level()
2500 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) in wm8994_set_bias_level()
2501 active_reference(component); in wm8994_set_bias_level()
2505 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8994_set_bias_level()
2510 snd_soc_component_update_bits(component, in wm8994_set_bias_level()
2522 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in wm8994_set_bias_level()
2529 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) in wm8994_set_bias_level()
2530 active_dereference(component); in wm8994_set_bias_level()
2536 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_set_bias_level()
2539 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_set_bias_level()
2549 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) in wm8994_set_bias_level()
2557 int wm8994_vmid_mode(struct snd_soc_component *component, enum wm8994_vmid_mode mode) in wm8994_vmid_mode() argument
2559 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_vmid_mode()
2560 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_vmid_mode()
2617 struct snd_soc_component *component = dai->component; in wm8994_set_dai_fmt() local
2618 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_fmt()
2721 snd_soc_component_update_bits(component, WM8958_AIF3_CONTROL_1, in wm8994_set_dai_fmt()
2730 snd_soc_component_update_bits(component, aif1_reg, in wm8994_set_dai_fmt()
2734 snd_soc_component_update_bits(component, ms_reg, WM8994_AIF1_MSTR, in wm8994_set_dai_fmt()
2736 snd_soc_component_update_bits(component, dac_reg, in wm8994_set_dai_fmt()
2738 snd_soc_component_update_bits(component, adc_reg, in wm8994_set_dai_fmt()
2773 struct snd_soc_component *component = dai->component; in wm8994_hw_params() local
2774 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_hw_params()
2802 dev_dbg(component->dev, "AIF1 using split LRCLK\n"); in wm8994_hw_params()
2815 dev_dbg(component->dev, "AIF2 using split LRCLK\n"); in wm8994_hw_params()
2874 (snd_soc_component_read32(component, aif1_reg) & 0x18) == 0x18) in wm8994_hw_params()
2924 snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1); in wm8994_hw_params()
2925 snd_soc_component_update_bits(component, aif2_reg, WM8994_AIF1_MONO, aif2); in wm8994_hw_params()
2926 snd_soc_component_update_bits(component, bclk_reg, WM8994_AIF1_BCLK_DIV_MASK, bclk); in wm8994_hw_params()
2927 snd_soc_component_update_bits(component, lrclk_reg, WM8994_AIF1DAC_RATE_MASK, in wm8994_hw_params()
2929 snd_soc_component_update_bits(component, rate_reg, WM8994_AIF1_SR_MASK | in wm8994_hw_params()
2936 wm8994_set_retune_mobile(component, 0); in wm8994_hw_params()
2937 wm8994_set_retune_mobile(component, 1); in wm8994_hw_params()
2941 wm8994_set_retune_mobile(component, 2); in wm8994_hw_params()
2953 struct snd_soc_component *component = dai->component; in wm8994_aif3_hw_params() local
2954 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_aif3_hw_params()
2990 return snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1); in wm8994_aif3_hw_params()
2995 struct snd_soc_component *component = codec_dai->component; in wm8994_aif_mute() local
3015 snd_soc_component_update_bits(component, mute_reg, WM8994_AIF1DAC1_MUTE, reg); in wm8994_aif_mute()
3022 struct snd_soc_component *component = codec_dai->component; in wm8994_set_tristate() local
3043 return snd_soc_component_update_bits(component, reg, mask, val); in wm8994_set_tristate()
3048 struct snd_soc_component *component = dai->component; in wm8994_aif2_probe() local
3051 snd_soc_component_update_bits(component, WM8994_GPIO_3, in wm8994_aif2_probe()
3053 snd_soc_component_update_bits(component, WM8994_GPIO_4, in wm8994_aif2_probe()
3055 snd_soc_component_update_bits(component, WM8994_GPIO_5, in wm8994_aif2_probe()
3156 static int wm8994_component_suspend(struct snd_soc_component *component) in wm8994_component_suspend() argument
3158 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_suspend()
3164 ret = _wm8994_set_fll(component, i + 1, 0, 0, 0); in wm8994_component_suspend()
3166 dev_warn(component->dev, "Failed to stop FLL%d: %d\n", in wm8994_component_suspend()
3170 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); in wm8994_component_suspend()
3175 static int wm8994_component_resume(struct snd_soc_component *component) in wm8994_component_resume() argument
3177 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_resume()
3184 ret = _wm8994_set_fll(component, i + 1, in wm8994_component_resume()
3189 dev_warn(component->dev, "Failed to restore FLL%d: %d\n", in wm8994_component_resume()
3202 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_retune_mobile_pdata() local
3255 dev_dbg(component->dev, "Allocated %d unique ReTune Mobile names\n", in wm8994_handle_retune_mobile_pdata()
3261 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_retune_mobile_pdata()
3264 dev_err(wm8994->hubs.component->dev, in wm8994_handle_retune_mobile_pdata()
3270 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_pdata() local
3278 wm_hubs_handle_analogue_pdata(component, pdata->lineout1_diff, in wm8994_handle_pdata()
3289 dev_dbg(component->dev, "%d DRC configurations\n", pdata->num_drc_cfgs); in wm8994_handle_pdata()
3302 wm8994->drc_texts = devm_kcalloc(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3313 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_pdata()
3316 wm8994_set_drc(component, i); in wm8994_handle_pdata()
3318 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8994_handle_pdata()
3324 dev_err(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3328 dev_dbg(component->dev, "%d ReTune Mobile configurations\n", in wm8994_handle_pdata()
3334 snd_soc_add_component_controls(wm8994->hubs.component, wm8994_eq_controls, in wm8994_handle_pdata()
3339 snd_soc_component_write(component, WM8958_MICBIAS1 + i, in wm8994_handle_pdata()
3360 int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8994_mic_detect() argument
3363 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_mic_detect()
3364 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_mic_detect()
3370 dev_warn(component->dev, "Not a WM8994\n"); in wm8994_mic_detect()
3390 dev_warn(component->dev, "Invalid MICBIAS %d\n", micbias); in wm8994_mic_detect()
3395 dev_warn(component->dev, "Failed to configure MICBIAS%d: %d\n", in wm8994_mic_detect()
3398 dev_dbg(component->dev, "Configuring microphone detection on %d %p\n", in wm8994_mic_detect()
3411 snd_soc_component_update_bits(component, WM8994_MICBIAS, WM8994_MICD_ENA, reg); in wm8994_mic_detect()
3414 snd_soc_component_update_bits(component, WM8994_IRQ_DEBOUNCE, in wm8994_mic_detect()
3492 struct snd_soc_component *component = priv->hubs.component; in wm8994_mic_irq() local
3495 trace_snd_soc_jack_irq(dev_name(component->dev)); in wm8994_mic_irq()
3498 pm_wakeup_event(component->dev, 300); in wm8994_mic_irq()
3507 static void wm1811_micd_stop(struct snd_soc_component *component) in wm1811_micd_stop() argument
3509 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_micd_stop()
3510 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_micd_stop()
3515 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, WM8958_MICD_ENA, 0); in wm1811_micd_stop()
3517 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_JACK); in wm1811_micd_stop()
3523 static void wm8958_button_det(struct snd_soc_component *component, u16 status) in wm8958_button_det() argument
3525 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_button_det()
3560 wm1811_micd_stop(wm8994->hubs.component); in wm8958_open_circuit_work()
3567 wm8958_micd_set_rate(wm8994->hubs.component); in wm8958_open_circuit_work()
3578 struct snd_soc_component *component = data; in wm8958_mic_id() local
3579 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_id()
3584 dev_dbg(component->dev, "Detected open circuit\n"); in wm8958_mic_id()
3596 dev_dbg(component->dev, "Detected microphone\n"); in wm8958_mic_id()
3601 wm8958_micd_set_rate(component); in wm8958_mic_id()
3609 dev_dbg(component->dev, "Detected headphone\n"); in wm8958_mic_id()
3612 wm8958_micd_set_rate(component); in wm8958_mic_id()
3615 wm1811_micd_stop(component); in wm8958_mic_id()
3628 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_mic_work() local
3629 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_mic_work()
3631 pm_runtime_get_sync(component->dev); in wm1811_mic_work()
3641 dev_dbg(component->dev, "Starting mic detection\n"); in wm1811_mic_work()
3652 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_MIC); in wm1811_mic_work()
3654 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm1811_mic_work()
3660 pm_runtime_put(component->dev); in wm1811_mic_work()
3667 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_jackdet_irq() local
3668 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_jackdet_irq()
3672 pm_runtime_get_sync(component->dev); in wm1811_jackdet_irq()
3678 reg = snd_soc_component_read32(component, WM1811_JACKDET_CTRL); in wm1811_jackdet_irq()
3680 dev_err(component->dev, "Failed to read jack status: %d\n", reg); in wm1811_jackdet_irq()
3682 pm_runtime_put(component->dev); in wm1811_jackdet_irq()
3686 dev_dbg(component->dev, "JACKDET %x\n", reg); in wm1811_jackdet_irq()
3691 dev_dbg(component->dev, "Jack detected\n"); in wm1811_jackdet_irq()
3693 wm8958_micd_set_rate(component); in wm1811_jackdet_irq()
3695 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm1811_jackdet_irq()
3699 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm1811_jackdet_irq()
3707 dev_dbg(component->dev, "Jack not detected\n"); in wm1811_jackdet_irq()
3711 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm1811_jackdet_irq()
3715 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm1811_jackdet_irq()
3720 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm1811_jackdet_irq()
3722 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_JACK); in wm1811_jackdet_irq()
3743 pm_runtime_put(component->dev); in wm1811_jackdet_irq()
3771 int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8958_mic_detect() argument
3775 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8958_mic_detect()
3776 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_detect()
3807 wm8994->mic_id_cb_data = component; in wm8958_mic_detect()
3810 wm8958_micd_set_rate(component); in wm8958_mic_detect()
3822 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_2, in wm8958_mic_detect()
3825 WARN_ON(snd_soc_component_get_bias_level(component) > SND_SOC_BIAS_STANDBY); in wm8958_mic_detect()
3833 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm8958_mic_detect()
3836 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8958_mic_detect()
3839 snd_soc_component_update_bits(component, WM8994_LDO_1, in wm8958_mic_detect()
3841 wm1811_jackdet_set_mode(component, in wm8958_mic_detect()
3844 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_mic_detect()
3849 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_mic_detect()
3851 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_NONE); in wm8958_mic_detect()
3865 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_work() local
3867 pm_runtime_get_sync(component->dev); in wm8958_mic_work()
3875 pm_runtime_put(component->dev); in wm8958_mic_work()
3881 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_irq() local
3889 if (!(snd_soc_component_read32(component, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA)) in wm8958_mic_irq()
3895 pm_runtime_get_sync(component->dev); in wm8958_mic_irq()
3902 reg = snd_soc_component_read32(component, WM8958_MIC_DETECT_3); in wm8958_mic_irq()
3904 dev_err(component->dev, in wm8958_mic_irq()
3907 pm_runtime_put(component->dev); in wm8958_mic_irq()
3912 dev_dbg(component->dev, "Mic detect data not valid\n"); in wm8958_mic_irq()
3923 dev_warn(component->dev, "No impedance range reported for jack\n"); in wm8958_mic_irq()
3926 trace_snd_soc_jack_irq(dev_name(component->dev)); in wm8958_mic_irq()
3931 ret = snd_soc_component_read32(component, WM1811_JACKDET_CTRL); in wm8958_mic_irq()
3933 dev_err(component->dev, "Failed to read jack status: %d\n", in wm8958_mic_irq()
3936 dev_dbg(component->dev, "Ignoring removed jack\n"); in wm8958_mic_irq()
3955 wm8958_button_det(component, reg); in wm8958_mic_irq()
3958 pm_runtime_put(component->dev); in wm8958_mic_irq()
3964 struct snd_soc_component *component = data; in wm8994_fifo_error() local
3966 dev_err(component->dev, "FIFO error\n"); in wm8994_fifo_error()
3973 struct snd_soc_component *component = data; in wm8994_temp_warn() local
3975 dev_err(component->dev, "Thermal warning\n"); in wm8994_temp_warn()
3982 struct snd_soc_component *component = data; in wm8994_temp_shut() local
3984 dev_crit(component->dev, "Thermal shutdown\n"); in wm8994_temp_shut()
3989 static int wm8994_component_probe(struct snd_soc_component *component) in wm8994_component_probe() argument
3991 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_component_probe()
3992 struct wm8994 *control = dev_get_drvdata(component->dev->parent); in wm8994_component_probe()
3993 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_probe()
3997 snd_soc_component_init_regmap(component, control->regmap); in wm8994_component_probe()
3999 wm8994->hubs.component = component; in wm8994_component_probe()
4074 snd_soc_component_update_bits(component, WM8994_ANALOGUE_HP_1, in wm8994_component_probe()
4083 wm8994_fifo_error, "FIFO error", component); in wm8994_component_probe()
4085 wm8994_temp_warn, "Thermal warning", component); in wm8994_component_probe()
4087 wm8994_temp_shut, "Thermal shutdown", component); in wm8994_component_probe()
4105 dev_warn(component->dev, in wm8994_component_probe()
4115 dev_warn(component->dev, in wm8994_component_probe()
4124 dev_warn(component->dev, in wm8994_component_probe()
4133 dev_warn(component->dev, in wm8994_component_probe()
4148 dev_warn(component->dev, in wm8994_component_probe()
4184 pm_runtime_get_sync(component->dev); in wm8994_component_probe()
4192 dev_err(component->dev, "Failed to read GPIO1 state: %d\n", ret); in wm8994_component_probe()
4204 dev_err(component->dev, "Failed to read GPIO6 state: %d\n", ret); in wm8994_component_probe()
4214 pm_runtime_put(component->dev); in wm8994_component_probe()
4218 snd_soc_component_update_bits(component, wm8994_vu_bits[i].reg, in wm8994_component_probe()
4223 snd_soc_component_update_bits(component, WM8994_AIF1_DAC1_FILTERS_2, in wm8994_component_probe()
4226 snd_soc_component_update_bits(component, WM8994_AIF1_DAC2_FILTERS_2, in wm8994_component_probe()
4229 snd_soc_component_update_bits(component, WM8994_AIF2_DAC_FILTERS_2, in wm8994_component_probe()
4239 snd_soc_component_update_bits(component, WM8994_AIF1_CONTROL_1, in wm8994_component_probe()
4250 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_component_probe()
4252 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_component_probe()
4260 wm_hubs_update_class_w(component); in wm8994_component_probe()
4264 wm_hubs_add_analogue_controls(component); in wm8994_component_probe()
4265 snd_soc_add_component_controls(component, wm8994_snd_controls, in wm8994_component_probe()
4291 snd_soc_add_component_controls(component, wm8958_snd_controls, in wm8994_component_probe()
4313 snd_soc_add_component_controls(component, wm8958_snd_controls, in wm8994_component_probe()
4326 wm_hubs_add_analogue_routes(component, 0, 0); in wm8994_component_probe()
4364 wm8958_dsp2_init(component); in wm8994_component_probe()
4389 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_probe()
4390 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_probe()
4391 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_probe()
4396 static void wm8994_component_remove(struct snd_soc_component *component) in wm8994_component_remove() argument
4398 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_remove()
4408 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_remove()
4409 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_remove()
4410 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_remove()