Lines Matching full:max98520

19 #include "max98520.h"
75 struct max98520_priv *max98520 = in max98520_dai_set_fmt() local
93 regmap_update_bits(max98520->regmap, in max98520_dai_set_fmt()
116 regmap_update_bits(max98520->regmap, in max98520_dai_set_fmt()
143 struct max98520_priv *max98520 = in max98520_set_clock() local
146 int blr_clk_ratio = params_channels(params) * max98520->ch_size; in max98520_set_clock()
149 if (!max98520->tdm_mode) { in max98520_set_clock()
158 regmap_update_bits(max98520->regmap, in max98520_set_clock()
163 dev_dbg(component->dev, "%s tdm_mode:%d out\n", __func__, max98520->tdm_mode); in max98520_set_clock()
172 struct max98520_priv *max98520 = in max98520_dai_hw_params() local
194 max98520->ch_size = snd_pcm_format_width(params_format(params)); in max98520_dai_hw_params()
196 regmap_update_bits(max98520->regmap, in max98520_dai_hw_params()
253 regmap_update_bits(max98520->regmap, in max98520_dai_hw_params()
269 struct max98520_priv *max98520 = in max98520_dai_tdm_slot() local
275 max98520->tdm_mode = false; in max98520_dai_tdm_slot()
277 max98520->tdm_mode = true; in max98520_dai_tdm_slot()
287 regmap_update_bits(max98520->regmap, in max98520_dai_tdm_slot()
309 regmap_update_bits(max98520->regmap, in max98520_dai_tdm_slot()
314 regmap_update_bits(max98520->regmap, in max98520_dai_tdm_slot()
318 regmap_update_bits(max98520->regmap, in max98520_dai_tdm_slot()
342 struct max98520_priv *max98520 = in max98520_dac_event() local
349 regmap_write(max98520->regmap, MAX98520_R209F_AMP_EN, 1); in max98520_dac_event()
350 regmap_write(max98520->regmap, MAX98520_R210F_GLOBAL_EN, 1); in max98520_dac_event()
356 regmap_write(max98520->regmap, MAX98520_R210F_GLOBAL_EN, 0); in max98520_dac_event()
357 regmap_write(max98520->regmap, MAX98520_R209F_AMP_EN, 0); in max98520_dac_event()
584 .name = "max98520-aif1",
599 struct max98520_priv *max98520 = in max98520_probe() local
603 regmap_write(max98520->regmap, MAX98520_R2000_SW_RESET, 1); in max98520_probe()
606 regmap_write(max98520->regmap, MAX98520_R2043_PCM_RX_SRC1, 0x2); in max98520_probe()
610 regmap_write(max98520->regmap, MAX98520_R2044_PCM_RX_SRC2, 0x10); in max98520_probe()
613 regmap_update_bits(max98520->regmap, MAX98520_R2092_AMP_DSP_CFG, 1, 1); in max98520_probe()
615 regmap_write(max98520->regmap, MAX98520_R2030_CLK_MON_CTRL, 0x1); in max98520_probe()
618 regmap_update_bits(max98520->regmap, in max98520_probe()
628 struct max98520_priv *max98520 = dev_get_drvdata(dev); in max98520_suspend() local
630 regcache_cache_only(max98520->regmap, true); in max98520_suspend()
631 regcache_mark_dirty(max98520->regmap); in max98520_suspend()
637 struct max98520_priv *max98520 = dev_get_drvdata(dev); in max98520_resume() local
639 regcache_cache_only(max98520->regmap, false); in max98520_resume()
640 regmap_write(max98520->regmap, MAX98520_R2000_SW_RESET, 1); in max98520_resume()
641 regcache_sync(max98520->regmap); in max98520_resume()
673 static void max98520_power_on(struct max98520_priv *max98520, bool poweron) in max98520_power_on() argument
675 if (max98520->reset_gpio) in max98520_power_on()
676 gpiod_set_value_cansleep(max98520->reset_gpio, !poweron); in max98520_power_on()
683 struct max98520_priv *max98520; in max98520_i2c_probe() local
692 max98520 = devm_kzalloc(&i2c->dev, sizeof(*max98520), GFP_KERNEL); in max98520_i2c_probe()
694 if (!max98520) in max98520_i2c_probe()
697 i2c_set_clientdata(i2c, max98520); in max98520_i2c_probe()
700 max98520->regmap = devm_regmap_init_i2c(i2c, &max98520_regmap); in max98520_i2c_probe()
701 if (IS_ERR(max98520->regmap)) { in max98520_i2c_probe()
702 ret = PTR_ERR(max98520->regmap); in max98520_i2c_probe()
708 max98520->reset_gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH); in max98520_i2c_probe()
709 if (max98520->reset_gpio) { in max98520_i2c_probe()
710 if (IS_ERR(max98520->reset_gpio)) { in max98520_i2c_probe()
711 ret = PTR_ERR(max98520->reset_gpio); in max98520_i2c_probe()
716 max98520_power_on(max98520, 1); in max98520_i2c_probe()
720 ret = regmap_read(max98520->regmap, MAX98520_R21FF_REVISION_ID, &reg); in max98520_i2c_probe()
726 dev_info(&i2c->dev, "MAX98520 revisionID: 0x%02X\n", reg); in max98520_i2c_probe()
739 { "max98520", 0},
747 { .compatible = "maxim,max98520", },
755 .name = "max98520",
765 MODULE_DESCRIPTION("ALSA SoC MAX98520 driver");