Lines Matching refs:ak5558
137 struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); in ak5558_hw_params() local
139 int pcm_width = max(params_physical_width(params), ak5558->slot_width); in ak5558_hw_params()
199 struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); in ak5558_set_tdm_slot() local
202 ak5558->slots = slots; in ak5558_set_tdm_slot()
203 ak5558->slot_width = slot_width; in ak5558_set_tdm_slot()
270 static void ak5558_power_off(struct ak5558_priv *ak5558) in ak5558_power_off() argument
272 if (!ak5558->reset_gpiod) in ak5558_power_off()
275 gpiod_set_value_cansleep(ak5558->reset_gpiod, 1); in ak5558_power_off()
279 static void ak5558_power_on(struct ak5558_priv *ak5558) in ak5558_power_on() argument
281 if (!ak5558->reset_gpiod) in ak5558_power_on()
284 gpiod_set_value_cansleep(ak5558->reset_gpiod, 0); in ak5558_power_on()
290 struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); in ak5558_probe() local
292 ak5558_power_on(ak5558); in ak5558_probe()
298 struct ak5558_priv *ak5558 = snd_soc_component_get_drvdata(component); in ak5558_remove() local
300 ak5558_power_off(ak5558); in ak5558_remove()
305 struct ak5558_priv *ak5558 = dev_get_drvdata(dev); in ak5558_runtime_suspend() local
307 regcache_cache_only(ak5558->regmap, true); in ak5558_runtime_suspend()
308 ak5558_power_off(ak5558); in ak5558_runtime_suspend()
310 regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), in ak5558_runtime_suspend()
311 ak5558->supplies); in ak5558_runtime_suspend()
317 struct ak5558_priv *ak5558 = dev_get_drvdata(dev); in ak5558_runtime_resume() local
320 ret = regulator_bulk_enable(ARRAY_SIZE(ak5558->supplies), in ak5558_runtime_resume()
321 ak5558->supplies); in ak5558_runtime_resume()
327 ak5558_power_off(ak5558); in ak5558_runtime_resume()
328 ak5558_power_on(ak5558); in ak5558_runtime_resume()
330 regcache_cache_only(ak5558->regmap, false); in ak5558_runtime_resume()
331 regcache_mark_dirty(ak5558->regmap); in ak5558_runtime_resume()
333 return regcache_sync(ak5558->regmap); in ak5558_runtime_resume()
369 struct ak5558_priv *ak5558; in ak5558_i2c_probe() local
373 ak5558 = devm_kzalloc(&i2c->dev, sizeof(*ak5558), GFP_KERNEL); in ak5558_i2c_probe()
374 if (!ak5558) in ak5558_i2c_probe()
377 ak5558->regmap = devm_regmap_init_i2c(i2c, &ak5558_regmap); in ak5558_i2c_probe()
378 if (IS_ERR(ak5558->regmap)) in ak5558_i2c_probe()
379 return PTR_ERR(ak5558->regmap); in ak5558_i2c_probe()
381 i2c_set_clientdata(i2c, ak5558); in ak5558_i2c_probe()
382 ak5558->i2c = i2c; in ak5558_i2c_probe()
384 ak5558->reset_gpiod = devm_gpiod_get_optional(&i2c->dev, "reset", in ak5558_i2c_probe()
386 if (IS_ERR(ak5558->reset_gpiod)) in ak5558_i2c_probe()
387 return PTR_ERR(ak5558->reset_gpiod); in ak5558_i2c_probe()
389 for (i = 0; i < ARRAY_SIZE(ak5558->supplies); i++) in ak5558_i2c_probe()
390 ak5558->supplies[i].supply = ak5558_supply_names[i]; in ak5558_i2c_probe()
392 ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(ak5558->supplies), in ak5558_i2c_probe()
393 ak5558->supplies); in ak5558_i2c_probe()
406 regcache_cache_only(ak5558->regmap, true); in ak5558_i2c_probe()