Lines Matching refs:component

111 static void wm8958_micd_set_rate(struct snd_soc_component *component)  in wm8958_micd_set_rate()  argument
113 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_micd_set_rate()
122 sysclk = snd_soc_component_read(component, WM8994_CLOCKING_1); in wm8958_micd_set_rate()
153 dev_dbg(component->dev, "MICD rate %d,%d for %dHz %s\n", in wm8958_micd_set_rate()
157 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_micd_set_rate()
162 static int configure_aif_clock(struct snd_soc_component *component, int aif) in configure_aif_clock() argument
164 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_aif_clock()
202 dev_dbg(component->dev, "Dividing AIF%d clock to %dHz\n", in configure_aif_clock()
208 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1 + offset, in configure_aif_clock()
215 static int configure_clock(struct snd_soc_component *component) in configure_clock() argument
217 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in configure_clock()
218 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in configure_clock()
222 configure_aif_clock(component, 0); in configure_clock()
223 configure_aif_clock(component, 1); in configure_clock()
233 wm8958_micd_set_rate(component); in configure_clock()
242 change = snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in configure_clock()
247 wm8958_micd_set_rate(component); in configure_clock()
255 struct snd_soc_component *component = snd_soc_dapm_to_component(source->dapm); in check_clk_sys() local
256 int reg = snd_soc_component_read(component, WM8994_CLOCKING_1); in check_clk_sys()
304 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_drc_sw() local
314 ret = snd_soc_component_read(component, mc->reg); in wm8994_put_drc_sw()
323 static void wm8994_set_drc(struct snd_soc_component *component, int drc) in wm8994_set_drc() argument
325 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_drc()
333 save = snd_soc_component_read(component, base); in wm8994_set_drc()
338 snd_soc_component_update_bits(component, base + i, 0xffff, in wm8994_set_drc()
341 snd_soc_component_update_bits(component, base, WM8994_AIF1DAC1_DRC_ENA | in wm8994_set_drc()
361 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_drc_enum() local
362 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_drc_enum()
376 wm8994_set_drc(component, drc); in wm8994_put_drc_enum()
384 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_get_drc_enum() local
385 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_drc_enum()
395 static void wm8994_set_retune_mobile(struct snd_soc_component *component, int block) in wm8994_set_retune_mobile() argument
397 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_retune_mobile()
434 dev_dbg(component->dev, "ReTune Mobile %d %s/%dHz for %dHz sample rate\n", in wm8994_set_retune_mobile()
443 save = snd_soc_component_read(component, base); in wm8994_set_retune_mobile()
447 snd_soc_component_update_bits(component, base + i, 0xffff, in wm8994_set_retune_mobile()
450 snd_soc_component_update_bits(component, base, WM8994_AIF1DAC1_EQ_ENA, save); in wm8994_set_retune_mobile()
468 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_put_retune_mobile_enum() local
469 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_put_retune_mobile_enum()
483 wm8994_set_retune_mobile(component, block); in wm8994_put_retune_mobile_enum()
491 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); in wm8994_get_retune_mobile_enum() local
492 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_get_retune_mobile_enum()
742 static void wm1811_jackdet_set_mode(struct snd_soc_component *component, u16 mode) in wm1811_jackdet_set_mode() argument
744 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_jackdet_set_mode()
761 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in wm1811_jackdet_set_mode()
765 static void active_reference(struct snd_soc_component *component) in active_reference() argument
767 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_reference()
773 dev_dbg(component->dev, "Active refcount incremented, now %d\n", in active_reference()
777 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_AUDIO); in active_reference()
782 static void active_dereference(struct snd_soc_component *component) in active_dereference() argument
784 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in active_dereference()
791 dev_dbg(component->dev, "Active refcount decremented, now %d\n", in active_dereference()
801 wm1811_jackdet_set_mode(component, mode); in active_dereference()
810 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in clk_sys_event() local
811 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in clk_sys_event()
815 return configure_clock(component); in clk_sys_event()
834 configure_clock(component); in clk_sys_event()
841 static void vmid_reference(struct snd_soc_component *component) in vmid_reference() argument
843 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_reference()
845 pm_runtime_get_sync(component->dev); in vmid_reference()
849 dev_dbg(component->dev, "Referencing VMID, refcount is now %d\n", in vmid_reference()
853 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in vmid_reference()
857 wm_hubs_vmid_ena(component); in vmid_reference()
865 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
877 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_reference()
884 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
892 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
904 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_reference()
911 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_reference()
920 static void vmid_dereference(struct snd_soc_component *component) in vmid_dereference() argument
922 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in vmid_dereference()
926 dev_dbg(component->dev, "Dereferencing VMID, refcount is now %d\n", in vmid_dereference()
931 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
938 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
945 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_dereference()
951 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_dereference()
957 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in vmid_dereference()
963 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_3, in vmid_dereference()
970 snd_soc_component_update_bits(component, WM8994_ANTIPOP_2, in vmid_dereference()
976 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_1, in vmid_dereference()
980 pm_runtime_put(component->dev); in vmid_dereference()
986 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vmid_event() local
990 vmid_reference(component); in vmid_event()
994 vmid_dereference(component); in vmid_event()
1001 static bool wm8994_check_class_w_digital(struct snd_soc_component *component) in wm8994_check_class_w_digital() argument
1007 reg = snd_soc_component_read(component, WM8994_DAC1_LEFT_MIXER_ROUTING); in wm8994_check_class_w_digital()
1010 dev_vdbg(component->dev, "Class W source AIF2DAC\n"); in wm8994_check_class_w_digital()
1014 dev_vdbg(component->dev, "Class W source AIF1DAC2\n"); in wm8994_check_class_w_digital()
1018 dev_vdbg(component->dev, "Class W source AIF1DAC1\n"); in wm8994_check_class_w_digital()
1022 dev_vdbg(component->dev, "DAC mixer setting: %x\n", reg); in wm8994_check_class_w_digital()
1026 reg_r = snd_soc_component_read(component, WM8994_DAC1_RIGHT_MIXER_ROUTING); in wm8994_check_class_w_digital()
1028 dev_vdbg(component->dev, "Left and right DAC mixers different\n"); in wm8994_check_class_w_digital()
1033 snd_soc_component_update_bits(component, WM8994_CLASS_W_1, in wm8994_check_class_w_digital()
1039 static void wm8994_update_vu_bits(struct snd_soc_component *component) in wm8994_update_vu_bits() argument
1041 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_update_vu_bits()
1046 snd_soc_component_write(component, wm8994_vu_bits[i].reg, in wm8994_update_vu_bits()
1047 snd_soc_component_read(component, in wm8994_update_vu_bits()
1053 snd_soc_component_write(component, in wm8994_update_vu_bits()
1055 snd_soc_component_read(component, in wm8994_update_vu_bits()
1059 static int aif_mclk_set(struct snd_soc_component *component, int aif, bool enable) in aif_mclk_set() argument
1061 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif_mclk_set()
1070 val = snd_soc_component_read(component, WM8994_AIF1_CLOCKING_1 + offset); in aif_mclk_set()
1087 dev_err(component->dev, "Failed to enable MCLK%d\n", in aif_mclk_set()
1101 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif1clk_ev() local
1102 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_ev()
1121 ret = aif_mclk_set(component, 0, true); in aif1clk_ev()
1129 val = snd_soc_component_read(component, WM8994_AIF1_CONTROL_1); in aif1clk_ev()
1140 val = snd_soc_component_read(component, WM8994_AIF1_CONTROL_2); in aif1clk_ev()
1151 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif1clk_ev()
1153 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif1clk_ev()
1155 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif1clk_ev()
1160 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, mask, in aif1clk_ev()
1165 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, mask, in aif1clk_ev()
1173 wm8994_update_vu_bits(component); in aif1clk_ev()
1178 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif1clk_ev()
1180 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif1clk_ev()
1183 val = snd_soc_component_read(component, WM8994_CLOCKING_1); in aif1clk_ev()
1188 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif1clk_ev()
1196 aif_mclk_set(component, 0, false); in aif1clk_ev()
1206 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif2clk_ev() local
1214 ret = aif_mclk_set(component, 1, true); in aif2clk_ev()
1218 val = snd_soc_component_read(component, WM8994_AIF2_CONTROL_1); in aif2clk_ev()
1229 val = snd_soc_component_read(component, WM8994_AIF2_CONTROL_2); in aif2clk_ev()
1239 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1242 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1245 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif2clk_ev()
1250 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1255 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1263 wm8994_update_vu_bits(component); in aif2clk_ev()
1268 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in aif2clk_ev()
1271 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_4, in aif2clk_ev()
1275 val = snd_soc_component_read(component, WM8994_CLOCKING_1); in aif2clk_ev()
1280 snd_soc_component_update_bits(component, WM8994_CLOCKING_1, in aif2clk_ev()
1288 aif_mclk_set(component, 1, false); in aif2clk_ev()
1298 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif1clk_late_ev() local
1299 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif1clk_late_ev()
1316 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in aif2clk_late_ev() local
1317 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in aif2clk_late_ev()
1334 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in late_enable_ev() local
1335 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_enable_ev()
1341 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1, in late_enable_ev()
1349 snd_soc_component_update_bits(component, WM8994_AIF2_CLOCKING_1, in late_enable_ev()
1367 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in late_disable_ev() local
1368 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in late_disable_ev()
1374 snd_soc_component_update_bits(component, WM8994_AIF1_CLOCKING_1, in late_disable_ev()
1381 snd_soc_component_update_bits(component, WM8994_AIF2_CLOCKING_1, in late_disable_ev()
1409 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in dac_ev() local
1412 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_5, in dac_ev()
1450 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in post_ev() local
1451 dev_dbg(component->dev, "SRC status: %x\n", in post_ev()
1452 snd_soc_component_read(component, in post_ev()
1518 struct snd_soc_component *component = snd_soc_dapm_kcontrol_component(kcontrol); in wm8994_put_class_w() local
1523 wm_hubs_update_class_w(component); in wm8994_put_class_w()
2205 static int _wm8994_set_fll(struct snd_soc_component *component, int id, int src, in _wm8994_set_fll() argument
2208 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in _wm8994_set_fll()
2232 reg = snd_soc_component_read(component, WM8994_FLL1_CONTROL_1 + reg_offset); in _wm8994_set_fll()
2273 clk1 = snd_soc_component_read(component, WM8994_CLOCKING_1); in _wm8994_set_fll()
2278 reg = snd_soc_component_read(component, aif_reg); in _wm8994_set_fll()
2282 dev_err(component->dev, "FLL%d is currently providing SYSCLK\n", in _wm8994_set_fll()
2288 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_1 + reg_offset, in _wm8994_set_fll()
2293 reg = snd_soc_component_read(component, WM8994_FLL1_CONTROL_5 in _wm8994_set_fll()
2314 dev_dbg(component->dev, "Bypassing FLL%d\n", id + 1); in _wm8994_set_fll()
2315 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_5 + reg_offset, in _wm8994_set_fll()
2322 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_2 + reg_offset, in _wm8994_set_fll()
2326 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_3 + reg_offset, in _wm8994_set_fll()
2329 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_4 + reg_offset, in _wm8994_set_fll()
2334 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_1 + reg_offset, in _wm8994_set_fll()
2337 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_2 + reg_offset, in _wm8994_set_fll()
2340 snd_soc_component_update_bits(component, WM8958_FLL1_EFS_2 + reg_offset, in _wm8994_set_fll()
2344 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_5 + reg_offset, in _wm8994_set_fll()
2371 dev_err(component->dev, "Failed to enable MCLK for FLL%d\n", in _wm8994_set_fll()
2379 active_reference(component); in _wm8994_set_fll()
2383 vmid_reference(component); in _wm8994_set_fll()
2387 vmid_reference(component); in _wm8994_set_fll()
2401 snd_soc_component_update_bits(component, WM8994_FLL1_CONTROL_1 + reg_offset, in _wm8994_set_fll()
2409 dev_warn(component->dev, in _wm8994_set_fll()
2418 vmid_dereference(component); in _wm8994_set_fll()
2422 vmid_dereference(component); in _wm8994_set_fll()
2428 active_dereference(component); in _wm8994_set_fll()
2437 configure_clock(component); in _wm8994_set_fll()
2444 dev_dbg(component->dev, "Configuring AIFs for 128fs\n"); in _wm8994_set_fll()
2446 wm8994->aifdiv[0] = snd_soc_component_read(component, WM8994_AIF1_RATE) in _wm8994_set_fll()
2448 wm8994->aifdiv[1] = snd_soc_component_read(component, WM8994_AIF2_RATE) in _wm8994_set_fll()
2451 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in _wm8994_set_fll()
2453 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in _wm8994_set_fll()
2456 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in _wm8994_set_fll()
2459 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in _wm8994_set_fll()
2484 return _wm8994_set_fll(dai->component, id, src, freq_in, freq_out); in wm8994_set_fll()
2507 struct snd_soc_component *component = dai->component; in wm8994_set_dai_sysclk() local
2508 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_sysclk()
2567 snd_soc_component_update_bits(component, WM8994_CLOCKING_2, in wm8994_set_dai_sysclk()
2569 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2, in wm8994_set_dai_sysclk()
2572 snd_soc_component_update_bits(component, WM8994_POWER_MANAGEMENT_2, in wm8994_set_dai_sysclk()
2581 configure_clock(component); in wm8994_set_dai_sysclk()
2588 dev_dbg(component->dev, "Configuring AIFs for 128fs\n"); in wm8994_set_dai_sysclk()
2590 wm8994->aifdiv[0] = snd_soc_component_read(component, WM8994_AIF1_RATE) in wm8994_set_dai_sysclk()
2592 wm8994->aifdiv[1] = snd_soc_component_read(component, WM8994_AIF2_RATE) in wm8994_set_dai_sysclk()
2595 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in wm8994_set_dai_sysclk()
2597 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in wm8994_set_dai_sysclk()
2600 snd_soc_component_update_bits(component, WM8994_AIF1_RATE, in wm8994_set_dai_sysclk()
2603 snd_soc_component_update_bits(component, WM8994_AIF2_RATE, in wm8994_set_dai_sysclk()
2614 static int wm8994_set_bias_level(struct snd_soc_component *component, in wm8994_set_bias_level() argument
2617 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_bias_level()
2620 wm_hubs_set_bias_level(component, level); in wm8994_set_bias_level()
2631 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_set_bias_level()
2633 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_set_bias_level()
2640 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) in wm8994_set_bias_level()
2641 active_reference(component); in wm8994_set_bias_level()
2645 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) { in wm8994_set_bias_level()
2650 snd_soc_component_update_bits(component, in wm8994_set_bias_level()
2662 snd_soc_component_update_bits(component, WM8994_ANTIPOP_1, in wm8994_set_bias_level()
2669 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_PREPARE) in wm8994_set_bias_level()
2670 active_dereference(component); in wm8994_set_bias_level()
2676 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_set_bias_level()
2679 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_set_bias_level()
2689 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_STANDBY) in wm8994_set_bias_level()
2697 int wm8994_vmid_mode(struct snd_soc_component *component, enum wm8994_vmid_mode mode) in wm8994_vmid_mode() argument
2699 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_vmid_mode()
2700 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_vmid_mode()
2757 struct snd_soc_component *component = dai->component; in wm8994_set_dai_fmt() local
2758 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_set_dai_fmt()
2861 snd_soc_component_update_bits(component, WM8958_AIF3_CONTROL_1, in wm8994_set_dai_fmt()
2870 snd_soc_component_update_bits(component, aif1_reg, in wm8994_set_dai_fmt()
2874 snd_soc_component_update_bits(component, ms_reg, WM8994_AIF1_MSTR, in wm8994_set_dai_fmt()
2876 snd_soc_component_update_bits(component, dac_reg, in wm8994_set_dai_fmt()
2878 snd_soc_component_update_bits(component, adc_reg, in wm8994_set_dai_fmt()
2913 struct snd_soc_component *component = dai->component; in wm8994_hw_params() local
2914 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_hw_params()
2942 dev_dbg(component->dev, "AIF1 using split LRCLK\n"); in wm8994_hw_params()
2955 dev_dbg(component->dev, "AIF2 using split LRCLK\n"); in wm8994_hw_params()
3014 (snd_soc_component_read(component, aif1_reg) & 0x18) == 0x18) in wm8994_hw_params()
3064 snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1); in wm8994_hw_params()
3065 snd_soc_component_update_bits(component, aif2_reg, WM8994_AIF1_MONO, aif2); in wm8994_hw_params()
3066 snd_soc_component_update_bits(component, bclk_reg, WM8994_AIF1_BCLK_DIV_MASK, bclk); in wm8994_hw_params()
3067 snd_soc_component_update_bits(component, lrclk_reg, WM8994_AIF1DAC_RATE_MASK, in wm8994_hw_params()
3069 snd_soc_component_update_bits(component, rate_reg, WM8994_AIF1_SR_MASK | in wm8994_hw_params()
3076 wm8994_set_retune_mobile(component, 0); in wm8994_hw_params()
3077 wm8994_set_retune_mobile(component, 1); in wm8994_hw_params()
3081 wm8994_set_retune_mobile(component, 2); in wm8994_hw_params()
3093 struct snd_soc_component *component = dai->component; in wm8994_aif3_hw_params() local
3094 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_aif3_hw_params()
3130 return snd_soc_component_update_bits(component, aif1_reg, WM8994_AIF1_WL_MASK, aif1); in wm8994_aif3_hw_params()
3136 struct snd_soc_component *component = codec_dai->component; in wm8994_aif_mute() local
3156 snd_soc_component_update_bits(component, mute_reg, WM8994_AIF1DAC1_MUTE, reg); in wm8994_aif_mute()
3163 struct snd_soc_component *component = codec_dai->component; in wm8994_set_tristate() local
3184 return snd_soc_component_update_bits(component, reg, mask, val); in wm8994_set_tristate()
3189 struct snd_soc_component *component = dai->component; in wm8994_aif2_probe() local
3192 snd_soc_component_update_bits(component, WM8994_GPIO_3, in wm8994_aif2_probe()
3194 snd_soc_component_update_bits(component, WM8994_GPIO_4, in wm8994_aif2_probe()
3196 snd_soc_component_update_bits(component, WM8994_GPIO_5, in wm8994_aif2_probe()
3299 static int wm8994_component_suspend(struct snd_soc_component *component) in wm8994_component_suspend() argument
3301 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_suspend()
3307 ret = _wm8994_set_fll(component, i + 1, 0, 0, 0); in wm8994_component_suspend()
3309 dev_warn(component->dev, "Failed to stop FLL%d: %d\n", in wm8994_component_suspend()
3313 snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF); in wm8994_component_suspend()
3318 static int wm8994_component_resume(struct snd_soc_component *component) in wm8994_component_resume() argument
3320 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_resume()
3327 ret = _wm8994_set_fll(component, i + 1, in wm8994_component_resume()
3332 dev_warn(component->dev, "Failed to restore FLL%d: %d\n", in wm8994_component_resume()
3345 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_retune_mobile_pdata() local
3398 dev_dbg(component->dev, "Allocated %d unique ReTune Mobile names\n", in wm8994_handle_retune_mobile_pdata()
3404 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_retune_mobile_pdata()
3407 dev_err(wm8994->hubs.component->dev, in wm8994_handle_retune_mobile_pdata()
3413 struct snd_soc_component *component = wm8994->hubs.component; in wm8994_handle_pdata() local
3421 wm_hubs_handle_analogue_pdata(component, pdata->lineout1_diff, in wm8994_handle_pdata()
3432 dev_dbg(component->dev, "%d DRC configurations\n", pdata->num_drc_cfgs); in wm8994_handle_pdata()
3445 wm8994->drc_texts = devm_kcalloc(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3456 ret = snd_soc_add_component_controls(wm8994->hubs.component, controls, in wm8994_handle_pdata()
3459 wm8994_set_drc(component, i); in wm8994_handle_pdata()
3461 ret = snd_soc_add_component_controls(wm8994->hubs.component, in wm8994_handle_pdata()
3467 dev_err(wm8994->hubs.component->dev, in wm8994_handle_pdata()
3471 dev_dbg(component->dev, "%d ReTune Mobile configurations\n", in wm8994_handle_pdata()
3477 snd_soc_add_component_controls(wm8994->hubs.component, wm8994_eq_controls, in wm8994_handle_pdata()
3482 snd_soc_component_write(component, WM8958_MICBIAS1 + i, in wm8994_handle_pdata()
3503 int wm8994_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8994_mic_detect() argument
3506 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_mic_detect()
3507 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_mic_detect()
3513 dev_warn(component->dev, "Not a WM8994\n"); in wm8994_mic_detect()
3517 pm_runtime_get_sync(component->dev); in wm8994_mic_detect()
3535 dev_warn(component->dev, "Invalid MICBIAS %d\n", micbias); in wm8994_mic_detect()
3540 dev_warn(component->dev, "Failed to configure MICBIAS%d: %d\n", in wm8994_mic_detect()
3543 dev_dbg(component->dev, "Configuring microphone detection on %d %p\n", in wm8994_mic_detect()
3556 snd_soc_component_update_bits(component, WM8994_MICBIAS, WM8994_MICD_ENA, reg); in wm8994_mic_detect()
3559 snd_soc_component_update_bits(component, WM8994_IRQ_DEBOUNCE, in wm8994_mic_detect()
3566 pm_runtime_put(component->dev); in wm8994_mic_detect()
3639 struct snd_soc_component *component = priv->hubs.component; in wm8994_mic_irq() local
3642 trace_snd_soc_jack_irq(dev_name(component->dev)); in wm8994_mic_irq()
3645 pm_wakeup_event(component->dev, 300); in wm8994_mic_irq()
3654 static void wm1811_micd_stop(struct snd_soc_component *component) in wm1811_micd_stop() argument
3656 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_micd_stop()
3657 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm1811_micd_stop()
3662 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, WM8958_MICD_ENA, 0); in wm1811_micd_stop()
3664 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_JACK); in wm1811_micd_stop()
3670 static void wm8958_button_det(struct snd_soc_component *component, u16 status) in wm8958_button_det() argument
3672 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_button_det()
3707 wm1811_micd_stop(wm8994->hubs.component); in wm8958_open_circuit_work()
3714 wm8958_micd_set_rate(wm8994->hubs.component); in wm8958_open_circuit_work()
3725 struct snd_soc_component *component = data; in wm8958_mic_id() local
3726 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_id()
3731 dev_dbg(component->dev, "Detected open circuit\n"); in wm8958_mic_id()
3743 dev_dbg(component->dev, "Detected microphone\n"); in wm8958_mic_id()
3748 wm8958_micd_set_rate(component); in wm8958_mic_id()
3756 dev_dbg(component->dev, "Detected headphone\n"); in wm8958_mic_id()
3759 wm8958_micd_set_rate(component); in wm8958_mic_id()
3762 wm1811_micd_stop(component); in wm8958_mic_id()
3775 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_mic_work() local
3776 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_mic_work()
3778 pm_runtime_get_sync(component->dev); in wm1811_mic_work()
3788 dev_dbg(component->dev, "Starting mic detection\n"); in wm1811_mic_work()
3799 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_MIC); in wm1811_mic_work()
3801 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm1811_mic_work()
3807 pm_runtime_put(component->dev); in wm1811_mic_work()
3814 struct snd_soc_component *component = wm8994->hubs.component; in wm1811_jackdet_irq() local
3815 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm1811_jackdet_irq()
3819 pm_runtime_get_sync(component->dev); in wm1811_jackdet_irq()
3825 reg = snd_soc_component_read(component, WM1811_JACKDET_CTRL); in wm1811_jackdet_irq()
3827 dev_err(component->dev, "Failed to read jack status: %d\n", reg); in wm1811_jackdet_irq()
3829 pm_runtime_put(component->dev); in wm1811_jackdet_irq()
3833 dev_dbg(component->dev, "JACKDET %x\n", reg); in wm1811_jackdet_irq()
3838 dev_dbg(component->dev, "Jack detected\n"); in wm1811_jackdet_irq()
3840 wm8958_micd_set_rate(component); in wm1811_jackdet_irq()
3842 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm1811_jackdet_irq()
3846 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm1811_jackdet_irq()
3854 dev_dbg(component->dev, "Jack not detected\n"); in wm1811_jackdet_irq()
3863 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm1811_jackdet_irq()
3867 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm1811_jackdet_irq()
3872 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm1811_jackdet_irq()
3874 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_JACK); in wm1811_jackdet_irq()
3895 pm_runtime_put(component->dev); in wm1811_jackdet_irq()
3927 int wm8958_mic_detect(struct snd_soc_component *component, struct snd_soc_jack *jack, in wm8958_mic_detect() argument
3931 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8958_mic_detect()
3932 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8958_mic_detect()
3944 pm_runtime_get_sync(component->dev); in wm8958_mic_detect()
3965 wm8994->mic_id_cb_data = component; in wm8958_mic_detect()
3968 wm8958_micd_set_rate(component); in wm8958_mic_detect()
3980 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_2, in wm8958_mic_detect()
3983 WARN_ON(snd_soc_component_get_bias_level(component) > SND_SOC_BIAS_STANDBY); in wm8958_mic_detect()
3991 snd_soc_component_update_bits(component, WM1811_JACKDET_CTRL, in wm8958_mic_detect()
3994 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8958_mic_detect()
3997 snd_soc_component_update_bits(component, WM8994_LDO_1, in wm8958_mic_detect()
3999 wm1811_jackdet_set_mode(component, in wm8958_mic_detect()
4002 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_mic_detect()
4007 snd_soc_component_update_bits(component, WM8958_MIC_DETECT_1, in wm8958_mic_detect()
4009 wm1811_jackdet_set_mode(component, WM1811_JACKDET_MODE_NONE); in wm8958_mic_detect()
4014 pm_runtime_put(component->dev); in wm8958_mic_detect()
4025 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_work() local
4027 pm_runtime_get_sync(component->dev); in wm8958_mic_work()
4035 pm_runtime_put(component->dev); in wm8958_mic_work()
4041 struct snd_soc_component *component = wm8994->hubs.component; in wm8958_mic_irq() local
4049 if (!(snd_soc_component_read(component, WM8958_MIC_DETECT_1) & WM8958_MICD_ENA)) in wm8958_mic_irq()
4055 pm_runtime_get_sync(component->dev); in wm8958_mic_irq()
4062 reg = snd_soc_component_read(component, WM8958_MIC_DETECT_3); in wm8958_mic_irq()
4064 dev_err(component->dev, in wm8958_mic_irq()
4067 pm_runtime_put(component->dev); in wm8958_mic_irq()
4072 dev_dbg(component->dev, "Mic detect data not valid\n"); in wm8958_mic_irq()
4083 dev_warn(component->dev, "No impedance range reported for jack\n"); in wm8958_mic_irq()
4086 trace_snd_soc_jack_irq(dev_name(component->dev)); in wm8958_mic_irq()
4091 ret = snd_soc_component_read(component, WM1811_JACKDET_CTRL); in wm8958_mic_irq()
4093 dev_err(component->dev, "Failed to read jack status: %d\n", in wm8958_mic_irq()
4096 dev_dbg(component->dev, "Ignoring removed jack\n"); in wm8958_mic_irq()
4115 wm8958_button_det(component, reg); in wm8958_mic_irq()
4118 pm_runtime_put(component->dev); in wm8958_mic_irq()
4124 struct snd_soc_component *component = data; in wm8994_fifo_error() local
4126 dev_err(component->dev, "FIFO error\n"); in wm8994_fifo_error()
4133 struct snd_soc_component *component = data; in wm8994_temp_warn() local
4135 dev_err(component->dev, "Thermal warning\n"); in wm8994_temp_warn()
4142 struct snd_soc_component *component = data; in wm8994_temp_shut() local
4144 dev_crit(component->dev, "Thermal shutdown\n"); in wm8994_temp_shut()
4149 static int wm8994_component_probe(struct snd_soc_component *component) in wm8994_component_probe() argument
4151 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component); in wm8994_component_probe()
4152 struct wm8994 *control = dev_get_drvdata(component->dev->parent); in wm8994_component_probe()
4153 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_probe()
4157 snd_soc_component_init_regmap(component, control->regmap); in wm8994_component_probe()
4159 wm8994->hubs.component = component; in wm8994_component_probe()
4236 snd_soc_component_update_bits(component, WM8994_ANALOGUE_HP_1, in wm8994_component_probe()
4245 wm8994_fifo_error, "FIFO error", component); in wm8994_component_probe()
4247 wm8994_temp_warn, "Thermal warning", component); in wm8994_component_probe()
4249 wm8994_temp_shut, "Thermal shutdown", component); in wm8994_component_probe()
4267 dev_warn(component->dev, in wm8994_component_probe()
4277 dev_warn(component->dev, in wm8994_component_probe()
4286 dev_warn(component->dev, in wm8994_component_probe()
4295 dev_warn(component->dev, in wm8994_component_probe()
4310 dev_warn(component->dev, in wm8994_component_probe()
4346 pm_runtime_get_sync(component->dev); in wm8994_component_probe()
4354 dev_err(component->dev, "Failed to read GPIO1 state: %d\n", ret); in wm8994_component_probe()
4366 dev_err(component->dev, "Failed to read GPIO6 state: %d\n", ret); in wm8994_component_probe()
4376 pm_runtime_put(component->dev); in wm8994_component_probe()
4380 snd_soc_component_update_bits(component, wm8994_vu_bits[i].reg, in wm8994_component_probe()
4386 snd_soc_component_update_bits(component, in wm8994_component_probe()
4393 snd_soc_component_update_bits(component, WM8994_AIF1_DAC1_FILTERS_2, in wm8994_component_probe()
4396 snd_soc_component_update_bits(component, WM8994_AIF1_DAC2_FILTERS_2, in wm8994_component_probe()
4399 snd_soc_component_update_bits(component, WM8994_AIF2_DAC_FILTERS_2, in wm8994_component_probe()
4409 snd_soc_component_update_bits(component, WM8994_AIF1_CONTROL_1, in wm8994_component_probe()
4420 snd_soc_component_update_bits(component, WM8958_MICBIAS1, in wm8994_component_probe()
4422 snd_soc_component_update_bits(component, WM8958_MICBIAS2, in wm8994_component_probe()
4430 wm_hubs_update_class_w(component); in wm8994_component_probe()
4434 wm_hubs_add_analogue_controls(component); in wm8994_component_probe()
4435 snd_soc_add_component_controls(component, wm8994_common_snd_controls, in wm8994_component_probe()
4442 snd_soc_add_component_controls(component, wm8994_snd_controls, in wm8994_component_probe()
4463 snd_soc_add_component_controls(component, wm8994_snd_controls, in wm8994_component_probe()
4465 snd_soc_add_component_controls(component, wm8958_snd_controls, in wm8994_component_probe()
4487 snd_soc_add_component_controls(component, wm8958_snd_controls, in wm8994_component_probe()
4500 wm_hubs_add_analogue_routes(component, 0, 0); in wm8994_component_probe()
4538 wm8958_dsp2_init(component); in wm8994_component_probe()
4563 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_probe()
4564 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_probe()
4565 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_probe()
4570 static void wm8994_component_remove(struct snd_soc_component *component) in wm8994_component_remove() argument
4572 struct wm8994_priv *wm8994 = snd_soc_component_get_drvdata(component); in wm8994_component_remove()
4582 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_FIFOS_ERR, component); in wm8994_component_remove()
4583 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_SHUT, component); in wm8994_component_remove()
4584 wm8994_free_irq(wm8994->wm8994, WM8994_IRQ_TEMP_WARN, component); in wm8994_component_remove()