Lines Matching refs:component

105 static void wm8958_micd_set_rate(struct snd_soc_component *component)  in wm8958_micd_set_rate()  argument
107 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_micd_set_rate()
116 sysclk = snd_soc_component_read32(component, WM8994_CLOCKING_1); in wm8958_micd_set_rate()
147 dev_dbg(component->dev, "MICD rate %d,%d for %dHz %s\n", in wm8958_micd_set_rate()
151 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_micd_set_rate()
156 static int configure_aif_clock(struct snd_soc_component *component, int aif) in configure_aif_clock() argument
158 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_aif_clock()
196 dev_dbg(component->dev, "Dividing AIF%d clock to %dHz\n", in configure_aif_clock()
202 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1 + offset, in configure_aif_clock()
209 static int configure_clock(struct snd_soc_component *component) in configure_clock() argument
211 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in configure_clock()
212 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_clock()
216 configure_aif_clock(component, 0); in configure_clock()
217 configure_aif_clock(component, 1); in configure_clock()
227 wm8958_micd_set_rate(component); in configure_clock()
236 change = snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in configure_clock()
241 wm8958_micd_set_rate(component); in configure_clock()
249 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_clk_sys() local
250 int reg = snd_soc_component_read32(component, WM8994_CLOCKING_1); in check_clk_sys()
299 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_drc_sw() local
309 ret = snd_soc_component_read32(component, mc->reg); in wm8994_put_drc_sw()
318 static void wm8994_set_drc(struct snd_soc_component *component, int drc) in wm8994_set_drc() argument
320 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_drc()
328 save = snd_soc_component_read32(component, base); in wm8994_set_drc()
333 snd_soc_component_update_bits(component, base + i, 0xffff, in wm8994_set_drc()
336 snd_soc_component_update_bits(component, base, WM8994_AIF1DAC1_DRC_ENA | in wm8994_set_drc()
356 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_drc_enum() local
357 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_drc_enum()
371 wm8994_set_drc(component, drc); in wm8994_put_drc_enum()
379 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_get_drc_enum() local
380 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_drc_enum()
390 static void wm8994_set_retune_mobile(struct snd_soc_component *component, int block) in wm8994_set_retune_mobile() argument
392 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_retune_mobile()
429 dev_dbg(component->dev, "ReTune Mobile %d %s/%dHz for %dHz sample rate\n", in wm8994_set_retune_mobile()
438 save = snd_soc_component_read32(component, base); in wm8994_set_retune_mobile()
442 snd_soc_component_update_bits(component, base + i, 0xffff, in wm8994_set_retune_mobile()
445 snd_soc_component_update_bits(component, base, WM8994_AIF1DAC1_EQ_ENA, save); in wm8994_set_retune_mobile()
463 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_retune_mobile_enum() local
464 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_retune_mobile_enum()
478 wm8994_set_retune_mobile(component, block); in wm8994_put_retune_mobile_enum()
486 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_get_retune_mobile_enum() local
487 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_retune_mobile_enum()
744 static void wm1811_jackdet_set_mode(struct snd_soc_component *component, u16 mode) in wm1811_jackdet_set_mode() argument
746 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_jackdet_set_mode()
763 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in wm1811_jackdet_set_mode()
767 static void active_reference(struct snd_soc_component *component) in active_reference() argument
769 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_reference()
775 dev_dbg(component->dev, "Active refcount incremented, now %d\n", in active_reference()
779 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_AUDIO); in active_reference()
784 static void active_dereference(struct snd_soc_component *component) in active_dereference() argument
786 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_dereference()
793 dev_dbg(component->dev, "Active refcount decremented, now %d\n", in active_dereference()
803 wm1811_jackdet_set_mode(component, mode); in active_dereference()
812 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in clk_sys_event() local
813 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in clk_sys_event()
817 return configure_clock(component); in clk_sys_event()
836 configure_clock(component); in clk_sys_event()
843 static void vmid_reference(struct snd_soc_component *component) in vmid_reference() argument
845 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_reference()
847 pm_runtime_get_sync(component->dev); in vmid_reference()
851 dev_dbg(component->dev, "Referencing VMID, refcount is now %d\n", in vmid_reference()
855 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in vmid_reference()
859 wm_hubs_vmid_ena(component); in vmid_reference()
867 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
879 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_reference()
886 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
894 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
906 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_reference()
913 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
922 static void vmid_dereference(struct snd_soc_component *component) in vmid_dereference() argument
924 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_dereference()
928 dev_dbg(component->dev, "Dereferencing VMID, refcount is now %d\n", in vmid_dereference()
933 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
940 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
947 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_dereference()
953 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_dereference()
959 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in vmid_dereference()
965 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
972 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_dereference()
978 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_dereference()
982 pm_runtime_put(component->dev); in vmid_dereference()
988 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vmid_event() local
992 vmid_reference(component); in vmid_event()
996 vmid_dereference(component); in vmid_event()
1003 static bool wm8994_check_class_w_digital(struct snd_soc_component *component) in wm8994_check_class_w_digital() argument
1009 reg = snd_soc_component_read32(component, WM8994_DAC1_LEFT_MIXER_ROUTING); in wm8994_check_class_w_digital()
1012 dev_vdbg(component->dev, "Class W source AIF2DAC\n"); in wm8994_check_class_w_digital()
1016 dev_vdbg(component->dev, "Class W source AIF1DAC2\n"); in wm8994_check_class_w_digital()
1020 dev_vdbg(component->dev, "Class W source AIF1DAC1\n"); in wm8994_check_class_w_digital()
1024 dev_vdbg(component->dev, "DAC mixer setting: %x\n", reg); in wm8994_check_class_w_digital()
1028 reg_r = snd_soc_component_read32(component, WM8994_DAC1_RIGHT_MIXER_ROUTING); in wm8994_check_class_w_digital()
1030 dev_vdbg(component->dev, "Left and right DAC mixers different\n"); in wm8994_check_class_w_digital()
1035 snd_soc_component_update_bits(component, WM8994_CLASS_W_1, in wm8994_check_class_w_digital()
1044 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif1clk_ev() local
1045 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_ev()
1068 val = snd_soc_component_read32(component, WM8994_AIF1_CONTROL_1); in aif1clk_ev()
1079 val = snd_soc_component_read32(component, WM8994_AIF1_CONTROL_2); in aif1clk_ev()
1090 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif1clk_ev()
1092 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif1clk_ev()
1094 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif1clk_ev()
1099 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, mask, in aif1clk_ev()
1104 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, mask, in aif1clk_ev()
1113 snd_soc_component_write(component, wm8994_vu_bits[i].reg, in aif1clk_ev()
1114 snd_soc_component_read32(component, in aif1clk_ev()
1120 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif1clk_ev()
1122 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif1clk_ev()
1125 val = snd_soc_component_read32(component, WM8994_CLOCKING_1); in aif1clk_ev()
1130 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif1clk_ev()
1142 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif2clk_ev() local
1150 val = snd_soc_component_read32(component, WM8994_AIF2_CONTROL_1); in aif2clk_ev()
1161 val = snd_soc_component_read32(component, WM8994_AIF2_CONTROL_2); in aif2clk_ev()
1171 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1174 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1177 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif2clk_ev()
1182 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1187 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1196 snd_soc_component_write(component, wm8994_vu_bits[i].reg, in aif2clk_ev()
1197 snd_soc_component_read32(component, in aif2clk_ev()
1203 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1206 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1210 val = snd_soc_component_read32(component, WM8994_CLOCKING_1); in aif2clk_ev()
1215 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif2clk_ev()
1227 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif1clk_late_ev() local
1228 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_late_ev()
1245 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif2clk_late_ev() local
1246 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif2clk_late_ev()
1263 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in late_enable_ev() local
1264 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_enable_ev()
1270 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1, in late_enable_ev()
1278 snd_soc_component_update_bits(component, WM8994_AIF2_CLOCKING_1, in late_enable_ev()
1296 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in late_disable_ev() local
1297 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_disable_ev()
1303 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1, in late_disable_ev()
1310 snd_soc_component_update_bits(component, WM8994_AIF2_CLOCKING_1, in late_disable_ev()
1338 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in dac_ev() local
1341 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in dac_ev()
1379 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in post_ev() local
1380 dev_dbg(component->dev, "SRC status: %x\n", in post_ev()
1381 snd_soc_component_read32(component, in post_ev()
1447 struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); in wm8994_put_class_w() local
1452 wm_hubs_update_class_w(component); in wm8994_put_class_w()
2134 static int _wm8994_set_fll(struct snd_soc_component *component, int id, int src, in _wm8994_set_fll() argument
2137 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in _wm8994_set_fll()
2160 reg = snd_soc_component_read32(component, WM8994_FLL1_CONTROL_1 + reg_offset); in _wm8994_set_fll()
2201 clk1 = snd_soc_component_read32(component, WM8994_CLOCKING_1); in _wm8994_set_fll()
2206 reg = snd_soc_component_read32(component, aif_reg); in _wm8994_set_fll()
2210 dev_err(component->dev, "FLL%d is currently providing SYSCLK\n", in _wm8994_set_fll()
2216 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_1 + reg_offset, in _wm8994_set_fll()
2221 dev_dbg(component->dev, "Bypassing FLL%d\n", id + 1); in _wm8994_set_fll()
2222 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_5 + reg_offset, in _wm8994_set_fll()
2229 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_2 + reg_offset, in _wm8994_set_fll()
2233 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_3 + reg_offset, in _wm8994_set_fll()
2236 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_4 + reg_offset, in _wm8994_set_fll()
2241 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_1 + reg_offset, in _wm8994_set_fll()
2244 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_2 + reg_offset, in _wm8994_set_fll()
2247 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_2 + reg_offset, in _wm8994_set_fll()
2251 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_5 + reg_offset, in _wm8994_set_fll()
2267 active_reference(component); in _wm8994_set_fll()
2271 vmid_reference(component); in _wm8994_set_fll()
2275 vmid_reference(component); in _wm8994_set_fll()
2289 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_1 + reg_offset, in _wm8994_set_fll()
2297 dev_warn(component->dev, in _wm8994_set_fll()
2306 vmid_dereference(component); in _wm8994_set_fll()
2310 vmid_dereference(component); in _wm8994_set_fll()
2316 active_dereference(component); in _wm8994_set_fll()
2325 configure_clock(component); in _wm8994_set_fll()
2332 dev_dbg(component->dev, "Configuring AIFs for 128fs\n"); in _wm8994_set_fll()
2334 wm8994->aifdiv[0] = snd_soc_component_read32(component, WM8994_AIF1_RATE) in _wm8994_set_fll()
2336 wm8994->aifdiv[1] = snd_soc_component_read32(component, WM8994_AIF2_RATE) in _wm8994_set_fll()
2339 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in _wm8994_set_fll()
2341 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in _wm8994_set_fll()
2344 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in _wm8994_set_fll()
2347 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in _wm8994_set_fll()
2372 return _wm8994_set_fll(dai->component, id, src, freq_in, freq_out); in wm8994_set_fll()
2378 struct snd_soc_component *component = dai->component; in wm8994_set_dai_sysclk() local
2379 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_sysclk()
2428 snd_soc_component_update_bits(component, WM8994_CLOCKING_2, in wm8994_set_dai_sysclk()
2430 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2, in wm8994_set_dai_sysclk()
2433 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2, in wm8994_set_dai_sysclk()
2442 configure_clock(component); in wm8994_set_dai_sysclk()
2449 dev_dbg(component->dev, "Configuring AIFs for 128fs\n"); in wm8994_set_dai_sysclk()
2451 wm8994->aifdiv[0] = snd_soc_component_read32(component, WM8994_AIF1_RATE) in wm8994_set_dai_sysclk()
2453 wm8994->aifdiv[1] = snd_soc_component_read32(component, WM8994_AIF2_RATE) in wm8994_set_dai_sysclk()
2456 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in wm8994_set_dai_sysclk()
2458 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in wm8994_set_dai_sysclk()
2461 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in wm8994_set_dai_sysclk()
2464 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in wm8994_set_dai_sysclk()
2475 static int wm8994_set_bias_level(struct snd_soc_component *component, in wm8994_set_bias_level() argument
2478 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_bias_level()
2481 wm_hubs_set_bias_level(component, level); in wm8994_set_bias_level()
2492 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_set_bias_level()
2494 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_set_bias_level()
2501 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) in wm8994_set_bias_level()
2502 active_reference(component); in wm8994_set_bias_level()
2506 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8994_set_bias_level()
2511 snd_soc_component_update_bits(component, in wm8994_set_bias_level()
2523 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in wm8994_set_bias_level()
2530 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) in wm8994_set_bias_level()
2531 active_dereference(component); in wm8994_set_bias_level()
2537 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_set_bias_level()
2540 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_set_bias_level()
2550 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) in wm8994_set_bias_level()
2558 int wm8994_vmid_mode(struct snd_soc_component *component, enum wm8994_vmid_mode mode) in wm8994_vmid_mode() argument
2560 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_vmid_mode()
2561 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_vmid_mode()
2618 struct snd_soc_component *component = dai->component; in wm8994_set_dai_fmt() local
2619 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_fmt()
2722 snd_soc_component_update_bits(component, WM8958_AIF3_CONTROL_1, in wm8994_set_dai_fmt()
2731 snd_soc_component_update_bits(component, aif1_reg, in wm8994_set_dai_fmt()
2735 snd_soc_component_update_bits(component, ms_reg, WM8994_AIF1_MSTR, in wm8994_set_dai_fmt()
2737 snd_soc_component_update_bits(component, dac_reg, in wm8994_set_dai_fmt()
2739 snd_soc_component_update_bits(component, adc_reg, in wm8994_set_dai_fmt()
2774 struct snd_soc_component *component = dai->component; in wm8994_hw_params() local
2775 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_hw_params()
2803 dev_dbg(component->dev, "AIF1 using split LRCLK\n"); in wm8994_hw_params()
2816 dev_dbg(component->dev, "AIF2 using split LRCLK\n"); in wm8994_hw_params()
2875 (snd_soc_component_read32(component, aif1_reg) & 0x18) == 0x18) in wm8994_hw_params()
2925 snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1); in wm8994_hw_params()
2926 snd_soc_component_update_bits(component, aif2_reg, WM8994_AIF1_MONO, aif2); in wm8994_hw_params()
2927 snd_soc_component_update_bits(component, bclk_reg, WM8994_AIF1_BCLK_DIV_MASK, bclk); in wm8994_hw_params()
2928 snd_soc_component_update_bits(component, lrclk_reg, WM8994_AIF1DAC_RATE_MASK, in wm8994_hw_params()
2930 snd_soc_component_update_bits(component, rate_reg, WM8994_AIF1_SR_MASK | in wm8994_hw_params()
2937 wm8994_set_retune_mobile(component, 0); in wm8994_hw_params()
2938 wm8994_set_retune_mobile(component, 1); in wm8994_hw_params()
2942 wm8994_set_retune_mobile(component, 2); in wm8994_hw_params()
2954 struct snd_soc_component *component = dai->component; in wm8994_aif3_hw_params() local
2955 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_aif3_hw_params()
2991 return snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1); in wm8994_aif3_hw_params()
2996 struct snd_soc_component *component = codec_dai->component; in wm8994_aif_mute() local
3016 snd_soc_component_update_bits(component, mute_reg, WM8994_AIF1DAC1_MUTE, reg); in wm8994_aif_mute()
3023 struct snd_soc_component *component = codec_dai->component; in wm8994_set_tristate() local
3044 return snd_soc_component_update_bits(component, reg, mask, val); in wm8994_set_tristate()
3049 struct snd_soc_component *component = dai->component; in wm8994_aif2_probe() local
3052 snd_soc_component_update_bits(component, WM8994_GPIO_3, in wm8994_aif2_probe()
3054 snd_soc_component_update_bits(component, WM8994_GPIO_4, in wm8994_aif2_probe()
3056 snd_soc_component_update_bits(component, WM8994_GPIO_5, in wm8994_aif2_probe()
3157 static int wm8994_component_suspend(struct snd_soc_component *component) in wm8994_component_suspend() argument
3159 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_suspend()
3165 ret = _wm8994_set_fll(component, i + 1, 0, 0, 0); in wm8994_component_suspend()
3167 dev_warn(component->dev, "Failed to stop FLL%d: %d\n", in wm8994_component_suspend()
3171 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); in wm8994_component_suspend()
3176 static int wm8994_component_resume(struct snd_soc_component *component) in wm8994_component_resume() argument
3178 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_resume()
3185 ret = _wm8994_set_fll(component, i + 1, in wm8994_component_resume()
3190 dev_warn(component->dev, "Failed to restore FLL%d: %d\n", in wm8994_component_resume()
3203 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_retune_mobile_pdata() local
3256 dev_dbg(component->dev, "Allocated %d unique ReTune Mobile names\n", in wm8994_handle_retune_mobile_pdata()
3262 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_retune_mobile_pdata()
3265 dev_err(wm8994->hubs.component->dev, in wm8994_handle_retune_mobile_pdata()
3271 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_pdata() local
3279 wm_hubs_handle_analogue_pdata(component, pdata->lineout1_diff, in wm8994_handle_pdata()
3290 dev_dbg(component->dev, "%d DRC configurations\n", pdata->num_drc_cfgs); in wm8994_handle_pdata()
3303 wm8994->drc_texts = devm_kcalloc(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3314 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_pdata()
3317 wm8994_set_drc(component, i); in wm8994_handle_pdata()
3319 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8994_handle_pdata()
3325 dev_err(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3329 dev_dbg(component->dev, "%d ReTune Mobile configurations\n", in wm8994_handle_pdata()
3335 snd_soc_add_component_controls(wm8994->hubs.component, wm8994_eq_controls, in wm8994_handle_pdata()
3340 snd_soc_component_write(component, WM8958_MICBIAS1 + i, in wm8994_handle_pdata()
3361 int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8994_mic_detect() argument
3364 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_mic_detect()
3365 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_mic_detect()
3371 dev_warn(component->dev, "Not a WM8994\n"); in wm8994_mic_detect()
3391 dev_warn(component->dev, "Invalid MICBIAS %d\n", micbias); in wm8994_mic_detect()
3396 dev_warn(component->dev, "Failed to configure MICBIAS%d: %d\n", in wm8994_mic_detect()
3399 dev_dbg(component->dev, "Configuring microphone detection on %d %p\n", in wm8994_mic_detect()
3412 snd_soc_component_update_bits(component, WM8994_MICBIAS, WM8994_MICD_ENA, reg); in wm8994_mic_detect()
3415 snd_soc_component_update_bits(component, WM8994_IRQ_DEBOUNCE, in wm8994_mic_detect()
3493 struct snd_soc_component *component = priv->hubs.component; in wm8994_mic_irq() local
3496 trace_snd_soc_jack_irq(dev_name(component->dev)); in wm8994_mic_irq()
3499 pm_wakeup_event(component->dev, 300); in wm8994_mic_irq()
3508 static void wm1811_micd_stop(struct snd_soc_component *component) in wm1811_micd_stop() argument
3510 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_micd_stop()
3511 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_micd_stop()
3516 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, WM8958_MICD_ENA, 0); in wm1811_micd_stop()
3518 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_JACK); in wm1811_micd_stop()
3524 static void wm8958_button_det(struct snd_soc_component *component, u16 status) in wm8958_button_det() argument
3526 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_button_det()
3561 wm1811_micd_stop(wm8994->hubs.component); in wm8958_open_circuit_work()
3568 wm8958_micd_set_rate(wm8994->hubs.component); in wm8958_open_circuit_work()
3579 struct snd_soc_component *component = data; in wm8958_mic_id() local
3580 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_id()
3585 dev_dbg(component->dev, "Detected open circuit\n"); in wm8958_mic_id()
3597 dev_dbg(component->dev, "Detected microphone\n"); in wm8958_mic_id()
3602 wm8958_micd_set_rate(component); in wm8958_mic_id()
3610 dev_dbg(component->dev, "Detected headphone\n"); in wm8958_mic_id()
3613 wm8958_micd_set_rate(component); in wm8958_mic_id()
3616 wm1811_micd_stop(component); in wm8958_mic_id()
3629 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_mic_work() local
3630 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_mic_work()
3632 pm_runtime_get_sync(component->dev); in wm1811_mic_work()
3642 dev_dbg(component->dev, "Starting mic detection\n"); in wm1811_mic_work()
3653 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_MIC); in wm1811_mic_work()
3655 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm1811_mic_work()
3661 pm_runtime_put(component->dev); in wm1811_mic_work()
3668 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_jackdet_irq() local
3669 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_jackdet_irq()
3673 pm_runtime_get_sync(component->dev); in wm1811_jackdet_irq()
3679 reg = snd_soc_component_read32(component, WM1811_JACKDET_CTRL); in wm1811_jackdet_irq()
3681 dev_err(component->dev, "Failed to read jack status: %d\n", reg); in wm1811_jackdet_irq()
3683 pm_runtime_put(component->dev); in wm1811_jackdet_irq()
3687 dev_dbg(component->dev, "JACKDET %x\n", reg); in wm1811_jackdet_irq()
3692 dev_dbg(component->dev, "Jack detected\n"); in wm1811_jackdet_irq()
3694 wm8958_micd_set_rate(component); in wm1811_jackdet_irq()
3696 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm1811_jackdet_irq()
3700 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm1811_jackdet_irq()
3708 dev_dbg(component->dev, "Jack not detected\n"); in wm1811_jackdet_irq()
3712 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm1811_jackdet_irq()
3716 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm1811_jackdet_irq()
3721 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm1811_jackdet_irq()
3723 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_JACK); in wm1811_jackdet_irq()
3744 pm_runtime_put(component->dev); in wm1811_jackdet_irq()
3772 int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8958_mic_detect() argument
3776 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8958_mic_detect()
3777 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_detect()
3808 wm8994->mic_id_cb_data = component; in wm8958_mic_detect()
3811 wm8958_micd_set_rate(component); in wm8958_mic_detect()
3823 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_2, in wm8958_mic_detect()
3826 WARN_ON(snd_soc_component_get_bias_level(component) > SND_SOC_BIAS_STANDBY); in wm8958_mic_detect()
3834 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm8958_mic_detect()
3837 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8958_mic_detect()
3840 snd_soc_component_update_bits(component, WM8994_LDO_1, in wm8958_mic_detect()
3842 wm1811_jackdet_set_mode(component, in wm8958_mic_detect()
3845 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_mic_detect()
3850 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_mic_detect()
3852 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_NONE); in wm8958_mic_detect()
3866 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_work() local
3868 pm_runtime_get_sync(component->dev); in wm8958_mic_work()
3876 pm_runtime_put(component->dev); in wm8958_mic_work()
3882 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_irq() local
3890 if (!(snd_soc_component_read32(component, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA)) in wm8958_mic_irq()
3896 pm_runtime_get_sync(component->dev); in wm8958_mic_irq()
3903 reg = snd_soc_component_read32(component, WM8958_MIC_DETECT_3); in wm8958_mic_irq()
3905 dev_err(component->dev, in wm8958_mic_irq()
3908 pm_runtime_put(component->dev); in wm8958_mic_irq()
3913 dev_dbg(component->dev, "Mic detect data not valid\n"); in wm8958_mic_irq()
3924 dev_warn(component->dev, "No impedance range reported for jack\n"); in wm8958_mic_irq()
3927 trace_snd_soc_jack_irq(dev_name(component->dev)); in wm8958_mic_irq()
3932 ret = snd_soc_component_read32(component, WM1811_JACKDET_CTRL); in wm8958_mic_irq()
3934 dev_err(component->dev, "Failed to read jack status: %d\n", in wm8958_mic_irq()
3937 dev_dbg(component->dev, "Ignoring removed jack\n"); in wm8958_mic_irq()
3956 wm8958_button_det(component, reg); in wm8958_mic_irq()
3959 pm_runtime_put(component->dev); in wm8958_mic_irq()
3965 struct snd_soc_component *component = data; in wm8994_fifo_error() local
3967 dev_err(component->dev, "FIFO error\n"); in wm8994_fifo_error()
3974 struct snd_soc_component *component = data; in wm8994_temp_warn() local
3976 dev_err(component->dev, "Thermal warning\n"); in wm8994_temp_warn()
3983 struct snd_soc_component *component = data; in wm8994_temp_shut() local
3985 dev_crit(component->dev, "Thermal shutdown\n"); in wm8994_temp_shut()
3990 static int wm8994_component_probe(struct snd_soc_component *component) in wm8994_component_probe() argument
3992 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_component_probe()
3993 struct wm8994 *control = dev_get_drvdata(component->dev->parent); in wm8994_component_probe()
3994 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_probe()
3998 snd_soc_component_init_regmap(component, control->regmap); in wm8994_component_probe()
4000 wm8994->hubs.component = component; in wm8994_component_probe()
4075 snd_soc_component_update_bits(component, WM8994_ANALOGUE_HP_1, in wm8994_component_probe()
4084 wm8994_fifo_error, "FIFO error", component); in wm8994_component_probe()
4086 wm8994_temp_warn, "Thermal warning", component); in wm8994_component_probe()
4088 wm8994_temp_shut, "Thermal shutdown", component); in wm8994_component_probe()
4106 dev_warn(component->dev, in wm8994_component_probe()
4116 dev_warn(component->dev, in wm8994_component_probe()
4125 dev_warn(component->dev, in wm8994_component_probe()
4134 dev_warn(component->dev, in wm8994_component_probe()
4149 dev_warn(component->dev, in wm8994_component_probe()
4185 pm_runtime_get_sync(component->dev); in wm8994_component_probe()
4193 dev_err(component->dev, "Failed to read GPIO1 state: %d\n", ret); in wm8994_component_probe()
4205 dev_err(component->dev, "Failed to read GPIO6 state: %d\n", ret); in wm8994_component_probe()
4215 pm_runtime_put(component->dev); in wm8994_component_probe()
4219 snd_soc_component_update_bits(component, wm8994_vu_bits[i].reg, in wm8994_component_probe()
4224 snd_soc_component_update_bits(component, WM8994_AIF1_DAC1_FILTERS_2, in wm8994_component_probe()
4227 snd_soc_component_update_bits(component, WM8994_AIF1_DAC2_FILTERS_2, in wm8994_component_probe()
4230 snd_soc_component_update_bits(component, WM8994_AIF2_DAC_FILTERS_2, in wm8994_component_probe()
4240 snd_soc_component_update_bits(component, WM8994_AIF1_CONTROL_1, in wm8994_component_probe()
4251 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_component_probe()
4253 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_component_probe()
4261 wm_hubs_update_class_w(component); in wm8994_component_probe()
4265 wm_hubs_add_analogue_controls(component); in wm8994_component_probe()
4266 snd_soc_add_component_controls(component, wm8994_common_snd_controls, in wm8994_component_probe()
4273 snd_soc_add_component_controls(component, wm8994_snd_controls, in wm8994_component_probe()
4294 snd_soc_add_component_controls(component, wm8994_snd_controls, in wm8994_component_probe()
4296 snd_soc_add_component_controls(component, wm8958_snd_controls, in wm8994_component_probe()
4318 snd_soc_add_component_controls(component, wm8958_snd_controls, in wm8994_component_probe()
4331 wm_hubs_add_analogue_routes(component, 0, 0); in wm8994_component_probe()
4369 wm8958_dsp2_init(component); in wm8994_component_probe()
4394 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_probe()
4395 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_probe()
4396 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_probe()
4401 static void wm8994_component_remove(struct snd_soc_component *component) in wm8994_component_remove() argument
4403 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_remove()
4413 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_remove()
4414 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_remove()
4415 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_remove()