Lines Matching +full:use +full:- +full:jd2
1 // SPDX-License-Identifier: GPL-2.0-only
3 // rt711-sdca.c -- rt711 SDCA ALSA SoC audio driver
22 #include <sound/soc-dapm.h>
27 #include "rt711-sdca.h"
33 struct regmap *regmap = rt711->mbq_regmap; in rt711_sdca_index_write()
38 dev_err(&rt711->slave->dev, in rt711_sdca_index_write()
49 struct regmap *regmap = rt711->mbq_regmap; in rt711_sdca_index_read()
54 dev_err(&rt711->slave->dev, in rt711_sdca_index_read()
106 struct regmap *regmap = rt711->regmap; in rt711_sdca_calibration()
110 mutex_lock(&rt711->calibrate_mutex); in rt711_sdca_calibration()
113 regmap_read(rt711->regmap, RT711_RC_CAL_STATUS, &val); in rt711_sdca_calibration()
121 ret = regmap_read(rt711->regmap, RT711_RC_CAL_STATUS, &val); in rt711_sdca_calibration()
126 dev_err(dev, "%s, RC calibration time-out!\n", __func__); in rt711_sdca_calibration()
144 if (rt711->hw_ver == RT711_VER_VD0) in rt711_sdca_calibration()
167 dev_err(dev, "%s, calibration time-out!\n", __func__); in rt711_sdca_calibration()
170 ret = -ETIMEDOUT; in rt711_sdca_calibration()
177 /* release HP-JD and trigger FSM */ in rt711_sdca_calibration()
181 mutex_unlock(&rt711->calibrate_mutex); in rt711_sdca_calibration()
193 ret = regmap_read(rt711->regmap, in rt711_sdca_button_detect()
204 ret = regmap_read(rt711->regmap, in rt711_sdca_button_detect()
211 ret = regmap_read(rt711->regmap, in rt711_sdca_button_detect()
257 regmap_write(rt711->regmap, in rt711_sdca_button_detect()
269 rt711_sdca_ge_force_jack_type(rt711, rt711->ge_mode_override); in rt711_sdca_headset_detect()
272 ret = regmap_read(rt711->regmap, in rt711_sdca_headset_detect()
280 rt711->jack_type = 0; in rt711_sdca_headset_detect()
283 rt711->jack_type = SND_JACK_HEADPHONE; in rt711_sdca_headset_detect()
286 rt711->jack_type = SND_JACK_HEADSET; in rt711_sdca_headset_detect()
292 ret = regmap_write(rt711->regmap, in rt711_sdca_headset_detect()
299 dev_dbg(&rt711->slave->dev, in rt711_sdca_headset_detect()
315 if (!rt711->hs_jack) in rt711_sdca_jack_detect_handler()
318 if (!snd_soc_card_is_instantiated(rt711->component->card)) in rt711_sdca_jack_detect_handler()
322 if (rt711->scp_sdca_stat1 & SDW_SCP_SDCA_INT_SDCA_0) { in rt711_sdca_jack_detect_handler()
329 if (rt711->scp_sdca_stat2 & SDW_SCP_SDCA_INT_SDCA_8) in rt711_sdca_jack_detect_handler()
332 if (rt711->jack_type == 0) in rt711_sdca_jack_detect_handler()
335 dev_dbg(&rt711->slave->dev, in rt711_sdca_jack_detect_handler()
336 "in %s, jack_type=0x%x\n", __func__, rt711->jack_type); in rt711_sdca_jack_detect_handler()
337 dev_dbg(&rt711->slave->dev, in rt711_sdca_jack_detect_handler()
339 dev_dbg(&rt711->slave->dev, in rt711_sdca_jack_detect_handler()
341 rt711->scp_sdca_stat1, rt711->scp_sdca_stat2); in rt711_sdca_jack_detect_handler()
343 snd_soc_jack_report(rt711->hs_jack, rt711->jack_type | btn_type, in rt711_sdca_jack_detect_handler()
350 snd_soc_jack_report(rt711->hs_jack, rt711->jack_type, in rt711_sdca_jack_detect_handler()
356 &rt711->jack_btn_check_work, msecs_to_jiffies(200)); in rt711_sdca_jack_detect_handler()
368 ret = regmap_read(rt711->regmap, in rt711_sdca_btn_check_handler()
377 ret = regmap_read(rt711->regmap, in rt711_sdca_btn_check_handler()
384 ret = regmap_read(rt711->regmap, in rt711_sdca_btn_check_handler()
426 rt711->jack_type = 0; in rt711_sdca_btn_check_handler()
428 dev_dbg(&rt711->slave->dev, "%s, btn_type=0x%x\n", __func__, btn_type); in rt711_sdca_btn_check_handler()
429 snd_soc_jack_report(rt711->hs_jack, rt711->jack_type | btn_type, in rt711_sdca_btn_check_handler()
436 snd_soc_jack_report(rt711->hs_jack, rt711->jack_type, in rt711_sdca_btn_check_handler()
442 &rt711->jack_btn_check_work, msecs_to_jiffies(200)); in rt711_sdca_btn_check_handler()
453 mutex_lock(&rt711->calibrate_mutex); in rt711_sdca_jack_init()
455 if (rt711->hs_jack) { in rt711_sdca_jack_init()
470 switch (rt711->jd_src) { in rt711_sdca_jack_init()
502 dev_warn(rt711->component->dev, "Wrong JD source\n"); in rt711_sdca_jack_init()
507 sdw_write_no_pm(rt711->slave, SDW_SCP_SDCA_INTMASK1, SDW_SCP_SDCA_INTMASK_SDCA_0); in rt711_sdca_jack_init()
509 sdw_write_no_pm(rt711->slave, SDW_SCP_SDCA_INTMASK2, SDW_SCP_SDCA_INTMASK_SDCA_8); in rt711_sdca_jack_init()
510 dev_dbg(&rt711->slave->dev, "in %s enable\n", __func__); in rt711_sdca_jack_init()
516 dev_dbg(&rt711->slave->dev, "in %s disable\n", __func__); in rt711_sdca_jack_init()
519 mutex_unlock(&rt711->calibrate_mutex); in rt711_sdca_jack_init()
528 rt711->hs_jack = hs_jack; in rt711_sdca_set_jack_detect()
531 if (!rt711->first_hw_init) in rt711_sdca_set_jack_detect()
534 ret = pm_runtime_resume_and_get(component->dev); in rt711_sdca_set_jack_detect()
536 if (ret != -EACCES) { in rt711_sdca_set_jack_detect()
537 dev_err(component->dev, "%s: failed to resume %d\n", __func__, ret); in rt711_sdca_set_jack_detect()
542 dev_dbg(component->dev, "%s: skipping jack init for now\n", __func__); in rt711_sdca_set_jack_detect()
548 pm_runtime_mark_last_busy(component->dev); in rt711_sdca_set_jack_detect()
549 pm_runtime_put_autosuspend(component->dev); in rt711_sdca_set_jack_detect()
560 (struct soc_mixer_control *)kcontrol->private_value; in rt711_sdca_set_gain_put()
566 if (strstr(ucontrol->id.name, "FU1E Capture Volume") || in rt711_sdca_set_gain_put()
567 strstr(ucontrol->id.name, "FU0F Capture Volume")) in rt711_sdca_set_gain_put()
570 regmap_read(rt711->mbq_regmap, mc->reg, &lvalue); in rt711_sdca_set_gain_put()
571 regmap_read(rt711->mbq_regmap, mc->rreg, &rvalue); in rt711_sdca_set_gain_put()
575 gain_l_val = ucontrol->value.integer.value[0]; in rt711_sdca_set_gain_put()
576 if (gain_l_val > mc->max) in rt711_sdca_set_gain_put()
577 gain_l_val = mc->max; in rt711_sdca_set_gain_put()
580 if (mc->shift == 8) /* boost gain */ in rt711_sdca_set_gain_put()
581 gain_l_val = (gain_l_val * 10) << mc->shift; in rt711_sdca_set_gain_put()
583 if (adc_vol_flag && gain_l_val > mc->shift) in rt711_sdca_set_gain_put()
584 gain_l_val = (gain_l_val - mc->shift) * 75; in rt711_sdca_set_gain_put()
586 gain_l_val = (mc->shift - gain_l_val) * 75; in rt711_sdca_set_gain_put()
589 if (!(adc_vol_flag && read_l > mc->shift)) { in rt711_sdca_set_gain_put()
597 gain_r_val = ucontrol->value.integer.value[1]; in rt711_sdca_set_gain_put()
598 if (gain_r_val > mc->max) in rt711_sdca_set_gain_put()
599 gain_r_val = mc->max; in rt711_sdca_set_gain_put()
602 if (mc->shift == 8) /* boost gain */ in rt711_sdca_set_gain_put()
603 gain_r_val = (gain_r_val * 10) << mc->shift; in rt711_sdca_set_gain_put()
605 if (adc_vol_flag && gain_r_val > mc->shift) in rt711_sdca_set_gain_put()
606 gain_r_val = (gain_r_val - mc->shift) * 75; in rt711_sdca_set_gain_put()
608 gain_r_val = (mc->shift - gain_r_val) * 75; in rt711_sdca_set_gain_put()
611 if (!(adc_vol_flag && read_r > mc->shift)) { in rt711_sdca_set_gain_put()
625 regmap_write(rt711->mbq_regmap, mc->reg, gain_l_val); in rt711_sdca_set_gain_put()
628 regmap_write(rt711->mbq_regmap, mc->rreg, gain_r_val); in rt711_sdca_set_gain_put()
630 regmap_read(rt711->mbq_regmap, mc->reg, &read_l); in rt711_sdca_set_gain_put()
631 regmap_read(rt711->mbq_regmap, mc->rreg, &read_r); in rt711_sdca_set_gain_put()
636 return i == 3 ? -EIO : changed; in rt711_sdca_set_gain_put()
645 (struct soc_mixer_control *)kcontrol->private_value; in rt711_sdca_set_gain_get()
649 if (strstr(ucontrol->id.name, "FU1E Capture Volume") || in rt711_sdca_set_gain_get()
650 strstr(ucontrol->id.name, "FU0F Capture Volume")) in rt711_sdca_set_gain_get()
653 regmap_read(rt711->mbq_regmap, mc->reg, &read_l); in rt711_sdca_set_gain_get()
654 regmap_read(rt711->mbq_regmap, mc->rreg, &read_r); in rt711_sdca_set_gain_get()
657 if (mc->shift == 8) /* boost gain */ in rt711_sdca_set_gain_get()
658 ctl_l = (read_l >> mc->shift) / 10; in rt711_sdca_set_gain_get()
662 ctl_l = 0xffff & ~(read_l - 1); in rt711_sdca_set_gain_get()
669 ctl_l = mc->shift - (ctl_l / 75); in rt711_sdca_set_gain_get()
671 ctl_l = mc->shift + (ctl_l / 75); in rt711_sdca_set_gain_get()
673 ctl_l = mc->max - (ctl_l / 75); in rt711_sdca_set_gain_get()
678 if (mc->shift == 8) /* boost gain */ in rt711_sdca_set_gain_get()
679 ctl_r = (read_r >> mc->shift) / 10; in rt711_sdca_set_gain_get()
683 ctl_r = 0xffff & ~(read_r - 1); in rt711_sdca_set_gain_get()
690 ctl_r = mc->shift - (ctl_r / 75); in rt711_sdca_set_gain_get()
692 ctl_r = mc->shift + (ctl_r / 75); in rt711_sdca_set_gain_get()
694 ctl_r = mc->max - (ctl_r / 75); in rt711_sdca_set_gain_get()
699 ucontrol->value.integer.value[0] = ctl_l; in rt711_sdca_set_gain_get()
700 ucontrol->value.integer.value[1] = ctl_r; in rt711_sdca_set_gain_get()
710 ch_l = (rt711->fu0f_dapm_mute || rt711->fu0f_mixer_l_mute) ? 0x01 : 0x00; in rt711_sdca_set_fu0f_capture_ctl()
711 ch_r = (rt711->fu0f_dapm_mute || rt711->fu0f_mixer_r_mute) ? 0x01 : 0x00; in rt711_sdca_set_fu0f_capture_ctl()
713 err = regmap_write(rt711->regmap, in rt711_sdca_set_fu0f_capture_ctl()
719 err = regmap_write(rt711->regmap, in rt711_sdca_set_fu0f_capture_ctl()
733 ch_l = (rt711->fu1e_dapm_mute || rt711->fu1e_mixer_l_mute) ? 0x01 : 0x00; in rt711_sdca_set_fu1e_capture_ctl()
734 ch_r = (rt711->fu1e_dapm_mute || rt711->fu1e_mixer_r_mute) ? 0x01 : 0x00; in rt711_sdca_set_fu1e_capture_ctl()
736 err = regmap_write(rt711->regmap, in rt711_sdca_set_fu1e_capture_ctl()
742 err = regmap_write(rt711->regmap, in rt711_sdca_set_fu1e_capture_ctl()
757 ucontrol->value.integer.value[0] = !rt711->fu1e_mixer_l_mute; in rt711_sdca_fu1e_capture_get()
758 ucontrol->value.integer.value[1] = !rt711->fu1e_mixer_r_mute; in rt711_sdca_fu1e_capture_get()
769 if (rt711->fu1e_mixer_l_mute != !ucontrol->value.integer.value[0] || in rt711_sdca_fu1e_capture_put()
770 rt711->fu1e_mixer_r_mute != !ucontrol->value.integer.value[1]) in rt711_sdca_fu1e_capture_put()
773 rt711->fu1e_mixer_l_mute = !ucontrol->value.integer.value[0]; in rt711_sdca_fu1e_capture_put()
774 rt711->fu1e_mixer_r_mute = !ucontrol->value.integer.value[1]; in rt711_sdca_fu1e_capture_put()
788 ucontrol->value.integer.value[0] = !rt711->fu0f_mixer_l_mute; in rt711_sdca_fu0f_capture_get()
789 ucontrol->value.integer.value[1] = !rt711->fu0f_mixer_r_mute; in rt711_sdca_fu0f_capture_get()
800 if (rt711->fu0f_mixer_l_mute != !ucontrol->value.integer.value[0] || in rt711_sdca_fu0f_capture_put()
801 rt711->fu0f_mixer_r_mute != !ucontrol->value.integer.value[1]) in rt711_sdca_fu0f_capture_put()
804 rt711->fu0f_mixer_l_mute = !ucontrol->value.integer.value[0]; in rt711_sdca_fu0f_capture_put()
805 rt711->fu0f_mixer_r_mute = !ucontrol->value.integer.value[1]; in rt711_sdca_fu0f_capture_put()
816 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in rt711_sdca_ge_select_get()
821 val = (rt711->ge_mode_override >> e->shift_l) & e->mask; in rt711_sdca_ge_select_get()
823 ucontrol->value.enumerated.item[0] = item; in rt711_sdca_ge_select_get()
830 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in rt711_sdca_ge_select_put()
831 unsigned int *item = ucontrol->value.enumerated.item; in rt711_sdca_ge_select_put()
836 if (item[0] >= e->items) in rt711_sdca_ge_select_put()
837 return -EINVAL; in rt711_sdca_ge_select_put()
839 val = snd_soc_enum_item_to_val(e, item[0]) << e->shift_l; in rt711_sdca_ge_select_put()
840 if (rt711->ge_mode_override != val) { in rt711_sdca_ge_select_put()
841 rt711->ge_mode_override = val; in rt711_sdca_ge_select_put()
863 static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6525, 75, 0);
864 static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -1725, 75, 0);
909 if (strstr(ucontrol->id.name, "ADC 22 Mux")) in rt711_sdca_mux_get()
911 else if (strstr(ucontrol->id.name, "ADC 23 Mux")) in rt711_sdca_mux_get()
914 return -EINVAL; in rt711_sdca_mux_get()
919 ucontrol->value.enumerated.item[0] = (val >> mask_sft) & 0x7; in rt711_sdca_mux_get()
932 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; in rt711_sdca_mux_put()
933 unsigned int *item = ucontrol->value.enumerated.item; in rt711_sdca_mux_put()
936 if (item[0] >= e->items) in rt711_sdca_mux_put()
937 return -EINVAL; in rt711_sdca_mux_put()
939 if (strstr(ucontrol->id.name, "ADC 22 Mux")) in rt711_sdca_mux_put()
941 else if (strstr(ucontrol->id.name, "ADC 23 Mux")) in rt711_sdca_mux_put()
944 return -EINVAL; in rt711_sdca_mux_put()
946 val = snd_soc_enum_item_to_val(e, item[0]) << e->shift_l; in rt711_sdca_mux_put()
993 snd_soc_dapm_to_component(w->dapm); in rt711_sdca_fu05_event()
999 regmap_write(rt711->regmap, in rt711_sdca_fu05_event()
1003 regmap_write(rt711->regmap, in rt711_sdca_fu05_event()
1009 regmap_write(rt711->regmap, in rt711_sdca_fu05_event()
1013 regmap_write(rt711->regmap, in rt711_sdca_fu05_event()
1026 snd_soc_dapm_to_component(w->dapm); in rt711_sdca_fu0f_event()
1031 rt711->fu0f_dapm_mute = false; in rt711_sdca_fu0f_event()
1035 rt711->fu0f_dapm_mute = true; in rt711_sdca_fu0f_event()
1046 snd_soc_dapm_to_component(w->dapm); in rt711_sdca_fu1e_event()
1051 rt711->fu1e_dapm_mute = false; in rt711_sdca_fu1e_event()
1055 rt711->fu1e_dapm_mute = true; in rt711_sdca_fu1e_event()
1066 snd_soc_dapm_to_component(w->dapm); in rt711_sdca_pde28_event()
1072 regmap_write(rt711->regmap, in rt711_sdca_pde28_event()
1078 regmap_write(rt711->regmap, in rt711_sdca_pde28_event()
1091 snd_soc_dapm_to_component(w->dapm); in rt711_sdca_pde29_event()
1097 regmap_write(rt711->regmap, in rt711_sdca_pde29_event()
1103 regmap_write(rt711->regmap, in rt711_sdca_pde29_event()
1116 snd_soc_dapm_to_component(w->dapm); in rt711_sdca_pde2a_event()
1122 regmap_write(rt711->regmap, in rt711_sdca_pde2a_event()
1128 regmap_write(rt711->regmap, in rt711_sdca_pde2a_event()
1141 snd_soc_dapm_to_component(w->dapm); in rt711_sdca_line1_power_event()
1147 regmap_read(rt711->regmap, in rt711_sdca_line1_power_event()
1151 regmap_write(rt711->regmap, in rt711_sdca_line1_power_event()
1155 regmap_write(rt711->regmap, in rt711_sdca_line1_power_event()
1161 regmap_write(rt711->regmap, in rt711_sdca_line1_power_event()
1166 regmap_write(rt711->regmap, in rt711_sdca_line1_power_event()
1180 snd_soc_dapm_to_component(w->dapm); in rt711_sdca_line2_power_event()
1186 regmap_write(rt711->regmap, in rt711_sdca_line2_power_event()
1190 regmap_write(rt711->regmap, in rt711_sdca_line2_power_event()
1196 regmap_write(rt711->regmap, in rt711_sdca_line2_power_event()
1200 regmap_write(rt711->regmap, in rt711_sdca_line2_power_event()
1281 device_property_read_u32(dev, "realtek,jd-src", &rt711->jd_src); in rt711_sdca_parse_dt()
1291 rt711_sdca_parse_dt(rt711, &rt711->slave->dev); in rt711_sdca_probe()
1292 rt711->component = component; in rt711_sdca_probe()
1294 if (!rt711->first_hw_init) in rt711_sdca_probe()
1297 ret = pm_runtime_resume(component->dev); in rt711_sdca_probe()
1298 if (ret < 0 && ret != -EACCES) in rt711_sdca_probe()
1334 struct snd_soc_component *component = dai->component; in rt711_sdca_pcm_hw_params()
1342 dev_dbg(dai->dev, "%s %s", __func__, dai->name); in rt711_sdca_pcm_hw_params()
1346 return -EINVAL; in rt711_sdca_pcm_hw_params()
1348 if (!rt711->slave) in rt711_sdca_pcm_hw_params()
1349 return -EINVAL; in rt711_sdca_pcm_hw_params()
1354 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in rt711_sdca_pcm_hw_params()
1357 if (dai->id == RT711_AIF1) in rt711_sdca_pcm_hw_params()
1359 else if (dai->id == RT711_AIF2) in rt711_sdca_pcm_hw_params()
1362 return -EINVAL; in rt711_sdca_pcm_hw_params()
1365 retval = sdw_stream_add_slave(rt711->slave, &stream_config, in rt711_sdca_pcm_hw_params()
1368 dev_err(dai->dev, "%s: Unable to configure port\n", __func__); in rt711_sdca_pcm_hw_params()
1373 dev_err(component->dev, "%s: Unsupported channels %d\n", in rt711_sdca_pcm_hw_params()
1375 return -EINVAL; in rt711_sdca_pcm_hw_params()
1393 dev_err(component->dev, "%s: Rate %d is not supported\n", in rt711_sdca_pcm_hw_params()
1395 return -EINVAL; in rt711_sdca_pcm_hw_params()
1399 regmap_write(rt711->regmap, in rt711_sdca_pcm_hw_params()
1402 regmap_write(rt711->regmap, in rt711_sdca_pcm_hw_params()
1405 regmap_write(rt711->regmap, in rt711_sdca_pcm_hw_params()
1415 struct snd_soc_component *component = dai->component; in rt711_sdca_pcm_hw_free()
1420 if (!rt711->slave) in rt711_sdca_pcm_hw_free()
1421 return -EINVAL; in rt711_sdca_pcm_hw_free()
1423 sdw_stream_remove_slave(rt711->slave, sdw_stream); in rt711_sdca_pcm_hw_free()
1441 .name = "rt711-sdca-aif1",
1460 .name = "rt711-sdca-aif2",
1481 return -ENOMEM; in rt711_sdca_init()
1484 rt711->slave = slave; in rt711_sdca_init()
1485 rt711->regmap = regmap; in rt711_sdca_init()
1486 rt711->mbq_regmap = mbq_regmap; in rt711_sdca_init()
1488 regcache_cache_only(rt711->regmap, true); in rt711_sdca_init()
1489 regcache_cache_only(rt711->mbq_regmap, true); in rt711_sdca_init()
1491 mutex_init(&rt711->calibrate_mutex); in rt711_sdca_init()
1492 mutex_init(&rt711->disable_irq_lock); in rt711_sdca_init()
1494 INIT_DELAYED_WORK(&rt711->jack_detect_work, rt711_sdca_jack_detect_handler); in rt711_sdca_init()
1495 INIT_DELAYED_WORK(&rt711->jack_btn_check_work, rt711_sdca_btn_check_handler); in rt711_sdca_init()
1501 rt711->hw_init = false; in rt711_sdca_init()
1502 rt711->first_hw_init = false; in rt711_sdca_init()
1503 rt711->fu0f_dapm_mute = true; in rt711_sdca_init()
1504 rt711->fu1e_dapm_mute = true; in rt711_sdca_init()
1505 rt711->fu0f_mixer_l_mute = rt711->fu0f_mixer_r_mute = true; in rt711_sdca_init()
1506 rt711->fu1e_mixer_l_mute = rt711->fu1e_mixer_r_mute = true; in rt711_sdca_init()
1508 /* JD source uses JD2 in default */ in rt711_sdca_init()
1509 rt711->jd_src = RT711_JD2; in rt711_sdca_init()
1530 * to make sure the ASoC framework use of pm_runtime_get_sync() does not silently in rt711_sdca_init()
1531 * fail with -EACCESS because of race conditions between card creation and enumeration in rt711_sdca_init()
1546 regmap_write(rt711->regmap, 0x2f5a, 0x01); in rt711_sdca_vd0_io_init()
1554 regmap_write(rt711->regmap, 0x2f50, 0x02); in rt711_sdca_vd0_io_init()
1577 regmap_write(rt711->regmap, 0x2f5a, 0x05); in rt711_sdca_vd1_io_init()
1598 rt711->disable_irq = false; in rt711_sdca_io_init()
1600 if (rt711->hw_init) in rt711_sdca_io_init()
1603 regcache_cache_only(rt711->regmap, false); in rt711_sdca_io_init()
1604 regcache_cache_only(rt711->mbq_regmap, false); in rt711_sdca_io_init()
1606 if (rt711->first_hw_init) { in rt711_sdca_io_init()
1607 regcache_cache_bypass(rt711->regmap, true); in rt711_sdca_io_init()
1608 regcache_cache_bypass(rt711->mbq_regmap, true); in rt711_sdca_io_init()
1615 pm_runtime_set_active(&slave->dev); in rt711_sdca_io_init()
1618 pm_runtime_get_noresume(&slave->dev); in rt711_sdca_io_init()
1623 rt711->hw_ver = val & 0xf; in rt711_sdca_io_init()
1625 if (rt711->hw_ver == RT711_VER_VD0) in rt711_sdca_io_init()
1644 regmap_write(rt711->regmap, in rt711_sdca_io_init()
1651 if (rt711->hs_jack) in rt711_sdca_io_init()
1654 if (rt711->first_hw_init) { in rt711_sdca_io_init()
1655 regcache_cache_bypass(rt711->regmap, false); in rt711_sdca_io_init()
1656 regcache_mark_dirty(rt711->regmap); in rt711_sdca_io_init()
1657 regcache_cache_bypass(rt711->mbq_regmap, false); in rt711_sdca_io_init()
1658 regcache_mark_dirty(rt711->mbq_regmap); in rt711_sdca_io_init()
1660 rt711->first_hw_init = true; in rt711_sdca_io_init()
1663 rt711->hw_init = true; in rt711_sdca_io_init()
1665 pm_runtime_mark_last_busy(&slave->dev); in rt711_sdca_io_init()
1666 pm_runtime_put_autosuspend(&slave->dev); in rt711_sdca_io_init()
1668 dev_dbg(&slave->dev, "%s hw_init complete\n", __func__); in rt711_sdca_io_init()