Lines Matching refs:cs4271
197 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_set_dai_sysclk() local
199 cs4271->mclk = freq; in cs4271_set_dai_sysclk()
207 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_set_dai_fmt() local
213 cs4271->master = false; in cs4271_set_dai_fmt()
216 cs4271->master = true; in cs4271_set_dai_fmt()
227 ret = regmap_update_bits(cs4271->regmap, CS4271_ADCCTL, in cs4271_set_dai_fmt()
234 ret = regmap_update_bits(cs4271->regmap, CS4271_ADCCTL, in cs4271_set_dai_fmt()
244 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE1, in cs4271_set_dai_fmt()
255 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_set_deemph() local
259 if (cs4271->deemph) { in cs4271_set_deemph()
263 if (abs(cs4271_deemph[i] - cs4271->rate) < in cs4271_set_deemph()
264 abs(cs4271_deemph[val] - cs4271->rate)) in cs4271_set_deemph()
269 ret = regmap_update_bits(cs4271->regmap, CS4271_DACCTL, in cs4271_set_deemph()
280 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_get_deemph() local
282 ucontrol->value.integer.value[0] = cs4271->deemph; in cs4271_get_deemph()
290 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_put_deemph() local
292 cs4271->deemph = ucontrol->value.integer.value[0]; in cs4271_put_deemph()
340 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_hw_params() local
344 if (cs4271->enable_soft_reset) { in cs4271_hw_params()
358 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, in cs4271_hw_params()
364 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, in cs4271_hw_params()
371 cs4271->rate = params_rate(params); in cs4271_hw_params()
374 if (cs4271->rate < 50000) in cs4271_hw_params()
376 else if (cs4271->rate < 100000) in cs4271_hw_params()
381 ratio = cs4271->mclk / cs4271->rate; in cs4271_hw_params()
383 if ((cs4271_clk_tab[i].master == cs4271->master) && in cs4271_hw_params()
395 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE1, in cs4271_hw_params()
406 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_mute_stream() local
419 ret = regmap_update_bits(cs4271->regmap, CS4271_VOLA, in cs4271_mute_stream()
424 ret = regmap_update_bits(cs4271->regmap, CS4271_VOLB, in cs4271_mute_stream()
485 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_reset() local
487 gpiod_direction_output(cs4271->reset, 1); in cs4271_reset()
489 gpiod_set_value(cs4271->reset, 0); in cs4271_reset()
499 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_soc_suspend() local
502 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, in cs4271_soc_suspend()
507 regcache_mark_dirty(cs4271->regmap); in cs4271_soc_suspend()
508 regulator_bulk_disable(ARRAY_SIZE(cs4271->supplies), cs4271->supplies); in cs4271_soc_suspend()
516 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_soc_resume() local
518 ret = regulator_bulk_enable(ARRAY_SIZE(cs4271->supplies), in cs4271_soc_resume()
519 cs4271->supplies); in cs4271_soc_resume()
529 ret = regcache_sync(cs4271->regmap); in cs4271_soc_resume()
534 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, in cs4271_soc_resume()
557 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_component_probe() local
564 cs4271->enable_soft_reset = of_property_read_bool(component->dev->of_node, in cs4271_component_probe()
567 ret = regulator_bulk_enable(ARRAY_SIZE(cs4271->supplies), in cs4271_component_probe()
568 cs4271->supplies); in cs4271_component_probe()
576 cs4271->enable_soft_reset = cs4271plat->enable_soft_reset; in cs4271_component_probe()
582 ret = regcache_sync(cs4271->regmap); in cs4271_component_probe()
586 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, in cs4271_component_probe()
591 ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, in cs4271_component_probe()
599 regmap_update_bits(cs4271->regmap, CS4271_MODE2, in cs4271_component_probe()
608 struct cs4271_private *cs4271 = snd_soc_component_get_drvdata(component); in cs4271_component_remove() local
611 gpiod_set_value(cs4271->reset, 1); in cs4271_component_remove()
613 regcache_mark_dirty(cs4271->regmap); in cs4271_component_remove()
614 regulator_bulk_disable(ARRAY_SIZE(cs4271->supplies), cs4271->supplies); in cs4271_component_remove()
636 struct cs4271_private *cs4271; in cs4271_common_probe() local
639 cs4271 = devm_kzalloc(dev, sizeof(*cs4271), GFP_KERNEL); in cs4271_common_probe()
640 if (!cs4271) in cs4271_common_probe()
643 cs4271->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS); in cs4271_common_probe()
644 if (IS_ERR(cs4271->reset)) in cs4271_common_probe()
645 return dev_err_probe(dev, PTR_ERR(cs4271->reset), in cs4271_common_probe()
647 gpiod_set_consumer_name(cs4271->reset, "CS4271 Reset"); in cs4271_common_probe()
650 cs4271->supplies[i].supply = supply_names[i]; in cs4271_common_probe()
652 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(cs4271->supplies), in cs4271_common_probe()
653 cs4271->supplies); in cs4271_common_probe()
660 *c = cs4271; in cs4271_common_probe()
677 struct cs4271_private *cs4271; in cs4271_probe() local
683 ret = cs4271_common_probe(dev, &cs4271); in cs4271_probe()
687 dev_set_drvdata(dev, cs4271); in cs4271_probe()
688 cs4271->regmap = regmap; in cs4271_probe()