Lines Matching refs:rt715
54 static void rt715_get_gain(struct rt715_priv *rt715, unsigned int addr_h, in rt715_get_gain() argument
61 ret = regmap_read(rt715->regmap, addr_l, r_val); in rt715_get_gain()
68 ret = regmap_read(rt715->regmap, addr_h, l_val); in rt715_get_gain()
82 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_set_amp_gain_put() local
88 if (ucontrol->value.integer.value[i] != rt715->kctl_2ch_vol_ori[i]) { in rt715_set_amp_gain_put()
103 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); in rt715_set_amp_gain_put()
106 regmap_write(rt715->regmap, in rt715_set_amp_gain_put()
110 rt715->kctl_2ch_vol_ori[0] = ucontrol->value.integer.value[0]; in rt715_set_amp_gain_put()
119 rt715->kctl_2ch_vol_ori[1] = ucontrol->value.integer.value[1]; in rt715_set_amp_gain_put()
132 regmap_write(rt715->regmap, addr_h, in rt715_set_amp_gain_put()
134 regmap_write(rt715->regmap, addr_l, in rt715_set_amp_gain_put()
139 regmap_write(rt715->regmap, addr_h, in rt715_set_amp_gain_put()
143 regmap_write(rt715->regmap, addr_l, in rt715_set_amp_gain_put()
152 rt715_get_gain(rt715, addr_h, addr_l, val_h, in rt715_set_amp_gain_put()
160 regmap_write(rt715->regmap, in rt715_set_amp_gain_put()
169 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_set_amp_gain_get() local
182 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); in rt715_set_amp_gain_get()
205 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_set_main_switch_put() local
217 if (ucontrol->value.integer.value[i] != rt715->kctl_8ch_switch_ori[i]) in rt715_set_main_switch_put()
225 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); in rt715_set_main_switch_put()
228 regmap_write(rt715->regmap, in rt715_set_main_switch_put()
233 rt715->kctl_8ch_switch_ori[j * 2] = in rt715_set_main_switch_put()
241 rt715->kctl_8ch_switch_ori[j * 2 + 1] = in rt715_set_main_switch_put()
252 regmap_write(rt715->regmap, addr_h, in rt715_set_main_switch_put()
254 regmap_write(rt715->regmap, addr_l, in rt715_set_main_switch_put()
259 regmap_write(rt715->regmap, addr_h, in rt715_set_main_switch_put()
263 regmap_write(rt715->regmap, addr_l, in rt715_set_main_switch_put()
267 rt715_get_gain(rt715, addr_h, addr_l, val_h, in rt715_set_main_switch_put()
276 regmap_write(rt715->regmap, in rt715_set_main_switch_put()
285 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_set_main_switch_get() local
298 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); in rt715_set_main_switch_get()
313 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_set_main_vol_put() local
325 if (ucontrol->value.integer.value[i] != rt715->kctl_8ch_vol_ori[i]) in rt715_set_main_vol_put()
332 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); in rt715_set_main_vol_put()
335 regmap_write(rt715->regmap, in rt715_set_main_vol_put()
340 rt715->kctl_8ch_vol_ori[j * 2] = ucontrol->value.integer.value[j * 2]; in rt715_set_main_vol_put()
349 rt715->kctl_8ch_vol_ori[j * 2 + 1] = in rt715_set_main_vol_put()
361 regmap_write(rt715->regmap, addr_h, in rt715_set_main_vol_put()
363 regmap_write(rt715->regmap, addr_l, in rt715_set_main_vol_put()
368 regmap_write(rt715->regmap, addr_h, in rt715_set_main_vol_put()
372 regmap_write(rt715->regmap, addr_l, in rt715_set_main_vol_put()
376 rt715_get_gain(rt715, addr_h, addr_l, val_h, in rt715_set_main_vol_put()
385 regmap_write(rt715->regmap, in rt715_set_main_vol_put()
394 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_set_main_vol_get() local
407 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll); in rt715_set_main_vol_get()
509 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_mux_get() local
516 ret = regmap_read(rt715->regmap, reg, &val); in rt715_mux_get()
542 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_mux_put() local
555 ret = regmap_read(rt715->regmap, reg, &val2); in rt715_mux_put()
569 regmap_write(rt715->regmap, reg, val); in rt715_mux_put()
715 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_set_bias_level() local
720 regmap_write(rt715->regmap, in rt715_set_bias_level()
728 regmap_write(rt715->regmap, in rt715_set_bias_level()
790 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_pcm_hw_params() local
803 if (!rt715->slave) in rt715_pcm_hw_params()
810 rt715_index_write(rt715->regmap, RT715_SDW_INPUT_SEL, 0xa500); in rt715_pcm_hw_params()
815 rt715_index_write(rt715->regmap, RT715_SDW_INPUT_SEL, 0xa000); in rt715_pcm_hw_params()
831 retval = sdw_stream_add_slave(rt715->slave, &stream_config, in rt715_pcm_hw_params()
882 regmap_write(rt715->regmap, RT715_MIC_ADC_FORMAT_H, val); in rt715_pcm_hw_params()
883 regmap_write(rt715->regmap, RT715_MIC_LINE_FORMAT_H, val); in rt715_pcm_hw_params()
884 regmap_write(rt715->regmap, RT715_MIX_ADC_FORMAT_H, val); in rt715_pcm_hw_params()
885 regmap_write(rt715->regmap, RT715_MIX_ADC2_FORMAT_H, val); in rt715_pcm_hw_params()
894 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component); in rt715_pcm_hw_free() local
898 if (!rt715->slave) in rt715_pcm_hw_free()
901 sdw_stream_remove_slave(rt715->slave, stream->sdw_stream); in rt715_pcm_hw_free()
953 struct rt715_priv *rt715 = dev_get_drvdata(dev); in rt715_clock_config() local
956 clk_freq = (rt715->params.curr_dr_freq >> 1); in rt715_clock_config()
981 regmap_write(rt715->regmap, 0xe0, value); in rt715_clock_config()
982 regmap_write(rt715->regmap, 0xf0, value); in rt715_clock_config()
990 struct rt715_priv *rt715; in rt715_init() local
993 rt715 = devm_kzalloc(dev, sizeof(*rt715), GFP_KERNEL); in rt715_init()
994 if (!rt715) in rt715_init()
997 dev_set_drvdata(dev, rt715); in rt715_init()
998 rt715->slave = slave; in rt715_init()
999 rt715->regmap = regmap; in rt715_init()
1000 rt715->sdw_regmap = sdw_regmap; in rt715_init()
1006 rt715->hw_init = false; in rt715_init()
1007 rt715->first_hw_init = false; in rt715_init()
1019 struct rt715_priv *rt715 = dev_get_drvdata(dev); in rt715_io_init() local
1021 if (rt715->hw_init) in rt715_io_init()
1027 if (!rt715->first_hw_init) { in rt715_io_init()
1044 regmap_write(rt715->regmap, RT715_SET_GAIN_LINE_ADC_H, 0xb080); in rt715_io_init()
1045 regmap_write(rt715->regmap, RT715_SET_GAIN_MIX_ADC_H, 0xb080); in rt715_io_init()
1047 regmap_write(rt715->regmap, RT715_SET_GAIN_MIC_ADC_H, 0xb080); in rt715_io_init()
1048 regmap_write(rt715->regmap, RT715_SET_GAIN_MIX_ADC2_H, 0xb080); in rt715_io_init()
1051 regmap_write(rt715->regmap, RT715_SET_PIN_DMIC1, 0x20); in rt715_io_init()
1052 regmap_write(rt715->regmap, RT715_SET_PIN_DMIC2, 0x20); in rt715_io_init()
1053 regmap_write(rt715->regmap, RT715_SET_PIN_DMIC3, 0x20); in rt715_io_init()
1054 regmap_write(rt715->regmap, RT715_SET_PIN_DMIC4, 0x20); in rt715_io_init()
1056 regmap_write(rt715->regmap, RT715_SET_STREAMID_LINE_ADC, 0x10); in rt715_io_init()
1057 regmap_write(rt715->regmap, RT715_SET_STREAMID_MIX_ADC, 0x10); in rt715_io_init()
1058 regmap_write(rt715->regmap, RT715_SET_STREAMID_MIC_ADC, 0x10); in rt715_io_init()
1059 regmap_write(rt715->regmap, RT715_SET_STREAMID_MIX_ADC2, 0x10); in rt715_io_init()
1061 regmap_write(rt715->regmap, RT715_SET_DMIC1_CONFIG_DEFAULT1, 0xd0); in rt715_io_init()
1062 regmap_write(rt715->regmap, RT715_SET_DMIC1_CONFIG_DEFAULT2, 0x11); in rt715_io_init()
1063 regmap_write(rt715->regmap, RT715_SET_DMIC1_CONFIG_DEFAULT3, 0xa1); in rt715_io_init()
1064 regmap_write(rt715->regmap, RT715_SET_DMIC1_CONFIG_DEFAULT4, 0x81); in rt715_io_init()
1065 regmap_write(rt715->regmap, RT715_SET_DMIC2_CONFIG_DEFAULT1, 0xd1); in rt715_io_init()
1066 regmap_write(rt715->regmap, RT715_SET_DMIC2_CONFIG_DEFAULT2, 0x11); in rt715_io_init()
1067 regmap_write(rt715->regmap, RT715_SET_DMIC2_CONFIG_DEFAULT3, 0xa1); in rt715_io_init()
1068 regmap_write(rt715->regmap, RT715_SET_DMIC2_CONFIG_DEFAULT4, 0x81); in rt715_io_init()
1069 regmap_write(rt715->regmap, RT715_SET_DMIC3_CONFIG_DEFAULT1, 0xd0); in rt715_io_init()
1070 regmap_write(rt715->regmap, RT715_SET_DMIC3_CONFIG_DEFAULT2, 0x11); in rt715_io_init()
1071 regmap_write(rt715->regmap, RT715_SET_DMIC3_CONFIG_DEFAULT3, 0xa1); in rt715_io_init()
1072 regmap_write(rt715->regmap, RT715_SET_DMIC3_CONFIG_DEFAULT4, 0x81); in rt715_io_init()
1073 regmap_write(rt715->regmap, RT715_SET_DMIC4_CONFIG_DEFAULT1, 0xd1); in rt715_io_init()
1074 regmap_write(rt715->regmap, RT715_SET_DMIC4_CONFIG_DEFAULT2, 0x11); in rt715_io_init()
1075 regmap_write(rt715->regmap, RT715_SET_DMIC4_CONFIG_DEFAULT3, 0xa1); in rt715_io_init()
1076 regmap_write(rt715->regmap, RT715_SET_DMIC4_CONFIG_DEFAULT4, 0x81); in rt715_io_init()
1079 regmap_write(rt715->regmap, RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3); in rt715_io_init()
1081 if (rt715->first_hw_init) in rt715_io_init()
1082 regcache_mark_dirty(rt715->regmap); in rt715_io_init()
1084 rt715->first_hw_init = true; in rt715_io_init()
1087 rt715->hw_init = true; in rt715_io_init()