Lines Matching defs:rt715

3  * rt715.c -- rt715 ALSA SoC audio driver
35 #include "rt715.h"
106 static void rt715_get_gain(struct rt715_priv *rt715, unsigned int addr_h,
113 ret = regmap_read(rt715->regmap, addr_l, r_val);
120 ret = regmap_read(rt715->regmap, addr_h, l_val);
134 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
140 if (ucontrol->value.integer.value[i] != rt715->kctl_2ch_vol_ori[i]) {
155 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
158 regmap_write(rt715->regmap,
162 rt715->kctl_2ch_vol_ori[0] = ucontrol->value.integer.value[0];
171 rt715->kctl_2ch_vol_ori[1] = ucontrol->value.integer.value[1];
184 regmap_write(rt715->regmap, addr_h,
186 regmap_write(rt715->regmap, addr_l,
191 regmap_write(rt715->regmap, addr_h,
195 regmap_write(rt715->regmap, addr_l,
204 rt715_get_gain(rt715, addr_h, addr_l, val_h,
212 regmap_write(rt715->regmap,
221 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
234 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
257 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
269 if (ucontrol->value.integer.value[i] != rt715->kctl_8ch_switch_ori[i])
277 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
280 regmap_write(rt715->regmap,
285 rt715->kctl_8ch_switch_ori[j * 2] =
293 rt715->kctl_8ch_switch_ori[j * 2 + 1] =
304 regmap_write(rt715->regmap, addr_h,
306 regmap_write(rt715->regmap, addr_l,
311 regmap_write(rt715->regmap, addr_h,
315 regmap_write(rt715->regmap, addr_l,
319 rt715_get_gain(rt715, addr_h, addr_l, val_h,
328 regmap_write(rt715->regmap,
337 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
350 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
365 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
377 if (ucontrol->value.integer.value[i] != rt715->kctl_8ch_vol_ori[i])
384 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
387 regmap_write(rt715->regmap,
392 rt715->kctl_8ch_vol_ori[j * 2] = ucontrol->value.integer.value[j * 2];
401 rt715->kctl_8ch_vol_ori[j * 2 + 1] =
413 regmap_write(rt715->regmap, addr_h,
415 regmap_write(rt715->regmap, addr_l,
420 regmap_write(rt715->regmap, addr_h,
424 regmap_write(rt715->regmap, addr_l,
428 rt715_get_gain(rt715, addr_h, addr_l, val_h,
437 regmap_write(rt715->regmap,
446 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
459 rt715_get_gain(rt715, addr_h, addr_l, val_h, &read_rl, &read_ll);
561 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
568 ret = regmap_read(rt715->regmap, reg, &val);
594 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
607 ret = regmap_read(rt715->regmap, reg, &val2);
621 regmap_write(rt715->regmap, reg, val);
767 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
772 regmap_write(rt715->regmap,
780 regmap_write(rt715->regmap,
794 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
797 if (!rt715->first_hw_init)
840 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
852 if (!rt715->slave)
860 rt715_index_write(rt715->regmap, RT715_SDW_INPUT_SEL, 0xa500);
864 rt715_index_write(rt715->regmap, RT715_SDW_INPUT_SEL, 0xa000);
871 retval = sdw_stream_add_slave(rt715->slave, &stream_config,
922 regmap_write(rt715->regmap, RT715_MIC_ADC_FORMAT_H, val);
923 regmap_write(rt715->regmap, RT715_MIC_LINE_FORMAT_H, val);
924 regmap_write(rt715->regmap, RT715_MIX_ADC_FORMAT_H, val);
925 regmap_write(rt715->regmap, RT715_MIX_ADC2_FORMAT_H, val);
934 struct rt715_priv *rt715 = snd_soc_component_get_drvdata(component);
938 if (!rt715->slave)
941 sdw_stream_remove_slave(rt715->slave, sdw_stream);
958 .name = "rt715-aif1",
970 .name = "rt715-aif2",
993 struct rt715_priv *rt715 = dev_get_drvdata(dev);
996 clk_freq = (rt715->params.curr_dr_freq >> 1);
1021 regmap_write(rt715->regmap, 0xe0, value);
1022 regmap_write(rt715->regmap, 0xf0, value);
1030 struct rt715_priv *rt715;
1033 rt715 = devm_kzalloc(dev, sizeof(*rt715), GFP_KERNEL);
1034 if (!rt715)
1037 dev_set_drvdata(dev, rt715);
1038 rt715->slave = slave;
1039 rt715->regmap = regmap;
1040 rt715->sdw_regmap = sdw_regmap;
1042 regcache_cache_only(rt715->regmap, true);
1048 rt715->hw_init = false;
1049 rt715->first_hw_init = false;
1078 struct rt715_priv *rt715 = dev_get_drvdata(dev);
1080 if (rt715->hw_init)
1083 regcache_cache_only(rt715->regmap, false);
1088 if (!rt715->first_hw_init)
1094 rt715_reset(rt715->regmap);
1097 regmap_write(rt715->regmap, RT715_SET_GAIN_LINE_ADC_H, 0xb080);
1098 regmap_write(rt715->regmap, RT715_SET_GAIN_MIX_ADC_H, 0xb080);
1100 regmap_write(rt715->regmap, RT715_SET_GAIN_MIC_ADC_H, 0xb080);
1101 regmap_write(rt715->regmap, RT715_SET_GAIN_MIX_ADC2_H, 0xb080);
1104 regmap_write(rt715->regmap, RT715_SET_PIN_DMIC1, 0x20);
1105 regmap_write(rt715->regmap, RT715_SET_PIN_DMIC2, 0x20);
1106 regmap_write(rt715->regmap, RT715_SET_PIN_DMIC3, 0x20);
1107 regmap_write(rt715->regmap, RT715_SET_PIN_DMIC4, 0x20);
1109 regmap_write(rt715->regmap, RT715_SET_STREAMID_LINE_ADC, 0x10);
1110 regmap_write(rt715->regmap, RT715_SET_STREAMID_MIX_ADC, 0x10);
1111 regmap_write(rt715->regmap, RT715_SET_STREAMID_MIC_ADC, 0x10);
1112 regmap_write(rt715->regmap, RT715_SET_STREAMID_MIX_ADC2, 0x10);
1114 regmap_write(rt715->regmap, RT715_SET_DMIC1_CONFIG_DEFAULT1, 0xd0);
1115 regmap_write(rt715->regmap, RT715_SET_DMIC1_CONFIG_DEFAULT2, 0x11);
1116 regmap_write(rt715->regmap, RT715_SET_DMIC1_CONFIG_DEFAULT3, 0xa1);
1117 regmap_write(rt715->regmap, RT715_SET_DMIC1_CONFIG_DEFAULT4, 0x81);
1118 regmap_write(rt715->regmap, RT715_SET_DMIC2_CONFIG_DEFAULT1, 0xd1);
1119 regmap_write(rt715->regmap, RT715_SET_DMIC2_CONFIG_DEFAULT2, 0x11);
1120 regmap_write(rt715->regmap, RT715_SET_DMIC2_CONFIG_DEFAULT3, 0xa1);
1121 regmap_write(rt715->regmap, RT715_SET_DMIC2_CONFIG_DEFAULT4, 0x81);
1122 regmap_write(rt715->regmap, RT715_SET_DMIC3_CONFIG_DEFAULT1, 0xd0);
1123 regmap_write(rt715->regmap, RT715_SET_DMIC3_CONFIG_DEFAULT2, 0x11);
1124 regmap_write(rt715->regmap, RT715_SET_DMIC3_CONFIG_DEFAULT3, 0xa1);
1125 regmap_write(rt715->regmap, RT715_SET_DMIC3_CONFIG_DEFAULT4, 0x81);
1126 regmap_write(rt715->regmap, RT715_SET_DMIC4_CONFIG_DEFAULT1, 0xd1);
1127 regmap_write(rt715->regmap, RT715_SET_DMIC4_CONFIG_DEFAULT2, 0x11);
1128 regmap_write(rt715->regmap, RT715_SET_DMIC4_CONFIG_DEFAULT3, 0xa1);
1129 regmap_write(rt715->regmap, RT715_SET_DMIC4_CONFIG_DEFAULT4, 0x81);
1132 regmap_write(rt715->regmap, RT715_SET_AUDIO_POWER_STATE, AC_PWRST_D3);
1134 if (rt715->first_hw_init)
1135 regcache_mark_dirty(rt715->regmap);
1137 rt715->first_hw_init = true;
1140 rt715->hw_init = true;
1148 MODULE_DESCRIPTION("ASoC rt715 driver");
1149 MODULE_DESCRIPTION("ASoC rt715 driver SDW");