sound/soc/tegra/tegra210_sfc.c
Source file repositories/reference/linux-study-clean/sound/soc/tegra/tegra210_sfc.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/tegra/tegra210_sfc.c- Extension
.c- Size
- 89925 bytes
- Lines
- 3644
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/device.hlinux/io.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.htegra210_sfc.htegra_cif.h
Detected Declarations
function tegra210_sfc_runtime_suspendfunction tegra210_sfc_runtime_resumefunction tegra210_sfc_write_ramfunction tegra210_sfc_write_coeff_ramfunction tegra210_sfc_set_audio_ciffunction tegra210_sfc_soft_resetfunction tegra210_sfc_rate_to_idxfunction tegra210_sfc_startupfunction tegra210_sfc_in_hw_paramsfunction tegra210_sfc_out_hw_paramsfunction tegra210_sfc_initfunction tegra210_sfc_iget_stereo_to_monofunction tegra210_sfc_iput_stereo_to_monofunction tegra210_sfc_iget_mono_to_stereofunction tegra210_sfc_iput_mono_to_stereofunction tegra210_sfc_oget_stereo_to_monofunction tegra210_sfc_oput_stereo_to_monofunction tegra210_sfc_oget_mono_to_stereofunction tegra210_sfc_oput_mono_to_stereofunction tegra210_sfc_wr_regfunction tegra210_sfc_rd_regfunction tegra210_sfc_volatile_regfunction tegra210_sfc_precious_regfunction tegra210_sfc_platform_probefunction tegra210_sfc_platform_remove
Annotated Snippet
if (rate == tegra210_sfc_rates[i]) {
*rate_idx = i;
return 0;
}
}
dev_err(dev, "Sample rate %d Hz is not supported\n", rate);
return -EOPNOTSUPP;
}
static int tegra210_sfc_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai);
int err;
regmap_update_bits(sfc->regmap, TEGRA210_SFC_COEF_RAM,
TEGRA210_SFC_COEF_RAM_EN, 0);
err = tegra210_sfc_soft_reset(sfc);
if (err < 0) {
dev_err(dai->dev, "Failed to reset SFC in %s, err = %d\n",
__func__, err);
return err;
}
return 0;
}
static int tegra210_sfc_in_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai);
struct device *dev = dai->dev;
int err;
err = tegra210_sfc_rate_to_idx(dev, params_rate(params),
&sfc->srate_in);
if (err < 0)
return err;
err = tegra210_sfc_set_audio_cif(sfc, params, TEGRA210_SFC_RX_CIF_CTRL);
if (err < 0) {
dev_err(dev, "Can't set SFC RX CIF: %d\n", err);
return err;
}
regmap_write(sfc->regmap, TEGRA210_SFC_RX_FREQ, sfc->srate_in);
return err;
}
static int tegra210_sfc_out_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
struct tegra210_sfc *sfc = snd_soc_dai_get_drvdata(dai);
struct device *dev = dai->dev;
int err;
err = tegra210_sfc_rate_to_idx(dev, params_rate(params),
&sfc->srate_out);
if (err < 0)
return err;
err = tegra210_sfc_set_audio_cif(sfc, params, TEGRA210_SFC_TX_CIF_CTRL);
if (err < 0) {
dev_err(dev, "Can't set SFC TX CIF: %d\n", err);
return err;
}
regmap_write(sfc->regmap, TEGRA210_SFC_TX_FREQ, sfc->srate_out);
return 0;
}
static int tegra210_sfc_init(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *kcontrol, int event)
{
struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
return tegra210_sfc_write_coeff_ram(cmpnt);
}
static int tegra210_sfc_iget_stereo_to_mono(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/regmap.h`.
- Detected declarations: `function tegra210_sfc_runtime_suspend`, `function tegra210_sfc_runtime_resume`, `function tegra210_sfc_write_ram`, `function tegra210_sfc_write_coeff_ram`, `function tegra210_sfc_set_audio_cif`, `function tegra210_sfc_soft_reset`, `function tegra210_sfc_rate_to_idx`, `function tegra210_sfc_startup`, `function tegra210_sfc_in_hw_params`, `function tegra210_sfc_out_hw_params`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.