Lines Matching defs:rt1016
3 // rt1016.c -- RT1016 ALSA SoC audio amplifier driver
29 #include "rt1016.h"
181 struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
183 if (rt1016->sysclk_src == RT1016_SCLK_S_PLL)
309 struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
313 rt1016->lrck = params_rate(params);
314 pre_div = rl6231_get_clk_info(rt1016->sysclk, rt1016->lrck);
328 rt1016->bclk = rt1016->lrck * (32 << bclk_ms);
330 if (bclk_ms && rt1016->master)
335 rt1016->lrck, pre_div, dai->id);
367 struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
373 rt1016->master = 1;
422 struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
425 if (freq == rt1016->sysclk && clk_id == rt1016->sysclk_src)
442 rt1016->sysclk = freq;
443 rt1016->sysclk_src = clk_id;
458 struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
465 rt1016->pll_in = 0;
466 rt1016->pll_out = 0;
471 if (source == rt1016->pll_src && freq_in == rt1016->pll_in &&
472 freq_out == rt1016->pll_out)
509 rt1016->pll_in = freq_in;
510 rt1016->pll_out = freq_out;
511 rt1016->pll_src = source;
518 struct rt1016_priv *rt1016 =
521 rt1016->component = component;
528 struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
530 regmap_write(rt1016->regmap, RT1016_RESET, 0);
544 .name = "rt1016-aif",
560 struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
562 regcache_cache_only(rt1016->regmap, true);
563 regcache_mark_dirty(rt1016->regmap);
570 struct rt1016_priv *rt1016 = snd_soc_component_get_drvdata(component);
572 regcache_cache_only(rt1016->regmap, false);
573 regcache_sync(rt1016->regmap);
612 { "rt1016", 0 },
619 { .compatible = "realtek,rt1016", },
636 struct rt1016_priv *rt1016;
640 rt1016 = devm_kzalloc(&i2c->dev, sizeof(struct rt1016_priv),
642 if (rt1016 == NULL)
645 i2c_set_clientdata(i2c, rt1016);
647 rt1016->regmap = devm_regmap_init_i2c(i2c, &rt1016_regmap);
648 if (IS_ERR(rt1016->regmap)) {
649 ret = PTR_ERR(rt1016->regmap);
655 regmap_read(rt1016->regmap, RT1016_DEVICE_ID, &val);
658 "Device with ID register %x is not rt1016\n", val);
662 regmap_write(rt1016->regmap, RT1016_RESET, 0);
664 ret = regmap_register_patch(rt1016->regmap, rt1016_patch,
676 struct rt1016_priv *rt1016 = i2c_get_clientdata(client);
678 regmap_write(rt1016->regmap, RT1016_RESET, 0);
683 .name = "rt1016",