Lines Matching full:sfc

3 // tegra210_sfc.c - Tegra210 SFC driver
51 /* coeff RAM tables required for SFC */
3061 struct tegra210_sfc *sfc = dev_get_drvdata(dev); in tegra210_sfc_runtime_suspend() local
3063 regcache_cache_only(sfc->regmap, true); in tegra210_sfc_runtime_suspend()
3064 regcache_mark_dirty(sfc->regmap); in tegra210_sfc_runtime_suspend()
3071 struct tegra210_sfc *sfc = dev_get_drvdata(dev); in tegra210_sfc_runtime_resume() local
3073 regcache_cache_only(sfc->regmap, false); in tegra210_sfc_runtime_resume()
3074 regcache_sync(sfc->regmap); in tegra210_sfc_runtime_resume()
3095 struct tegra210_sfc *sfc = dev_get_drvdata(cmpnt->dev); in tegra210_sfc_write_coeff_ram() local
3099 if (sfc->srate_in == sfc->srate_out) in tegra210_sfc_write_coeff_ram()
3102 coeff_ram = coef_addr_table[sfc->srate_in][sfc->srate_out]; in tegra210_sfc_write_coeff_ram()
3106 sfc->srate_in, sfc->srate_out); in tegra210_sfc_write_coeff_ram()
3111 tegra210_sfc_write_ram(sfc->regmap, coeff_ram); in tegra210_sfc_write_coeff_ram()
3113 regmap_update_bits(sfc->regmap, in tegra210_sfc_write_coeff_ram()
3121 static int tegra210_sfc_set_audio_cif(struct tegra210_sfc *sfc, in tegra210_sfc_set_audio_cif() argument
3153 cif_conf.stereo_conv = sfc->stereo_to_mono[path]; in tegra210_sfc_set_audio_cif()
3154 cif_conf.mono_conv = sfc->mono_to_stereo[path]; in tegra210_sfc_set_audio_cif()
3156 tegra_set_cif(sfc->regmap, reg, &cif_conf); in tegra210_sfc_set_audio_cif()
3161 static int tegra210_sfc_soft_reset(struct tegra210_sfc *sfc) in tegra210_sfc_soft_reset() argument
3171 regmap_update_bits(sfc->regmap, TEGRA210_SFC_SOFT_RESET, in tegra210_sfc_soft_reset()
3174 return regmap_read_poll_timeout(sfc->regmap, in tegra210_sfc_soft_reset()
3202 struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai); in tegra210_sfc_startup() local
3205 regmap_update_bits(sfc->regmap, TEGRA210_SFC_COEF_RAM, in tegra210_sfc_startup()
3208 err = tegra210_sfc_soft_reset(sfc); in tegra210_sfc_startup()
3210 dev_err(dai->dev, "Failed to reset SFC in %s, err = %d\n", in tegra210_sfc_startup()
3223 struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai); in tegra210_sfc_in_hw_params() local
3228 &sfc->srate_in); in tegra210_sfc_in_hw_params()
3232 err = tegra210_sfc_set_audio_cif(sfc, params, TEGRA210_SFC_RX_CIF_CTRL); in tegra210_sfc_in_hw_params()
3234 dev_err(dev, "Can't set SFC RX CIF: %d\n", err); in tegra210_sfc_in_hw_params()
3238 regmap_write(sfc->regmap, TEGRA210_SFC_RX_FREQ, sfc->srate_in); in tegra210_sfc_in_hw_params()
3247 struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai); in tegra210_sfc_out_hw_params() local
3252 &sfc->srate_out); in tegra210_sfc_out_hw_params()
3256 err = tegra210_sfc_set_audio_cif(sfc, params, TEGRA210_SFC_TX_CIF_CTRL); in tegra210_sfc_out_hw_params()
3258 dev_err(dev, "Can't set SFC TX CIF: %d\n", err); in tegra210_sfc_out_hw_params()
3262 regmap_write(sfc->regmap, TEGRA210_SFC_TX_FREQ, sfc->srate_out); in tegra210_sfc_out_hw_params()
3279 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_iget_stereo_to_mono() local
3281 ucontrol->value.enumerated.item[0] = sfc->stereo_to_mono[SFC_RX_PATH]; in tegra210_sfc_iget_stereo_to_mono()
3290 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_iput_stereo_to_mono() local
3293 if (value == sfc->stereo_to_mono[SFC_RX_PATH]) in tegra210_sfc_iput_stereo_to_mono()
3296 sfc->stereo_to_mono[SFC_RX_PATH] = value; in tegra210_sfc_iput_stereo_to_mono()
3305 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_iget_mono_to_stereo() local
3307 ucontrol->value.enumerated.item[0] = sfc->mono_to_stereo[SFC_RX_PATH]; in tegra210_sfc_iget_mono_to_stereo()
3316 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_iput_mono_to_stereo() local
3319 if (value == sfc->mono_to_stereo[SFC_RX_PATH]) in tegra210_sfc_iput_mono_to_stereo()
3322 sfc->mono_to_stereo[SFC_RX_PATH] = value; in tegra210_sfc_iput_mono_to_stereo()
3331 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_oget_stereo_to_mono() local
3333 ucontrol->value.enumerated.item[0] = sfc->stereo_to_mono[SFC_TX_PATH]; in tegra210_sfc_oget_stereo_to_mono()
3342 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_oput_stereo_to_mono() local
3345 if (value == sfc->stereo_to_mono[SFC_TX_PATH]) in tegra210_sfc_oput_stereo_to_mono()
3348 sfc->stereo_to_mono[SFC_TX_PATH] = value; in tegra210_sfc_oput_stereo_to_mono()
3357 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_oget_mono_to_stereo() local
3359 ucontrol->value.enumerated.item[0] = sfc->mono_to_stereo[SFC_TX_PATH]; in tegra210_sfc_oget_mono_to_stereo()
3368 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_oput_mono_to_stereo() local
3371 if (value == sfc->mono_to_stereo[SFC_TX_PATH]) in tegra210_sfc_oput_mono_to_stereo()
3374 sfc->mono_to_stereo[SFC_TX_PATH] = value; in tegra210_sfc_oput_mono_to_stereo()
3390 .name = "SFC-RX-CIF",
3412 .name = "SFC-TX-CIF",
3571 { .compatible = "nvidia,tegra210-sfc" },
3579 struct tegra210_sfc *sfc; in tegra210_sfc_platform_probe() local
3583 sfc = devm_kzalloc(dev, sizeof(*sfc), GFP_KERNEL); in tegra210_sfc_platform_probe()
3584 if (!sfc) in tegra210_sfc_platform_probe()
3587 dev_set_drvdata(dev, sfc); in tegra210_sfc_platform_probe()
3593 sfc->regmap = devm_regmap_init_mmio(dev, regs, in tegra210_sfc_platform_probe()
3595 if (IS_ERR(sfc->regmap)) { in tegra210_sfc_platform_probe()
3597 return PTR_ERR(sfc->regmap); in tegra210_sfc_platform_probe()
3600 regcache_cache_only(sfc->regmap, true); in tegra210_sfc_platform_probe()
3606 dev_err(dev, "can't register SFC component, err: %d\n", err); in tegra210_sfc_platform_probe()
3629 .name = "tegra210-sfc",
3639 MODULE_DESCRIPTION("Tegra210 SFC ASoC driver");