Lines Matching refs:ak4458

191 	struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);  in get_digfil()  local
193 ucontrol->value.enumerated.item[0] = ak4458->digfil; in get_digfil()
202 struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); in set_digfil() local
209 ak4458->digfil = num; in set_digfil()
214 ((ak4458->digfil & 0x02) << 4)); in set_digfil()
219 (ak4458->digfil & 0x01)); in set_digfil()
224 ((ak4458->digfil & 0x04) >> 2)); in set_digfil()
334 struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); in ak4458_hw_params() local
335 int pcm_width = max(params_physical_width(params), ak4458->slot_width); in ak4458_hw_params()
340 ak4458->fs = nfs1; in ak4458_hw_params()
364 if (ak4458->drvdata->type == AK4497) { in ak4458_hw_params()
389 if (ak4458->fmt == SND_SOC_DAIFMT_I2S) in ak4458_hw_params()
395 switch (ak4458->fmt) { in ak4458_hw_params()
431 struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); in ak4458_set_dai_fmt() local
450 ak4458->fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK; in ak4458_set_dai_fmt()
461 ak4458->fmt == SND_SOC_DAIFMT_PDM ? in ak4458_set_dai_fmt()
475 struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); in ak4458_set_dai_mute() local
479 nfs = ak4458->fs; in ak4458_set_dai_mute()
489 if (ak4458->mute_gpiod) in ak4458_set_dai_mute()
490 gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); in ak4458_set_dai_mute()
492 if (ak4458->mute_gpiod) in ak4458_set_dai_mute()
493 gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); in ak4458_set_dai_mute()
505 struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); in ak4458_set_tdm_slot() local
508 ak4458->slots = slots; in ak4458_set_tdm_slot()
509 ak4458->slot_width = slot_width; in ak4458_set_tdm_slot()
598 static void ak4458_reset(struct ak4458_priv *ak4458, bool active) in ak4458_reset() argument
600 if (ak4458->reset_gpiod) { in ak4458_reset()
601 gpiod_set_value_cansleep(ak4458->reset_gpiod, active); in ak4458_reset()
608 struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); in ak4458_init() local
612 if (ak4458->mute_gpiod) in ak4458_init()
613 gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); in ak4458_init()
615 ak4458_reset(ak4458, false); in ak4458_init()
622 if (ak4458->drvdata->type == AK4497) { in ak4458_init()
624 0x4, (ak4458->dsd_path << 2)); in ak4458_init()
634 struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); in ak4458_probe() local
636 ak4458->fs = 48000; in ak4458_probe()
643 struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component); in ak4458_remove() local
645 ak4458_reset(ak4458, true); in ak4458_remove()
651 struct ak4458_priv *ak4458 = dev_get_drvdata(dev); in ak4458_runtime_suspend() local
653 regcache_cache_only(ak4458->regmap, true); in ak4458_runtime_suspend()
655 ak4458_reset(ak4458, true); in ak4458_runtime_suspend()
657 if (ak4458->mute_gpiod) in ak4458_runtime_suspend()
658 gpiod_set_value_cansleep(ak4458->mute_gpiod, 0); in ak4458_runtime_suspend()
660 regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), in ak4458_runtime_suspend()
661 ak4458->supplies); in ak4458_runtime_suspend()
667 struct ak4458_priv *ak4458 = dev_get_drvdata(dev); in ak4458_runtime_resume() local
670 ret = regulator_bulk_enable(ARRAY_SIZE(ak4458->supplies), in ak4458_runtime_resume()
671 ak4458->supplies); in ak4458_runtime_resume()
673 dev_err(ak4458->dev, "Failed to enable supplies: %d\n", ret); in ak4458_runtime_resume()
677 if (ak4458->mute_gpiod) in ak4458_runtime_resume()
678 gpiod_set_value_cansleep(ak4458->mute_gpiod, 1); in ak4458_runtime_resume()
680 ak4458_reset(ak4458, true); in ak4458_runtime_resume()
681 ak4458_reset(ak4458, false); in ak4458_runtime_resume()
683 regcache_cache_only(ak4458->regmap, false); in ak4458_runtime_resume()
684 regcache_mark_dirty(ak4458->regmap); in ak4458_runtime_resume()
686 return regcache_sync(ak4458->regmap); in ak4458_runtime_resume()
750 struct ak4458_priv *ak4458; in ak4458_i2c_probe() local
753 ak4458 = devm_kzalloc(&i2c->dev, sizeof(*ak4458), GFP_KERNEL); in ak4458_i2c_probe()
754 if (!ak4458) in ak4458_i2c_probe()
757 ak4458->regmap = devm_regmap_init_i2c(i2c, &ak4458_regmap); in ak4458_i2c_probe()
758 if (IS_ERR(ak4458->regmap)) in ak4458_i2c_probe()
759 return PTR_ERR(ak4458->regmap); in ak4458_i2c_probe()
761 i2c_set_clientdata(i2c, ak4458); in ak4458_i2c_probe()
762 ak4458->dev = &i2c->dev; in ak4458_i2c_probe()
764 ak4458->drvdata = of_device_get_match_data(&i2c->dev); in ak4458_i2c_probe()
766 ak4458->reset_gpiod = devm_gpiod_get_optional(ak4458->dev, "reset", in ak4458_i2c_probe()
768 if (IS_ERR(ak4458->reset_gpiod)) in ak4458_i2c_probe()
769 return PTR_ERR(ak4458->reset_gpiod); in ak4458_i2c_probe()
771 ak4458->mute_gpiod = devm_gpiod_get_optional(ak4458->dev, "mute", in ak4458_i2c_probe()
773 if (IS_ERR(ak4458->mute_gpiod)) in ak4458_i2c_probe()
774 return PTR_ERR(ak4458->mute_gpiod); in ak4458_i2c_probe()
777 of_property_read_u32(i2c->dev.of_node, "dsd-path", &ak4458->dsd_path); in ak4458_i2c_probe()
779 for (i = 0; i < ARRAY_SIZE(ak4458->supplies); i++) in ak4458_i2c_probe()
780 ak4458->supplies[i].supply = ak4458_supply_names[i]; in ak4458_i2c_probe()
782 ret = devm_regulator_bulk_get(ak4458->dev, ARRAY_SIZE(ak4458->supplies), in ak4458_i2c_probe()
783 ak4458->supplies); in ak4458_i2c_probe()
785 dev_err(ak4458->dev, "Failed to request supplies: %d\n", ret); in ak4458_i2c_probe()
789 ret = devm_snd_soc_register_component(ak4458->dev, in ak4458_i2c_probe()
790 ak4458->drvdata->comp_drv, in ak4458_i2c_probe()
791 ak4458->drvdata->dai_drv, 1); in ak4458_i2c_probe()
793 dev_err(ak4458->dev, "Failed to register CODEC: %d\n", ret); in ak4458_i2c_probe()
798 regcache_cache_only(ak4458->regmap, true); in ak4458_i2c_probe()