Lines Matching full:max98520

17 #include "max98520.h"
73 struct max98520_priv *max98520 = in max98520_dai_set_fmt() local
91 regmap_update_bits(max98520->regmap, in max98520_dai_set_fmt()
114 regmap_update_bits(max98520->regmap, in max98520_dai_set_fmt()
141 struct max98520_priv *max98520 = in max98520_set_clock() local
144 int blr_clk_ratio = params_channels(params) * max98520->ch_size; in max98520_set_clock()
147 if (!max98520->tdm_mode) { in max98520_set_clock()
156 regmap_update_bits(max98520->regmap, in max98520_set_clock()
161 dev_dbg(component->dev, "%s tdm_mode:%d out\n", __func__, max98520->tdm_mode); in max98520_set_clock()
170 struct max98520_priv *max98520 = in max98520_dai_hw_params() local
192 max98520->ch_size = snd_pcm_format_width(params_format(params)); in max98520_dai_hw_params()
194 regmap_update_bits(max98520->regmap, in max98520_dai_hw_params()
251 regmap_update_bits(max98520->regmap, in max98520_dai_hw_params()
267 struct max98520_priv *max98520 = in max98520_dai_tdm_slot() local
273 max98520->tdm_mode = false; in max98520_dai_tdm_slot()
275 max98520->tdm_mode = true; in max98520_dai_tdm_slot()
285 regmap_update_bits(max98520->regmap, in max98520_dai_tdm_slot()
307 regmap_update_bits(max98520->regmap, in max98520_dai_tdm_slot()
312 regmap_update_bits(max98520->regmap, in max98520_dai_tdm_slot()
316 regmap_update_bits(max98520->regmap, in max98520_dai_tdm_slot()
340 struct max98520_priv *max98520 = in max98520_dac_event() local
347 regmap_write(max98520->regmap, MAX98520_R209F_AMP_EN, 1); in max98520_dac_event()
348 regmap_write(max98520->regmap, MAX98520_R210F_GLOBAL_EN, 1); in max98520_dac_event()
354 regmap_write(max98520->regmap, MAX98520_R210F_GLOBAL_EN, 0); in max98520_dac_event()
355 regmap_write(max98520->regmap, MAX98520_R209F_AMP_EN, 0); in max98520_dac_event()
582 .name = "max98520-aif1",
597 struct max98520_priv *max98520 = in max98520_probe() local
601 regmap_write(max98520->regmap, MAX98520_R2000_SW_RESET, 1); in max98520_probe()
604 regmap_write(max98520->regmap, MAX98520_R2043_PCM_RX_SRC1, 0x2); in max98520_probe()
608 regmap_write(max98520->regmap, MAX98520_R2044_PCM_RX_SRC2, 0x10); in max98520_probe()
611 regmap_update_bits(max98520->regmap, MAX98520_R2092_AMP_DSP_CFG, 1, 1); in max98520_probe()
613 regmap_write(max98520->regmap, MAX98520_R2030_CLK_MON_CTRL, 0x1); in max98520_probe()
616 regmap_update_bits(max98520->regmap, in max98520_probe()
626 struct max98520_priv *max98520 = dev_get_drvdata(dev); in max98520_suspend() local
628 regcache_cache_only(max98520->regmap, true); in max98520_suspend()
629 regcache_mark_dirty(max98520->regmap); in max98520_suspend()
635 struct max98520_priv *max98520 = dev_get_drvdata(dev); in max98520_resume() local
637 regcache_cache_only(max98520->regmap, false); in max98520_resume()
638 regmap_write(max98520->regmap, MAX98520_R2000_SW_RESET, 1); in max98520_resume()
639 regcache_sync(max98520->regmap); in max98520_resume()
671 static void max98520_power_on(struct max98520_priv *max98520, bool poweron) in max98520_power_on() argument
673 if (max98520->reset_gpio) in max98520_power_on()
674 gpiod_set_value_cansleep(max98520->reset_gpio, !poweron); in max98520_power_on()
681 struct max98520_priv *max98520; in max98520_i2c_probe() local
690 max98520 = devm_kzalloc(&i2c->dev, sizeof(*max98520), GFP_KERNEL); in max98520_i2c_probe()
692 if (!max98520) in max98520_i2c_probe()
695 i2c_set_clientdata(i2c, max98520); in max98520_i2c_probe()
698 max98520->regmap = devm_regmap_init_i2c(i2c, &max98520_regmap); in max98520_i2c_probe()
699 if (IS_ERR(max98520->regmap)) { in max98520_i2c_probe()
700 ret = PTR_ERR(max98520->regmap); in max98520_i2c_probe()
706 max98520->reset_gpio = devm_gpiod_get_optional(&i2c->dev, "reset", GPIOD_OUT_HIGH); in max98520_i2c_probe()
707 if (max98520->reset_gpio) { in max98520_i2c_probe()
708 if (IS_ERR(max98520->reset_gpio)) { in max98520_i2c_probe()
709 ret = PTR_ERR(max98520->reset_gpio); in max98520_i2c_probe()
714 max98520_power_on(max98520, 1); in max98520_i2c_probe()
718 ret = regmap_read(max98520->regmap, MAX98520_R21FF_REVISION_ID, &reg); in max98520_i2c_probe()
724 dev_info(&i2c->dev, "MAX98520 revisionID: 0x%02X\n", reg); in max98520_i2c_probe()
737 { "max98520"},
745 { .compatible = "maxim,max98520", },
753 .name = "max98520",
763 MODULE_DESCRIPTION("ALSA SoC MAX98520 driver");