Lines Matching full:sfc
3 // tegra210_sfc.c - Tegra210 SFC driver
52 /* coeff RAM tables required for SFC */
3062 struct tegra210_sfc *sfc = dev_get_drvdata(dev); in tegra210_sfc_runtime_suspend() local
3064 regcache_cache_only(sfc->regmap, true); in tegra210_sfc_runtime_suspend()
3065 regcache_mark_dirty(sfc->regmap); in tegra210_sfc_runtime_suspend()
3072 struct tegra210_sfc *sfc = dev_get_drvdata(dev); in tegra210_sfc_runtime_resume() local
3074 regcache_cache_only(sfc->regmap, false); in tegra210_sfc_runtime_resume()
3075 regcache_sync(sfc->regmap); in tegra210_sfc_runtime_resume()
3096 struct tegra210_sfc *sfc = dev_get_drvdata(cmpnt->dev); in tegra210_sfc_write_coeff_ram() local
3100 if (sfc->srate_in == sfc->srate_out) in tegra210_sfc_write_coeff_ram()
3103 coeff_ram = coef_addr_table[sfc->srate_in][sfc->srate_out]; in tegra210_sfc_write_coeff_ram()
3107 sfc->srate_in, sfc->srate_out); in tegra210_sfc_write_coeff_ram()
3112 tegra210_sfc_write_ram(sfc->regmap, coeff_ram); in tegra210_sfc_write_coeff_ram()
3114 regmap_update_bits(sfc->regmap, in tegra210_sfc_write_coeff_ram()
3122 static int tegra210_sfc_set_audio_cif(struct tegra210_sfc *sfc, in tegra210_sfc_set_audio_cif() argument
3154 cif_conf.stereo_conv = sfc->stereo_to_mono[path]; in tegra210_sfc_set_audio_cif()
3155 cif_conf.mono_conv = sfc->mono_to_stereo[path]; in tegra210_sfc_set_audio_cif()
3157 tegra_set_cif(sfc->regmap, reg, &cif_conf); in tegra210_sfc_set_audio_cif()
3162 static int tegra210_sfc_soft_reset(struct tegra210_sfc *sfc) in tegra210_sfc_soft_reset() argument
3172 regmap_update_bits(sfc->regmap, TEGRA210_SFC_SOFT_RESET, in tegra210_sfc_soft_reset()
3175 return regmap_read_poll_timeout(sfc->regmap, in tegra210_sfc_soft_reset()
3203 struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai); in tegra210_sfc_startup() local
3206 regmap_update_bits(sfc->regmap, TEGRA210_SFC_COEF_RAM, in tegra210_sfc_startup()
3209 err = tegra210_sfc_soft_reset(sfc); in tegra210_sfc_startup()
3211 dev_err(dai->dev, "Failed to reset SFC in %s, err = %d\n", in tegra210_sfc_startup()
3224 struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai); in tegra210_sfc_in_hw_params() local
3229 &sfc->srate_in); in tegra210_sfc_in_hw_params()
3233 err = tegra210_sfc_set_audio_cif(sfc, params, TEGRA210_SFC_RX_CIF_CTRL); in tegra210_sfc_in_hw_params()
3235 dev_err(dev, "Can't set SFC RX CIF: %d\n", err); in tegra210_sfc_in_hw_params()
3239 regmap_write(sfc->regmap, TEGRA210_SFC_RX_FREQ, sfc->srate_in); in tegra210_sfc_in_hw_params()
3248 struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai); in tegra210_sfc_out_hw_params() local
3253 &sfc->srate_out); in tegra210_sfc_out_hw_params()
3257 err = tegra210_sfc_set_audio_cif(sfc, params, TEGRA210_SFC_TX_CIF_CTRL); in tegra210_sfc_out_hw_params()
3259 dev_err(dev, "Can't set SFC TX CIF: %d\n", err); in tegra210_sfc_out_hw_params()
3263 regmap_write(sfc->regmap, TEGRA210_SFC_TX_FREQ, sfc->srate_out); in tegra210_sfc_out_hw_params()
3280 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_iget_stereo_to_mono() local
3282 ucontrol->value.enumerated.item[0] = sfc->stereo_to_mono[SFC_RX_PATH]; in tegra210_sfc_iget_stereo_to_mono()
3291 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_iput_stereo_to_mono() local
3294 if (value == sfc->stereo_to_mono[SFC_RX_PATH]) in tegra210_sfc_iput_stereo_to_mono()
3297 sfc->stereo_to_mono[SFC_RX_PATH] = value; in tegra210_sfc_iput_stereo_to_mono()
3306 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_iget_mono_to_stereo() local
3308 ucontrol->value.enumerated.item[0] = sfc->mono_to_stereo[SFC_RX_PATH]; in tegra210_sfc_iget_mono_to_stereo()
3317 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_iput_mono_to_stereo() local
3320 if (value == sfc->mono_to_stereo[SFC_RX_PATH]) in tegra210_sfc_iput_mono_to_stereo()
3323 sfc->mono_to_stereo[SFC_RX_PATH] = value; in tegra210_sfc_iput_mono_to_stereo()
3332 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_oget_stereo_to_mono() local
3334 ucontrol->value.enumerated.item[0] = sfc->stereo_to_mono[SFC_TX_PATH]; in tegra210_sfc_oget_stereo_to_mono()
3343 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_oput_stereo_to_mono() local
3346 if (value == sfc->stereo_to_mono[SFC_TX_PATH]) in tegra210_sfc_oput_stereo_to_mono()
3349 sfc->stereo_to_mono[SFC_TX_PATH] = value; in tegra210_sfc_oput_stereo_to_mono()
3358 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_oget_mono_to_stereo() local
3360 ucontrol->value.enumerated.item[0] = sfc->mono_to_stereo[SFC_TX_PATH]; in tegra210_sfc_oget_mono_to_stereo()
3369 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); in tegra210_sfc_oput_mono_to_stereo() local
3372 if (value == sfc->mono_to_stereo[SFC_TX_PATH]) in tegra210_sfc_oput_mono_to_stereo()
3375 sfc->mono_to_stereo[SFC_TX_PATH] = value; in tegra210_sfc_oput_mono_to_stereo()
3391 .name = "SFC-RX-CIF",
3413 .name = "SFC-TX-CIF",
3572 { .compatible = "nvidia,tegra210-sfc" },
3580 struct tegra210_sfc *sfc; in tegra210_sfc_platform_probe() local
3584 sfc = devm_kzalloc(dev, sizeof(*sfc), GFP_KERNEL); in tegra210_sfc_platform_probe()
3585 if (!sfc) in tegra210_sfc_platform_probe()
3588 dev_set_drvdata(dev, sfc); in tegra210_sfc_platform_probe()
3594 sfc->regmap = devm_regmap_init_mmio(dev, regs, in tegra210_sfc_platform_probe()
3596 if (IS_ERR(sfc->regmap)) { in tegra210_sfc_platform_probe()
3598 return PTR_ERR(sfc->regmap); in tegra210_sfc_platform_probe()
3601 regcache_cache_only(sfc->regmap, true); in tegra210_sfc_platform_probe()
3607 dev_err(dev, "can't register SFC component, err: %d\n", err); in tegra210_sfc_platform_probe()
3630 .name = "tegra210-sfc",
3640 MODULE_DESCRIPTION("Tegra210 SFC ASoC driver");