Lines Matching full:ak5558
3 // Audio driver for AK5558 ADC
25 #include "ak5558.h"
28 AK5558, enumerator
38 /* AK5558 Codec Private Data */
49 /* ak5558 register cache & default register settings */
176 struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); in ak5558_hw_params() local
178 int pcm_width = max(params_physical_width(params), ak5558->slot_width); in ak5558_hw_params()
238 struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); in ak5558_set_tdm_slot() local
241 ak5558->slots = slots; in ak5558_set_tdm_slot()
242 ak5558->slot_width = slot_width; in ak5558_set_tdm_slot()
298 .name = "ak5558-aif",
321 static void ak5558_reset(struct ak5558_priv *ak5558, bool active) in ak5558_reset() argument
323 if (!ak5558->reset_gpiod) in ak5558_reset()
326 gpiod_set_value_cansleep(ak5558->reset_gpiod, active); in ak5558_reset()
332 struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); in ak5558_probe() local
334 ak5558_reset(ak5558, false); in ak5558_probe()
340 struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); in ak5558_remove() local
342 ak5558_reset(ak5558, true); in ak5558_remove()
347 struct ak5558_priv *ak5558 = dev_get_drvdata(dev); in ak5558_runtime_suspend() local
349 regcache_cache_only(ak5558->regmap, true); in ak5558_runtime_suspend()
350 ak5558_reset(ak5558, true); in ak5558_runtime_suspend()
352 regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), in ak5558_runtime_suspend()
353 ak5558->supplies); in ak5558_runtime_suspend()
359 struct ak5558_priv *ak5558 = dev_get_drvdata(dev); in ak5558_runtime_resume() local
362 ret = regulator_bulk_enable(ARRAY_SIZE(ak5558->supplies), in ak5558_runtime_resume()
363 ak5558->supplies); in ak5558_runtime_resume()
369 ak5558_reset(ak5558, true); in ak5558_runtime_resume()
370 ak5558_reset(ak5558, false); in ak5558_runtime_resume()
372 regcache_cache_only(ak5558->regmap, false); in ak5558_runtime_resume()
373 regcache_mark_dirty(ak5558->regmap); in ak5558_runtime_resume()
375 return regcache_sync(ak5558->regmap); in ak5558_runtime_resume()
424 struct ak5558_priv *ak5558; in ak5558_i2c_probe() local
429 ak5558 = devm_kzalloc(&i2c->dev, sizeof(*ak5558), GFP_KERNEL); in ak5558_i2c_probe()
430 if (!ak5558) in ak5558_i2c_probe()
433 ak5558->regmap = devm_regmap_init_i2c(i2c, &ak5558_regmap); in ak5558_i2c_probe()
434 if (IS_ERR(ak5558->regmap)) in ak5558_i2c_probe()
435 return PTR_ERR(ak5558->regmap); in ak5558_i2c_probe()
437 i2c_set_clientdata(i2c, ak5558); in ak5558_i2c_probe()
438 ak5558->i2c = i2c; in ak5558_i2c_probe()
440 ak5558->reset_gpiod = devm_gpiod_get_optional(&i2c->dev, "reset", in ak5558_i2c_probe()
442 if (IS_ERR(ak5558->reset_gpiod)) in ak5558_i2c_probe()
443 return PTR_ERR(ak5558->reset_gpiod); in ak5558_i2c_probe()
445 for (i = 0; i < ARRAY_SIZE(ak5558->supplies); i++) in ak5558_i2c_probe()
446 ak5558->supplies[i].supply = ak5558_supply_names[i]; in ak5558_i2c_probe()
448 ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(ak5558->supplies), in ak5558_i2c_probe()
449 ak5558->supplies); in ak5558_i2c_probe()
462 case AK5558: in ak5558_i2c_probe()
477 regcache_cache_only(ak5558->regmap, true); in ak5558_i2c_probe()
488 { .compatible = "asahi-kasei,ak5558", .data = (void *) AK5558 },
496 .name = "ak5558",
508 MODULE_DESCRIPTION("ASoC AK5558 ADC driver");