• Home
  • Raw
  • Download

Lines Matching full:rt1015

3 // rt1015.c  --  RT1015 ALSA SoC audio amplifier driver
30 #include <sound/rt1015.h>
33 #include "rt1015.h"
433 struct rt1015_priv *rt1015 = in rt1015_boost_mode_get() local
436 ucontrol->value.integer.value[0] = rt1015->boost_mode; in rt1015_boost_mode_get()
446 struct rt1015_priv *rt1015 = in rt1015_boost_mode_put() local
449 rt1015->boost_mode = ucontrol->value.integer.value[0]; in rt1015_boost_mode_put()
451 switch (rt1015->boost_mode) { in rt1015_boost_mode_put()
485 struct rt1015_priv *rt1015 = in rt1015_bypass_boost_get() local
488 ucontrol->value.integer.value[0] = rt1015->bypass_boost; in rt1015_bypass_boost_get()
493 static void rt1015_calibrate(struct rt1015_priv *rt1015) in rt1015_calibrate() argument
495 struct snd_soc_component *component = rt1015->component; in rt1015_calibrate()
496 struct regmap *regmap = rt1015->regmap; in rt1015_calibrate()
525 struct rt1015_priv *rt1015 = in rt1015_bypass_boost_put() local
528 if (!rt1015->dac_is_used) { in rt1015_bypass_boost_put()
529 rt1015->bypass_boost = ucontrol->value.integer.value[0]; in rt1015_bypass_boost_put()
530 if (rt1015->bypass_boost == RT1015_Bypass_Boost && in rt1015_bypass_boost_put()
531 !rt1015->cali_done) { in rt1015_bypass_boost_put()
532 rt1015_calibrate(rt1015); in rt1015_bypass_boost_put()
533 rt1015->cali_done = 1; in rt1015_bypass_boost_put()
535 regmap_write(rt1015->regmap, RT1015_MONO_DYNA_CTRL, 0x0010); in rt1015_bypass_boost_put()
545 struct rt1015_priv *rt1015 = container_of(work, struct rt1015_priv, in rt1015_flush_work() local
547 struct snd_soc_component *component = rt1015->component; in rt1015_flush_work()
553 regmap_read(rt1015->regmap, RT1015_CLK_DET, &val); in rt1015_flush_work()
559 regmap_write(rt1015->regmap, RT1015_SYS_RST1, 0x0597); in rt1015_flush_work()
560 regmap_write(rt1015->regmap, RT1015_SYS_RST1, 0x05f7); in rt1015_flush_work()
561 regmap_write(rt1015->regmap, RT1015_MAN_I2C, 0x0028); in rt1015_flush_work()
586 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_is_sys_clk_from_pll() local
588 if (rt1015->sysclk_src == RT1015_SCLK_S_PLL) in rt1015_is_sys_clk_from_pll()
599 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in r1015_dac_event() local
603 rt1015->dac_is_used = 1; in r1015_dac_event()
604 if (rt1015->bypass_boost == RT1015_Enable_Boost) { in r1015_dac_event()
622 regmap_write(rt1015->regmap, RT1015_MAN_I2C, 0x00a8); in r1015_dac_event()
626 if (rt1015->bypass_boost == RT1015_Enable_Boost) { in r1015_dac_event()
637 rt1015->dac_is_used = 0; in r1015_dac_event()
639 cancel_delayed_work_sync(&rt1015->flush_work); in r1015_dac_event()
653 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_amp_drv_event() local
657 if (rt1015->hw_config == RT1015_HW_28) in rt1015_amp_drv_event()
658 schedule_delayed_work(&rt1015->flush_work, msecs_to_jiffies(10)); in rt1015_amp_drv_event()
659 msleep(rt1015->pdata.power_up_delay_ms); in rt1015_amp_drv_event()
728 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_hw_params() local
732 rt1015->lrck = params_rate(params); in rt1015_hw_params()
733 pre_div = rl6231_get_clk_info(rt1015->sysclk, rt1015->lrck); in rt1015_hw_params()
747 rt1015->bclk = rt1015->lrck * (32 << bclk_ms); in rt1015_hw_params()
753 rt1015->lrck, pre_div, dai->id); in rt1015_hw_params()
837 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_set_component_sysclk() local
840 if (freq == rt1015->sysclk && clk_id == rt1015->sysclk_src) in rt1015_set_component_sysclk()
857 rt1015->sysclk = freq; in rt1015_set_component_sysclk()
858 rt1015->sysclk_src = clk_id; in rt1015_set_component_sysclk()
873 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_set_component_pll() local
880 rt1015->pll_in = 0; in rt1015_set_component_pll()
881 rt1015->pll_out = 0; in rt1015_set_component_pll()
886 if (source == rt1015->pll_src && freq_in == rt1015->pll_in && in rt1015_set_component_pll()
887 freq_out == rt1015->pll_out) in rt1015_set_component_pll()
891 if (rt1015->bclk_ratio == 0) { in rt1015_set_component_pll()
930 rt1015->pll_in = freq_in; in rt1015_set_component_pll()
931 rt1015->pll_out = freq_out; in rt1015_set_component_pll()
932 rt1015->pll_src = source; in rt1015_set_component_pll()
940 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_set_bclk_ratio() local
944 rt1015->bclk_ratio = ratio; in rt1015_set_bclk_ratio()
956 struct rt1015_priv *rt1015 = in rt1015_probe() local
959 rt1015->component = component; in rt1015_probe()
960 rt1015->bclk_ratio = 0; in rt1015_probe()
961 rt1015->cali_done = 0; in rt1015_probe()
964 INIT_DELAYED_WORK(&rt1015->flush_work, rt1015_flush_work); in rt1015_probe()
971 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_remove() local
973 cancel_delayed_work_sync(&rt1015->flush_work); in rt1015_remove()
974 regmap_write(rt1015->regmap, RT1015_RESET, 0); in rt1015_remove()
989 .name = "rt1015-aif",
1005 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_suspend() local
1007 regcache_cache_only(rt1015->regmap, true); in rt1015_suspend()
1008 regcache_mark_dirty(rt1015->regmap); in rt1015_suspend()
1015 struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); in rt1015_resume() local
1017 regcache_cache_only(rt1015->regmap, false); in rt1015_resume()
1018 regcache_sync(rt1015->regmap); in rt1015_resume()
1056 { "rt1015", 0 },
1063 { .compatible = "realtek,rt1015", },
1077 static void rt1015_parse_dt(struct rt1015_priv *rt1015, struct device *dev) in rt1015_parse_dt() argument
1080 &rt1015->pdata.power_up_delay_ms); in rt1015_parse_dt()
1087 struct rt1015_priv *rt1015; in rt1015_i2c_probe() local
1091 rt1015 = devm_kzalloc(&i2c->dev, sizeof(struct rt1015_priv), in rt1015_i2c_probe()
1093 if (rt1015 == NULL) in rt1015_i2c_probe()
1096 i2c_set_clientdata(i2c, rt1015); in rt1015_i2c_probe()
1098 rt1015->pdata = i2s_default_platform_data; in rt1015_i2c_probe()
1101 rt1015->pdata = *pdata; in rt1015_i2c_probe()
1103 rt1015_parse_dt(rt1015, &i2c->dev); in rt1015_i2c_probe()
1105 rt1015->regmap = devm_regmap_init_i2c(i2c, &rt1015_regmap); in rt1015_i2c_probe()
1106 if (IS_ERR(rt1015->regmap)) { in rt1015_i2c_probe()
1107 ret = PTR_ERR(rt1015->regmap); in rt1015_i2c_probe()
1113 rt1015->hw_config = (i2c->addr == 0x29) ? RT1015_HW_29 : RT1015_HW_28; in rt1015_i2c_probe()
1115 regmap_read(rt1015->regmap, RT1015_DEVICE_ID, &val); in rt1015_i2c_probe()
1118 "Device with ID register %x is not rt1015\n", val); in rt1015_i2c_probe()
1129 struct rt1015_priv *rt1015 = i2c_get_clientdata(client); in rt1015_i2c_shutdown() local
1131 regmap_write(rt1015->regmap, RT1015_RESET, 0); in rt1015_i2c_shutdown()
1136 .name = "rt1015",
1146 MODULE_DESCRIPTION("ASoC RT1015 driver");