Lines Matching refs:rt1015

3 // rt1015.c  --  RT1015 ALSA SoC audio amplifier driver
26 #include <sound/rt1015.h>
32 #include "rt1015.h"
432 struct rt1015_priv *rt1015 =
435 ucontrol->value.integer.value[0] = rt1015->boost_mode;
445 struct rt1015_priv *rt1015 =
476 rt1015->boost_mode = boost_mode;
486 struct rt1015_priv *rt1015 =
489 ucontrol->value.integer.value[0] = rt1015->bypass_boost;
494 static void rt1015_calibrate(struct rt1015_priv *rt1015)
496 struct snd_soc_component *component = rt1015->component;
497 struct regmap *regmap = rt1015->regmap;
529 struct rt1015_priv *rt1015 =
532 if (rt1015->dac_is_used) {
537 rt1015->bypass_boost = ucontrol->value.integer.value[0];
538 if (rt1015->bypass_boost == RT1015_Bypass_Boost &&
539 !rt1015->cali_done) {
540 rt1015_calibrate(rt1015);
541 rt1015->cali_done = 1;
543 regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010);
566 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
568 if (rt1015->sysclk_src == RT1015_SCLK_S_PLL)
579 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
583 rt1015->dac_is_used = 1;
584 if (rt1015->bypass_boost == RT1015_Enable_Boost) {
608 if (rt1015->bypass_boost == RT1015_Enable_Boost) {
625 rt1015->dac_is_used = 0;
639 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
658 msleep(rt1015->pdata.power_up_delay_ms);
690 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
695 pre_div = rl6231_get_clk_info(rt1015->sysclk, lrck);
795 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
798 if (freq == rt1015->sysclk && clk_id == rt1015->sysclk_src)
815 rt1015->sysclk = freq;
816 rt1015->sysclk_src = clk_id;
831 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
838 rt1015->pll_in = 0;
839 rt1015->pll_out = 0;
844 if (source == rt1015->pll_src && freq_in == rt1015->pll_in &&
845 freq_out == rt1015->pll_out)
881 rt1015->pll_in = freq_in;
882 rt1015->pll_out = freq_out;
883 rt1015->pll_src = source;
990 struct rt1015_priv *rt1015 =
993 rt1015->component = component;
1000 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
1002 regmap_write(rt1015->regmap, RT1015_RESET, 0);
1017 .name = "rt1015-aif",
1033 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
1035 regcache_cache_only(rt1015->regmap, true);
1036 regcache_mark_dirty(rt1015->regmap);
1043 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
1045 regcache_cache_only(rt1015->regmap, false);
1046 regcache_sync(rt1015->regmap);
1048 if (rt1015->cali_done)
1049 rt1015_calibrate(rt1015);
1087 { "rt1015", 0 },
1094 { .compatible = "realtek,rt1015", },
1108 static void rt1015_parse_dt(struct rt1015_priv *rt1015, struct device *dev)
1111 &rt1015->pdata.power_up_delay_ms);
1117 struct rt1015_priv *rt1015;
1121 rt1015 = devm_kzalloc(&i2c->dev, sizeof(*rt1015), GFP_KERNEL);
1122 if (!rt1015)
1125 i2c_set_clientdata(i2c, rt1015);
1127 rt1015->pdata = i2s_default_platform_data;
1130 rt1015->pdata = *pdata;
1132 rt1015_parse_dt(rt1015, &i2c->dev);
1134 rt1015->regmap = devm_regmap_init_i2c(i2c, &rt1015_regmap);
1135 if (IS_ERR(rt1015->regmap)) {
1136 ret = PTR_ERR(rt1015->regmap);
1142 ret = regmap_read(rt1015->regmap, RT1015_DEVICE_ID, &val);
1150 "Device with ID register %x is not rt1015\n", val);
1161 struct rt1015_priv *rt1015 = i2c_get_clientdata(client);
1163 regmap_write(rt1015->regmap, RT1015_RESET, 0);
1168 .name = "rt1015",