Lines Matching refs:tas2552
141 static void tas2552_sw_shutdown(struct tas2552_data *tas2552, int sw_shutdown) in tas2552_sw_shutdown() argument
145 if (!tas2552->component) in tas2552_sw_shutdown()
151 snd_soc_component_update_bits(tas2552->component, TAS2552_CFG_1, TAS2552_SWS, in tas2552_sw_shutdown()
158 struct tas2552_data *tas2552 = dev_get_drvdata(component->dev); in tas2552_setup_pll() local
161 unsigned int pll_clkin = tas2552->pll_clkin; in tas2552_setup_pll()
165 if (tas2552->pll_clk_id != TAS2552_PLL_CLKIN_BCLK) in tas2552_setup_pll()
169 pll_clkin += tas2552->tdm_delay; in tas2552_setup_pll()
189 u8 pll_sel = (tas2552->pll_clk_id << 3) & TAS2552_PLL_SRC_MASK; in tas2552_setup_pll()
203 if (tas2552->pll_clk_id == TAS2552_PLL_CLKIN_BCLK) { in tas2552_setup_pll()
209 pll_clkin += tas2552->tdm_delay; in tas2552_setup_pll()
240 struct tas2552_data *tas2552 = dev_get_drvdata(component->dev); in tas2552_hw_params() local
247 cpf = 32 + tas2552->tdm_delay; in tas2552_hw_params()
251 cpf = 64 + tas2552->tdm_delay; in tas2552_hw_params()
255 cpf = 64 + tas2552->tdm_delay; in tas2552_hw_params()
259 cpf = 64 + tas2552->tdm_delay; in tas2552_hw_params()
329 struct tas2552_data *tas2552 = snd_soc_component_get_drvdata(component); in tas2552_prepare() local
333 if (tas2552->dai_fmt == SND_SOC_DAIFMT_DSP_A) in tas2552_prepare()
334 delay += (tas2552->tdm_delay + 1); in tas2552_prepare()
335 else if (tas2552->dai_fmt == SND_SOC_DAIFMT_DSP_B) in tas2552_prepare()
336 delay += tas2552->tdm_delay; in tas2552_prepare()
347 struct tas2552_data *tas2552 = dev_get_drvdata(component->dev); in tas2552_set_dai_fmt() local
386 tas2552->dai_fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK; in tas2552_set_dai_fmt()
397 struct tas2552_data *tas2552 = dev_get_drvdata(component->dev); in tas2552_set_dai_sysclk() local
416 tas2552->pll_clk_id = clk_id; in tas2552_set_dai_sysclk()
417 tas2552->pll_clkin = freq; in tas2552_set_dai_sysclk()
426 tas2552->pdm_clk_id = clk_id; in tas2552_set_dai_sysclk()
427 tas2552->pdm_clk = freq; in tas2552_set_dai_sysclk()
444 struct tas2552_data *tas2552 = snd_soc_component_get_drvdata(component); in tas2552_set_dai_tdm_slot() local
459 tas2552->tdm_delay = lsb * slot_width; in tas2552_set_dai_tdm_slot()
483 struct tas2552_data *tas2552 = dev_get_drvdata(dev); in tas2552_runtime_suspend() local
485 tas2552_sw_shutdown(tas2552, 1); in tas2552_runtime_suspend()
487 regcache_cache_only(tas2552->regmap, true); in tas2552_runtime_suspend()
488 regcache_mark_dirty(tas2552->regmap); in tas2552_runtime_suspend()
490 gpiod_set_value(tas2552->enable_gpio, 0); in tas2552_runtime_suspend()
497 struct tas2552_data *tas2552 = dev_get_drvdata(dev); in tas2552_runtime_resume() local
499 gpiod_set_value(tas2552->enable_gpio, 1); in tas2552_runtime_resume()
501 tas2552_sw_shutdown(tas2552, 0); in tas2552_runtime_resume()
503 regcache_cache_only(tas2552->regmap, false); in tas2552_runtime_resume()
504 regcache_sync(tas2552->regmap); in tas2552_runtime_resume()
572 struct tas2552_data *tas2552 = snd_soc_component_get_drvdata(component); in tas2552_component_probe() local
575 tas2552->component = component; in tas2552_component_probe()
577 ret = regulator_bulk_enable(ARRAY_SIZE(tas2552->supplies), in tas2552_component_probe()
578 tas2552->supplies); in tas2552_component_probe()
586 gpiod_set_value(tas2552->enable_gpio, 1); in tas2552_component_probe()
611 gpiod_set_value(tas2552->enable_gpio, 0); in tas2552_component_probe()
613 regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies), in tas2552_component_probe()
614 tas2552->supplies); in tas2552_component_probe()
620 struct tas2552_data *tas2552 = snd_soc_component_get_drvdata(component); in tas2552_component_remove() local
624 gpiod_set_value(tas2552->enable_gpio, 0); in tas2552_component_remove()
630 struct tas2552_data *tas2552 = snd_soc_component_get_drvdata(component); in tas2552_suspend() local
633 ret = regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies), in tas2552_suspend()
634 tas2552->supplies); in tas2552_suspend()
644 struct tas2552_data *tas2552 = snd_soc_component_get_drvdata(component); in tas2552_resume() local
647 ret = regulator_bulk_enable(ARRAY_SIZE(tas2552->supplies), in tas2552_resume()
648 tas2552->supplies); in tas2552_resume()