Lines Matching full:max98388
19 #include "max98388.h"
76 struct max98388_priv *max98388 = snd_soc_component_get_drvdata(component); in max98388_dac_event() local
80 regmap_write(max98388->regmap, in max98388_dac_event()
85 regmap_write(max98388->regmap, in max98388_dac_event()
88 max98388->tdm_mode = false; in max98388_dac_event()
389 static void max98388_reset(struct max98388_priv *max98388, struct device *dev) in max98388_reset() argument
394 ret = regmap_update_bits(max98388->regmap, in max98388_reset()
405 ret = regmap_read(max98388->regmap, in max98388_reset()
418 struct max98388_priv *max98388 = snd_soc_component_get_drvdata(component); in max98388_probe() local
421 max98388_reset(max98388, component->dev); in max98388_probe()
424 regmap_write(max98388->regmap, in max98388_probe()
429 regmap_write(max98388->regmap, in max98388_probe()
433 regmap_write(max98388->regmap, in max98388_probe()
437 regmap_write(max98388->regmap, in max98388_probe()
439 max98388->v_slot); in max98388_probe()
441 regmap_write(max98388->regmap, in max98388_probe()
443 max98388->i_slot); in max98388_probe()
445 regmap_write(max98388->regmap, in max98388_probe()
448 if (max98388->interleave_mode) in max98388_probe()
449 regmap_update_bits(max98388->regmap, in max98388_probe()
455 regmap_update_bits(max98388->regmap, in max98388_probe()
466 struct max98388_priv *max98388 = snd_soc_component_get_drvdata(component); in max98388_dai_set_fmt() local
483 regmap_update_bits(max98388->regmap, in max98388_dai_set_fmt()
506 regmap_update_bits(max98388->regmap, in max98388_dai_set_fmt()
533 struct max98388_priv *max98388 = snd_soc_component_get_drvdata(component); in max98388_set_clock() local
535 int blr_clk_ratio = params_channels(params) * max98388->ch_size; in max98388_set_clock()
538 if (!max98388->tdm_mode) { in max98388_set_clock()
547 regmap_update_bits(max98388->regmap, in max98388_set_clock()
560 struct max98388_priv *max98388 = snd_soc_component_get_drvdata(component); in max98388_dai_hw_params() local
583 max98388->ch_size = snd_pcm_format_width(params_format(params)); in max98388_dai_hw_params()
585 ret = regmap_read(max98388->regmap, in max98388_dai_hw_params()
592 ret = regmap_read(max98388->regmap, in max98388_dai_hw_params()
598 regmap_write(max98388->regmap, in max98388_dai_hw_params()
602 regmap_update_bits(max98388->regmap, in max98388_dai_hw_params()
651 regmap_update_bits(max98388->regmap, in max98388_dai_hw_params()
657 if (max98388->interleave_mode && in max98388_dai_hw_params()
659 regmap_update_bits(max98388->regmap, in max98388_dai_hw_params()
664 regmap_update_bits(max98388->regmap, in max98388_dai_hw_params()
672 regmap_write(max98388->regmap, in max98388_dai_hw_params()
691 struct max98388_priv *max98388 = snd_soc_component_get_drvdata(component); in max98388_dai_tdm_slot() local
699 max98388->tdm_mode = false; in max98388_dai_tdm_slot()
701 max98388->tdm_mode = true; in max98388_dai_tdm_slot()
711 regmap_update_bits(max98388->regmap, in max98388_dai_tdm_slot()
733 regmap_update_bits(max98388->regmap, in max98388_dai_tdm_slot()
743 regmap_update_bits(max98388->regmap, in max98388_dai_tdm_slot()
748 regmap_update_bits(max98388->regmap, in max98388_dai_tdm_slot()
765 regmap_update_bits(max98388->regmap, addr, bits, bits); in max98388_dai_tdm_slot()
835 .name = "max98388-aif1",
856 struct max98388_priv *max98388 = dev_get_drvdata(dev); in max98388_suspend() local
858 regcache_cache_only(max98388->regmap, true); in max98388_suspend()
859 regcache_mark_dirty(max98388->regmap); in max98388_suspend()
866 struct max98388_priv *max98388 = dev_get_drvdata(dev); in max98388_resume() local
868 regcache_cache_only(max98388->regmap, false); in max98388_resume()
869 max98388_reset(max98388, dev); in max98388_resume()
870 regcache_sync(max98388->regmap); in max98388_resume()
903 struct max98388_priv *max98388) in max98388_read_deveice_property() argument
908 max98388->v_slot = value & 0xF; in max98388_read_deveice_property()
910 max98388->v_slot = 0; in max98388_read_deveice_property()
913 max98388->i_slot = value & 0xF; in max98388_read_deveice_property()
915 max98388->i_slot = 1; in max98388_read_deveice_property()
918 max98388->interleave_mode = true; in max98388_read_deveice_property()
920 max98388->interleave_mode = false; in max98388_read_deveice_property()
928 struct max98388_priv *max98388 = NULL; in max98388_i2c_probe() local
930 max98388 = devm_kzalloc(&i2c->dev, sizeof(*max98388), GFP_KERNEL); in max98388_i2c_probe()
931 if (!max98388) in max98388_i2c_probe()
934 i2c_set_clientdata(i2c, max98388); in max98388_i2c_probe()
937 max98388->regmap = devm_regmap_init_i2c(i2c, &max98388_regmap); in max98388_i2c_probe()
938 if (IS_ERR(max98388->regmap)) in max98388_i2c_probe()
939 return dev_err_probe(&i2c->dev, PTR_ERR(max98388->regmap), in max98388_i2c_probe()
943 max98388_read_deveice_property(&i2c->dev, max98388); in max98388_i2c_probe()
946 max98388->reset_gpio = devm_gpiod_get_optional(&i2c->dev, in max98388_i2c_probe()
948 if (IS_ERR(max98388->reset_gpio)) in max98388_i2c_probe()
949 return dev_err_probe(&i2c->dev, PTR_ERR(max98388->reset_gpio), in max98388_i2c_probe()
952 if (max98388->reset_gpio) { in max98388_i2c_probe()
954 gpiod_set_value_cansleep(max98388->reset_gpio, 0); in max98388_i2c_probe()
960 ret = regmap_read(max98388->regmap, in max98388_i2c_probe()
966 dev_info(&i2c->dev, "MAX98388 revisionID: 0x%02X\n", reg); in max98388_i2c_probe()
980 { "max98388"},
987 { .compatible = "adi,max98388", },
1000 .name = "max98388",
1011 MODULE_DESCRIPTION("ALSA SoC MAX98388 driver");