Lines Matching refs:tscs454

125 struct tscs454 {  struct
277 static inline int tscs454_data_init(struct tscs454 *tscs454, in tscs454_data_init() argument
283 tscs454->regmap = devm_regmap_init_i2c(i2c, &tscs454_regmap_cfg); in tscs454_data_init()
284 if (IS_ERR(tscs454->regmap)) { in tscs454_data_init()
285 ret = PTR_ERR(tscs454->regmap); in tscs454_data_init()
290 aif_init(&tscs454->aifs[i], i); in tscs454_data_init()
292 mutex_init(&tscs454->aifs_status_lock); in tscs454_data_init()
293 pll_init(&tscs454->pll1, 1); in tscs454_data_init()
294 pll_init(&tscs454->pll2, 2); in tscs454_data_init()
296 coeff_ram_init(&tscs454->dac_ram); in tscs454_data_init()
297 coeff_ram_init(&tscs454->spk_ram); in tscs454_data_init()
298 coeff_ram_init(&tscs454->sub_ram); in tscs454_data_init()
313 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in coeff_ram_get() local
321 coeff_ram = tscs454->dac_ram.cache; in coeff_ram_get()
322 coeff_ram_lock = &tscs454->dac_ram.lock; in coeff_ram_get()
324 coeff_ram = tscs454->spk_ram.cache; in coeff_ram_get()
325 coeff_ram_lock = &tscs454->spk_ram.lock; in coeff_ram_get()
327 coeff_ram = tscs454->sub_ram.cache; in coeff_ram_get()
328 coeff_ram_lock = &tscs454->sub_ram.lock; in coeff_ram_get()
348 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in write_coeff_ram() local
374 ret = regmap_write(tscs454->regmap, r_addr, coeff_addr); in write_coeff_ram()
381 ret = regmap_bulk_write(tscs454->regmap, r_wr, in write_coeff_ram()
399 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in coeff_ram_put() local
414 coeff_ram = tscs454->dac_ram.cache; in coeff_ram_put()
415 coeff_ram_lock = &tscs454->dac_ram.lock; in coeff_ram_put()
416 coeff_ram_synced = &tscs454->dac_ram.synced; in coeff_ram_put()
421 coeff_ram = tscs454->spk_ram.cache; in coeff_ram_put()
422 coeff_ram_lock = &tscs454->spk_ram.lock; in coeff_ram_put()
423 coeff_ram_synced = &tscs454->spk_ram.synced; in coeff_ram_put()
428 coeff_ram = tscs454->sub_ram.cache; in coeff_ram_put()
429 coeff_ram_lock = &tscs454->sub_ram.lock; in coeff_ram_put()
430 coeff_ram_synced = &tscs454->sub_ram.synced; in coeff_ram_put()
445 mutex_lock(&tscs454->pll1.lock); in coeff_ram_put()
446 mutex_lock(&tscs454->pll2.lock); in coeff_ram_put()
468 mutex_unlock(&tscs454->pll2.lock); in coeff_ram_put()
469 mutex_unlock(&tscs454->pll1.lock); in coeff_ram_put()
476 struct tscs454 *tscs454) in coeff_ram_sync() argument
480 mutex_lock(&tscs454->dac_ram.lock); in coeff_ram_sync()
481 if (!tscs454->dac_ram.synced) { in coeff_ram_sync()
482 ret = write_coeff_ram(component, tscs454->dac_ram.cache, in coeff_ram_sync()
486 mutex_unlock(&tscs454->dac_ram.lock); in coeff_ram_sync()
490 mutex_unlock(&tscs454->dac_ram.lock); in coeff_ram_sync()
492 mutex_lock(&tscs454->spk_ram.lock); in coeff_ram_sync()
493 if (!tscs454->spk_ram.synced) { in coeff_ram_sync()
494 ret = write_coeff_ram(component, tscs454->spk_ram.cache, in coeff_ram_sync()
498 mutex_unlock(&tscs454->spk_ram.lock); in coeff_ram_sync()
502 mutex_unlock(&tscs454->spk_ram.lock); in coeff_ram_sync()
504 mutex_lock(&tscs454->sub_ram.lock); in coeff_ram_sync()
505 if (!tscs454->sub_ram.synced) { in coeff_ram_sync()
506 ret = write_coeff_ram(component, tscs454->sub_ram.cache, in coeff_ram_sync()
510 mutex_unlock(&tscs454->sub_ram.lock); in coeff_ram_sync()
514 mutex_unlock(&tscs454->sub_ram.lock); in coeff_ram_sync()
638 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in set_sysclk() local
644 if (tscs454->sysclk_src_id < PLL_INPUT_BCLK) in set_sysclk()
645 freq = clk_get_rate(tscs454->sysclk); in set_sysclk()
647 freq = tscs454->bclk_freq; in set_sysclk()
690 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in pll_connected() local
694 mutex_lock(&tscs454->pll1.lock); in pll_connected()
695 users = tscs454->pll1.users; in pll_connected()
696 mutex_unlock(&tscs454->pll1.lock); in pll_connected()
700 mutex_lock(&tscs454->pll2.lock); in pll_connected()
701 users = tscs454->pll2.users; in pll_connected()
702 mutex_unlock(&tscs454->pll2.lock); in pll_connected()
719 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in pll_power_event() local
754 ret = coeff_ram_sync(component, tscs454); in pll_power_event()
816 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in aif_free() local
818 mutex_lock(&tscs454->aifs_status_lock); in aif_free()
822 set_aif_status_inactive(&tscs454->aifs_status, aif->id, playback); in aif_free()
825 aif->id, tscs454->aifs_status.streams); in aif_free()
827 if (!aif_active(&tscs454->aifs_status, aif->id)) { in aif_free()
835 if (!aifs_active(&tscs454->aifs_status)) { in aif_free()
837 tscs454->internal_rate.pll->id); in aif_free()
838 free_pll(tscs454->internal_rate.pll); in aif_free()
841 mutex_unlock(&tscs454->aifs_status_lock); in aif_free()
2643 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_set_sysclk() local
2658 tscs454->bclk_freq = freq; in tscs454_set_sysclk()
2896 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_set_dai_fmt() local
2897 struct aif *aif = &tscs454->aifs[dai->id]; in tscs454_set_dai_fmt()
3184 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_hw_params() local
3186 struct aif *aif = &tscs454->aifs[dai->id]; in tscs454_hw_params()
3190 mutex_lock(&tscs454->aifs_status_lock); in tscs454_hw_params()
3195 if (!aif_active(&tscs454->aifs_status, aif->id)) { in tscs454_hw_params()
3197 aif->pll = &tscs454->pll1; in tscs454_hw_params()
3199 aif->pll = &tscs454->pll2; in tscs454_hw_params()
3207 if (!aifs_active(&tscs454->aifs_status)) { /* First active aif */ in tscs454_hw_params()
3213 tscs454->internal_rate.pll = &tscs454->pll1; in tscs454_hw_params()
3215 tscs454->internal_rate.pll = &tscs454->pll2; in tscs454_hw_params()
3218 tscs454->internal_rate.pll->id); in tscs454_hw_params()
3220 reserve_pll(tscs454->internal_rate.pll); in tscs454_hw_params()
3236 set_aif_status_active(&tscs454->aifs_status, aif->id, in tscs454_hw_params()
3240 aif->id, tscs454->aifs_status.streams); in tscs454_hw_params()
3244 mutex_unlock(&tscs454->aifs_status_lock); in tscs454_hw_params()
3253 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_hw_free() local
3254 struct aif *aif = &tscs454->aifs[dai->id]; in tscs454_hw_free()
3265 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_prepare() local
3266 struct aif *aif = &tscs454->aifs[dai->id]; in tscs454_prepare()
3297 struct tscs454 *tscs454 = snd_soc_component_get_drvdata(component); in tscs454_probe() local
3301 switch (tscs454->sysclk_src_id) { in tscs454_probe()
3327 if (tscs454->sysclk_src_id < PLL_INPUT_BCLK) in tscs454_probe()
3418 struct tscs454 *tscs454; in tscs454_i2c_probe() local
3422 tscs454 = devm_kzalloc(&i2c->dev, sizeof(*tscs454), GFP_KERNEL); in tscs454_i2c_probe()
3423 if (!tscs454) in tscs454_i2c_probe()
3426 ret = tscs454_data_init(tscs454, i2c); in tscs454_i2c_probe()
3430 i2c_set_clientdata(i2c, tscs454); in tscs454_i2c_probe()
3433 tscs454->sysclk = devm_clk_get(&i2c->dev, src_names[src]); in tscs454_i2c_probe()
3434 if (!IS_ERR(tscs454->sysclk)) { in tscs454_i2c_probe()
3436 } else if (PTR_ERR(tscs454->sysclk) != -ENOENT) { in tscs454_i2c_probe()
3437 ret = PTR_ERR(tscs454->sysclk); in tscs454_i2c_probe()
3443 tscs454->sysclk_src_id = src; in tscs454_i2c_probe()
3445 ret = regmap_write(tscs454->regmap, in tscs454_i2c_probe()
3451 regcache_mark_dirty(tscs454->regmap); in tscs454_i2c_probe()
3453 ret = regmap_register_patch(tscs454->regmap, tscs454_patch, in tscs454_i2c_probe()
3460 regmap_write(tscs454->regmap, R_PAGESEL, 0x00); in tscs454_i2c_probe()