• Home
  • Raw
  • Download

Lines Matching full: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()
748 static void wm1811_jackdet_set_mode(struct snd_soc_component *component, u16 mode) in wm1811_jackdet_set_mode() argument
750 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_jackdet_set_mode()
767 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in wm1811_jackdet_set_mode()
771 static void active_reference(struct snd_soc_component *component) in active_reference() argument
773 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_reference()
779 dev_dbg(component->dev, "Active refcount incremented, now %d\n", in active_reference()
783 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_AUDIO); in active_reference()
788 static void active_dereference(struct snd_soc_component *component) in active_dereference() argument
790 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_dereference()
797 dev_dbg(component->dev, "Active refcount decremented, now %d\n", in active_dereference()
807 wm1811_jackdet_set_mode(component, mode); in active_dereference()
816 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in clk_sys_event() local
817 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in clk_sys_event()
821 return configure_clock(component); in clk_sys_event()
840 configure_clock(component); in clk_sys_event()
847 static void vmid_reference(struct snd_soc_component *component) in vmid_reference() argument
849 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_reference()
851 pm_runtime_get_sync(component->dev); in vmid_reference()
855 dev_dbg(component->dev, "Referencing VMID, refcount is now %d\n", in vmid_reference()
859 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in vmid_reference()
863 wm_hubs_vmid_ena(component); in vmid_reference()
871 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
883 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_reference()
890 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
898 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
910 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_reference()
917 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
926 static void vmid_dereference(struct snd_soc_component *component) in vmid_dereference() argument
928 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_dereference()
932 dev_dbg(component->dev, "Dereferencing VMID, refcount is now %d\n", in vmid_dereference()
937 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
944 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
951 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_dereference()
957 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_dereference()
963 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in vmid_dereference()
969 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
976 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_dereference()
982 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_dereference()
986 pm_runtime_put(component->dev); in vmid_dereference()
992 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vmid_event() local
996 vmid_reference(component); in vmid_event()
1000 vmid_dereference(component); in vmid_event()
1007 static bool wm8994_check_class_w_digital(struct snd_soc_component *component) in wm8994_check_class_w_digital() argument
1013 reg = snd_soc_component_read32(component, WM8994_DAC1_LEFT_MIXER_ROUTING); in wm8994_check_class_w_digital()
1016 dev_vdbg(component->dev, "Class W source AIF2DAC\n"); in wm8994_check_class_w_digital()
1020 dev_vdbg(component->dev, "Class W source AIF1DAC2\n"); in wm8994_check_class_w_digital()
1024 dev_vdbg(component->dev, "Class W source AIF1DAC1\n"); in wm8994_check_class_w_digital()
1028 dev_vdbg(component->dev, "DAC mixer setting: %x\n", reg); in wm8994_check_class_w_digital()
1032 reg_r = snd_soc_component_read32(component, WM8994_DAC1_RIGHT_MIXER_ROUTING); in wm8994_check_class_w_digital()
1034 dev_vdbg(component->dev, "Left and right DAC mixers different\n"); in wm8994_check_class_w_digital()
1039 snd_soc_component_update_bits(component, WM8994_CLASS_W_1, in wm8994_check_class_w_digital()
1048 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif1clk_ev() local
1049 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_ev()
1072 val = snd_soc_component_read32(component, WM8994_AIF1_CONTROL_1); in aif1clk_ev()
1083 val = snd_soc_component_read32(component, WM8994_AIF1_CONTROL_2); in aif1clk_ev()
1094 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif1clk_ev()
1096 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif1clk_ev()
1098 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif1clk_ev()
1103 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, mask, in aif1clk_ev()
1108 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, mask, in aif1clk_ev()
1117 snd_soc_component_write(component, wm8994_vu_bits[i].reg, in aif1clk_ev()
1118 snd_soc_component_read32(component, in aif1clk_ev()
1124 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif1clk_ev()
1126 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif1clk_ev()
1129 val = snd_soc_component_read32(component, WM8994_CLOCKING_1); in aif1clk_ev()
1134 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif1clk_ev()
1146 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif2clk_ev() local
1154 val = snd_soc_component_read32(component, WM8994_AIF2_CONTROL_1); in aif2clk_ev()
1165 val = snd_soc_component_read32(component, WM8994_AIF2_CONTROL_2); in aif2clk_ev()
1175 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1178 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1181 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif2clk_ev()
1186 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1191 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1200 snd_soc_component_write(component, wm8994_vu_bits[i].reg, in aif2clk_ev()
1201 snd_soc_component_read32(component, in aif2clk_ev()
1207 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1210 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1214 val = snd_soc_component_read32(component, WM8994_CLOCKING_1); in aif2clk_ev()
1219 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif2clk_ev()
1231 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif1clk_late_ev() local
1232 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_late_ev()
1249 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif2clk_late_ev() local
1250 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif2clk_late_ev()
1267 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in late_enable_ev() local
1268 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_enable_ev()
1274 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1, in late_enable_ev()
1282 snd_soc_component_update_bits(component, WM8994_AIF2_CLOCKING_1, in late_enable_ev()
1300 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in late_disable_ev() local
1301 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_disable_ev()
1307 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1, in late_disable_ev()
1314 snd_soc_component_update_bits(component, WM8994_AIF2_CLOCKING_1, in late_disable_ev()
1342 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in dac_ev() local
1345 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in dac_ev()
1383 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in post_ev() local
1384 dev_dbg(component->dev, "SRC status: %x\n", in post_ev()
1385 snd_soc_component_read32(component, in post_ev()
1451 struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); in wm8994_put_class_w() local
1456 wm_hubs_update_class_w(component); in wm8994_put_class_w()
2138 static int _wm8994_set_fll(struct snd_soc_component *component, int id, int src, in _wm8994_set_fll() argument
2141 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in _wm8994_set_fll()
2164 reg = snd_soc_component_read32(component, WM8994_FLL1_CONTROL_1 + reg_offset); in _wm8994_set_fll()
2205 clk1 = snd_soc_component_read32(component, WM8994_CLOCKING_1); in _wm8994_set_fll()
2210 reg = snd_soc_component_read32(component, aif_reg); in _wm8994_set_fll()
2214 dev_err(component->dev, "FLL%d is currently providing SYSCLK\n", in _wm8994_set_fll()
2220 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_1 + reg_offset, in _wm8994_set_fll()
2225 dev_dbg(component->dev, "Bypassing FLL%d\n", id + 1); in _wm8994_set_fll()
2226 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_5 + reg_offset, in _wm8994_set_fll()
2233 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_2 + reg_offset, in _wm8994_set_fll()
2237 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_3 + reg_offset, in _wm8994_set_fll()
2240 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_4 + reg_offset, in _wm8994_set_fll()
2245 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_1 + reg_offset, in _wm8994_set_fll()
2248 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_2 + reg_offset, in _wm8994_set_fll()
2251 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_2 + reg_offset, in _wm8994_set_fll()
2255 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_5 + reg_offset, in _wm8994_set_fll()
2271 active_reference(component); in _wm8994_set_fll()
2275 vmid_reference(component); in _wm8994_set_fll()
2279 vmid_reference(component); in _wm8994_set_fll()
2293 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_1 + reg_offset, in _wm8994_set_fll()
2301 dev_warn(component->dev, in _wm8994_set_fll()
2310 vmid_dereference(component); in _wm8994_set_fll()
2314 vmid_dereference(component); in _wm8994_set_fll()
2320 active_dereference(component); in _wm8994_set_fll()
2329 configure_clock(component); in _wm8994_set_fll()
2336 dev_dbg(component->dev, "Configuring AIFs for 128fs\n"); in _wm8994_set_fll()
2338 wm8994->aifdiv[0] = snd_soc_component_read32(component, WM8994_AIF1_RATE) in _wm8994_set_fll()
2340 wm8994->aifdiv[1] = snd_soc_component_read32(component, WM8994_AIF2_RATE) in _wm8994_set_fll()
2343 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in _wm8994_set_fll()
2345 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in _wm8994_set_fll()
2348 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in _wm8994_set_fll()
2351 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in _wm8994_set_fll()
2376 return _wm8994_set_fll(dai->component, id, src, freq_in, freq_out); in wm8994_set_fll()
2382 struct snd_soc_component *component = dai->component; in wm8994_set_dai_sysclk() local
2383 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_sysclk()
2432 snd_soc_component_update_bits(component, WM8994_CLOCKING_2, in wm8994_set_dai_sysclk()
2434 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2, in wm8994_set_dai_sysclk()
2437 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2, in wm8994_set_dai_sysclk()
2446 configure_clock(component); in wm8994_set_dai_sysclk()
2453 dev_dbg(component->dev, "Configuring AIFs for 128fs\n"); in wm8994_set_dai_sysclk()
2455 wm8994->aifdiv[0] = snd_soc_component_read32(component, WM8994_AIF1_RATE) in wm8994_set_dai_sysclk()
2457 wm8994->aifdiv[1] = snd_soc_component_read32(component, WM8994_AIF2_RATE) in wm8994_set_dai_sysclk()
2460 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in wm8994_set_dai_sysclk()
2462 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in wm8994_set_dai_sysclk()
2465 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in wm8994_set_dai_sysclk()
2468 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in wm8994_set_dai_sysclk()
2479 static int wm8994_set_bias_level(struct snd_soc_component *component, in wm8994_set_bias_level() argument
2482 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_bias_level()
2485 wm_hubs_set_bias_level(component, level); in wm8994_set_bias_level()
2496 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_set_bias_level()
2498 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_set_bias_level()
2505 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) in wm8994_set_bias_level()
2506 active_reference(component); in wm8994_set_bias_level()
2510 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8994_set_bias_level()
2515 snd_soc_component_update_bits(component, in wm8994_set_bias_level()
2527 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in wm8994_set_bias_level()
2534 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) in wm8994_set_bias_level()
2535 active_dereference(component); in wm8994_set_bias_level()
2541 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_set_bias_level()
2544 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_set_bias_level()
2554 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) in wm8994_set_bias_level()
2562 int wm8994_vmid_mode(struct snd_soc_component *component, enum wm8994_vmid_mode mode) in wm8994_vmid_mode() argument
2564 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_vmid_mode()
2565 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_vmid_mode()
2622 struct snd_soc_component *component = dai->component; in wm8994_set_dai_fmt() local
2623 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_fmt()
2726 snd_soc_component_update_bits(component, WM8958_AIF3_CONTROL_1, in wm8994_set_dai_fmt()
2735 snd_soc_component_update_bits(component, aif1_reg, in wm8994_set_dai_fmt()
2739 snd_soc_component_update_bits(component, ms_reg, WM8994_AIF1_MSTR, in wm8994_set_dai_fmt()
2741 snd_soc_component_update_bits(component, dac_reg, in wm8994_set_dai_fmt()
2743 snd_soc_component_update_bits(component, adc_reg, in wm8994_set_dai_fmt()
2778 struct snd_soc_component *component = dai->component; in wm8994_hw_params() local
2779 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_hw_params()
2807 dev_dbg(component->dev, "AIF1 using split LRCLK\n"); in wm8994_hw_params()
2820 dev_dbg(component->dev, "AIF2 using split LRCLK\n"); in wm8994_hw_params()
2879 (snd_soc_component_read32(component, aif1_reg) & 0x18) == 0x18) in wm8994_hw_params()
2929 snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1); in wm8994_hw_params()
2930 snd_soc_component_update_bits(component, aif2_reg, WM8994_AIF1_MONO, aif2); in wm8994_hw_params()
2931 snd_soc_component_update_bits(component, bclk_reg, WM8994_AIF1_BCLK_DIV_MASK, bclk); in wm8994_hw_params()
2932 snd_soc_component_update_bits(component, lrclk_reg, WM8994_AIF1DAC_RATE_MASK, in wm8994_hw_params()
2934 snd_soc_component_update_bits(component, rate_reg, WM8994_AIF1_SR_MASK | in wm8994_hw_params()
2941 wm8994_set_retune_mobile(component, 0); in wm8994_hw_params()
2942 wm8994_set_retune_mobile(component, 1); in wm8994_hw_params()
2946 wm8994_set_retune_mobile(component, 2); in wm8994_hw_params()
2958 struct snd_soc_component *component = dai->component; in wm8994_aif3_hw_params() local
2959 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_aif3_hw_params()
2995 return snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1); in wm8994_aif3_hw_params()
3000 struct snd_soc_component *component = codec_dai->component; in wm8994_aif_mute() local
3020 snd_soc_component_update_bits(component, mute_reg, WM8994_AIF1DAC1_MUTE, reg); in wm8994_aif_mute()
3027 struct snd_soc_component *component = codec_dai->component; in wm8994_set_tristate() local
3048 return snd_soc_component_update_bits(component, reg, mask, val); in wm8994_set_tristate()
3053 struct snd_soc_component *component = dai->component; in wm8994_aif2_probe() local
3056 snd_soc_component_update_bits(component, WM8994_GPIO_3, in wm8994_aif2_probe()
3058 snd_soc_component_update_bits(component, WM8994_GPIO_4, in wm8994_aif2_probe()
3060 snd_soc_component_update_bits(component, WM8994_GPIO_5, in wm8994_aif2_probe()
3161 static int wm8994_component_suspend(struct snd_soc_component *component) in wm8994_component_suspend() argument
3163 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_suspend()
3169 ret = _wm8994_set_fll(component, i + 1, 0, 0, 0); in wm8994_component_suspend()
3171 dev_warn(component->dev, "Failed to stop FLL%d: %d\n", in wm8994_component_suspend()
3175 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); in wm8994_component_suspend()
3180 static int wm8994_component_resume(struct snd_soc_component *component) in wm8994_component_resume() argument
3182 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_resume()
3189 ret = _wm8994_set_fll(component, i + 1, in wm8994_component_resume()
3194 dev_warn(component->dev, "Failed to restore FLL%d: %d\n", in wm8994_component_resume()
3207 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_retune_mobile_pdata() local
3260 dev_dbg(component->dev, "Allocated %d unique ReTune Mobile names\n", in wm8994_handle_retune_mobile_pdata()
3266 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_retune_mobile_pdata()
3269 dev_err(wm8994->hubs.component->dev, in wm8994_handle_retune_mobile_pdata()
3275 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_pdata() local
3283 wm_hubs_handle_analogue_pdata(component, pdata->lineout1_diff, in wm8994_handle_pdata()
3294 dev_dbg(component->dev, "%d DRC configurations\n", pdata->num_drc_cfgs); in wm8994_handle_pdata()
3307 wm8994->drc_texts = devm_kcalloc(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3318 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_pdata()
3321 wm8994_set_drc(component, i); in wm8994_handle_pdata()
3323 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8994_handle_pdata()
3329 dev_err(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3333 dev_dbg(component->dev, "%d ReTune Mobile configurations\n", in wm8994_handle_pdata()
3339 snd_soc_add_component_controls(wm8994->hubs.component, wm8994_eq_controls, in wm8994_handle_pdata()
3344 snd_soc_component_write(component, WM8958_MICBIAS1 + i, in wm8994_handle_pdata()
3353 * @component: WM8994 component
3365 int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8994_mic_detect() argument
3368 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_mic_detect()
3369 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_mic_detect()
3375 dev_warn(component->dev, "Not a WM8994\n"); in wm8994_mic_detect()
3379 pm_runtime_get_sync(component->dev); in wm8994_mic_detect()
3397 dev_warn(component->dev, "Invalid MICBIAS %d\n", micbias); in wm8994_mic_detect()
3402 dev_warn(component->dev, "Failed to configure MICBIAS%d: %d\n", in wm8994_mic_detect()
3405 dev_dbg(component->dev, "Configuring microphone detection on %d %p\n", in wm8994_mic_detect()
3418 snd_soc_component_update_bits(component, WM8994_MICBIAS, WM8994_MICD_ENA, reg); in wm8994_mic_detect()
3421 snd_soc_component_update_bits(component, WM8994_IRQ_DEBOUNCE, in wm8994_mic_detect()
3428 pm_runtime_put(component->dev); in wm8994_mic_detect()
3501 struct snd_soc_component *component = priv->hubs.component; in wm8994_mic_irq() local
3504 trace_snd_soc_jack_irq(dev_name(component->dev)); in wm8994_mic_irq()
3507 pm_wakeup_event(component->dev, 300); in wm8994_mic_irq()
3516 static void wm1811_micd_stop(struct snd_soc_component *component) in wm1811_micd_stop() argument
3518 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_micd_stop()
3519 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_micd_stop()
3524 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, WM8958_MICD_ENA, 0); in wm1811_micd_stop()
3526 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_JACK); in wm1811_micd_stop()
3532 static void wm8958_button_det(struct snd_soc_component *component, u16 status) in wm8958_button_det() argument
3534 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_button_det()
3569 wm1811_micd_stop(wm8994->hubs.component); in wm8958_open_circuit_work()
3576 wm8958_micd_set_rate(wm8994->hubs.component); in wm8958_open_circuit_work()
3587 struct snd_soc_component *component = data; in wm8958_mic_id() local
3588 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_id()
3593 dev_dbg(component->dev, "Detected open circuit\n"); in wm8958_mic_id()
3605 dev_dbg(component->dev, "Detected microphone\n"); in wm8958_mic_id()
3610 wm8958_micd_set_rate(component); in wm8958_mic_id()
3618 dev_dbg(component->dev, "Detected headphone\n"); in wm8958_mic_id()
3621 wm8958_micd_set_rate(component); in wm8958_mic_id()
3624 wm1811_micd_stop(component); in wm8958_mic_id()
3637 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_mic_work() local
3638 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_mic_work()
3640 pm_runtime_get_sync(component->dev); in wm1811_mic_work()
3650 dev_dbg(component->dev, "Starting mic detection\n"); in wm1811_mic_work()
3661 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_MIC); in wm1811_mic_work()
3663 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm1811_mic_work()
3669 pm_runtime_put(component->dev); in wm1811_mic_work()
3676 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_jackdet_irq() local
3677 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_jackdet_irq()
3681 pm_runtime_get_sync(component->dev); in wm1811_jackdet_irq()
3687 reg = snd_soc_component_read32(component, WM1811_JACKDET_CTRL); in wm1811_jackdet_irq()
3689 dev_err(component->dev, "Failed to read jack status: %d\n", reg); in wm1811_jackdet_irq()
3691 pm_runtime_put(component->dev); in wm1811_jackdet_irq()
3695 dev_dbg(component->dev, "JACKDET %x\n", reg); in wm1811_jackdet_irq()
3700 dev_dbg(component->dev, "Jack detected\n"); in wm1811_jackdet_irq()
3702 wm8958_micd_set_rate(component); in wm1811_jackdet_irq()
3704 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm1811_jackdet_irq()
3708 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm1811_jackdet_irq()
3716 dev_dbg(component->dev, "Jack not detected\n"); in wm1811_jackdet_irq()
3720 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm1811_jackdet_irq()
3724 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm1811_jackdet_irq()
3729 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm1811_jackdet_irq()
3731 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_JACK); in wm1811_jackdet_irq()
3752 pm_runtime_put(component->dev); in wm1811_jackdet_irq()
3767 * @component: WM8958 component
3780 int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8958_mic_detect() argument
3784 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8958_mic_detect()
3785 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_detect()
3797 pm_runtime_get_sync(component->dev); in wm8958_mic_detect()
3818 wm8994->mic_id_cb_data = component; in wm8958_mic_detect()
3821 wm8958_micd_set_rate(component); in wm8958_mic_detect()
3833 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_2, in wm8958_mic_detect()
3836 WARN_ON(snd_soc_component_get_bias_level(component) > SND_SOC_BIAS_STANDBY); in wm8958_mic_detect()
3844 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm8958_mic_detect()
3847 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8958_mic_detect()
3850 snd_soc_component_update_bits(component, WM8994_LDO_1, in wm8958_mic_detect()
3852 wm1811_jackdet_set_mode(component, in wm8958_mic_detect()
3855 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_mic_detect()
3860 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_mic_detect()
3862 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_NONE); in wm8958_mic_detect()
3867 pm_runtime_put(component->dev); in wm8958_mic_detect()
3878 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_work() local
3880 pm_runtime_get_sync(component->dev); in wm8958_mic_work()
3888 pm_runtime_put(component->dev); in wm8958_mic_work()
3894 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_irq() local
3902 if (!(snd_soc_component_read32(component, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA)) in wm8958_mic_irq()
3908 pm_runtime_get_sync(component->dev); in wm8958_mic_irq()
3915 reg = snd_soc_component_read32(component, WM8958_MIC_DETECT_3); in wm8958_mic_irq()
3917 dev_err(component->dev, in wm8958_mic_irq()
3920 pm_runtime_put(component->dev); in wm8958_mic_irq()
3925 dev_dbg(component->dev, "Mic detect data not valid\n"); in wm8958_mic_irq()
3936 dev_warn(component->dev, "No impedance range reported for jack\n"); in wm8958_mic_irq()
3939 trace_snd_soc_jack_irq(dev_name(component->dev)); in wm8958_mic_irq()
3944 ret = snd_soc_component_read32(component, WM1811_JACKDET_CTRL); in wm8958_mic_irq()
3946 dev_err(component->dev, "Failed to read jack status: %d\n", in wm8958_mic_irq()
3949 dev_dbg(component->dev, "Ignoring removed jack\n"); in wm8958_mic_irq()
3968 wm8958_button_det(component, reg); in wm8958_mic_irq()
3971 pm_runtime_put(component->dev); in wm8958_mic_irq()
3977 struct snd_soc_component *component = data; in wm8994_fifo_error() local
3979 dev_err(component->dev, "FIFO error\n"); in wm8994_fifo_error()
3986 struct snd_soc_component *component = data; in wm8994_temp_warn() local
3988 dev_err(component->dev, "Thermal warning\n"); in wm8994_temp_warn()
3995 struct snd_soc_component *component = data; in wm8994_temp_shut() local
3997 dev_crit(component->dev, "Thermal shutdown\n"); in wm8994_temp_shut()
4002 static int wm8994_component_probe(struct snd_soc_component *component) in wm8994_component_probe() argument
4004 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_component_probe()
4005 struct wm8994 *control = dev_get_drvdata(component->dev->parent); in wm8994_component_probe()
4006 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_probe()
4010 snd_soc_component_init_regmap(component, control->regmap); in wm8994_component_probe()
4012 wm8994->hubs.component = component; in wm8994_component_probe()
4089 snd_soc_component_update_bits(component, WM8994_ANALOGUE_HP_1, in wm8994_component_probe()
4098 wm8994_fifo_error, "FIFO error", component); in wm8994_component_probe()
4100 wm8994_temp_warn, "Thermal warning", component); in wm8994_component_probe()
4102 wm8994_temp_shut, "Thermal shutdown", component); in wm8994_component_probe()
4120 dev_warn(component->dev, in wm8994_component_probe()
4130 dev_warn(component->dev, in wm8994_component_probe()
4139 dev_warn(component->dev, in wm8994_component_probe()
4148 dev_warn(component->dev, in wm8994_component_probe()
4163 dev_warn(component->dev, in wm8994_component_probe()
4199 pm_runtime_get_sync(component->dev); in wm8994_component_probe()
4207 dev_err(component->dev, "Failed to read GPIO1 state: %d\n", ret); in wm8994_component_probe()
4219 dev_err(component->dev, "Failed to read GPIO6 state: %d\n", ret); in wm8994_component_probe()
4229 pm_runtime_put(component->dev); in wm8994_component_probe()
4233 snd_soc_component_update_bits(component, wm8994_vu_bits[i].reg, in wm8994_component_probe()
4238 snd_soc_component_update_bits(component, WM8994_AIF1_DAC1_FILTERS_2, in wm8994_component_probe()
4241 snd_soc_component_update_bits(component, WM8994_AIF1_DAC2_FILTERS_2, in wm8994_component_probe()
4244 snd_soc_component_update_bits(component, WM8994_AIF2_DAC_FILTERS_2, in wm8994_component_probe()
4254 snd_soc_component_update_bits(component, WM8994_AIF1_CONTROL_1, in wm8994_component_probe()
4265 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_component_probe()
4267 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_component_probe()
4275 wm_hubs_update_class_w(component); in wm8994_component_probe()
4279 wm_hubs_add_analogue_controls(component); in wm8994_component_probe()
4280 snd_soc_add_component_controls(component, wm8994_common_snd_controls, in wm8994_component_probe()
4287 snd_soc_add_component_controls(component, wm8994_snd_controls, in wm8994_component_probe()
4308 snd_soc_add_component_controls(component, wm8994_snd_controls, in wm8994_component_probe()
4310 snd_soc_add_component_controls(component, wm8958_snd_controls, in wm8994_component_probe()
4332 snd_soc_add_component_controls(component, wm8958_snd_controls, in wm8994_component_probe()
4345 wm_hubs_add_analogue_routes(component, 0, 0); in wm8994_component_probe()
4383 wm8958_dsp2_init(component); in wm8994_component_probe()
4408 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_probe()
4409 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_probe()
4410 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_probe()
4415 static void wm8994_component_remove(struct snd_soc_component *component) in wm8994_component_remove() argument
4417 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_remove()
4427 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_remove()
4428 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_remove()
4429 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_remove()