sound/soc/tegra/tegra210_mixer.c
Source file repositories/reference/linux-study-clean/sound/soc/tegra/tegra210_mixer.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/tegra/tegra210_mixer.c- Extension
.c- Size
- 27039 bytes
- Lines
- 961
- 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/math64.hlinux/mod_devicetable.hlinux/module.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.htegra210_mixer.htegra_cif.h
Detected Declarations
function tegra210_mixer_runtime_suspendfunction tegra210_mixer_runtime_resumefunction tegra210_mixer_write_ramfunction tegra210_mixer_configure_gainfunction tegra210_mixer_fade_duration_infofunction tegra210_mixer_get_fade_durationfunction tegra210_mixer_put_fade_durationfunction tegra210_mixer_get_fade_gainfunction tegra210_mixer_put_fade_gainfunction tegra210_mixer_get_fade_switchfunction tegra210_mixer_put_fade_switchfunction tegra210_mixer_get_fade_statusfunction tegra210_mixer_get_gainfunction tegra210_mixer_apply_gainfunction tegra210_mixer_put_gainfunction tegra210_mixer_put_instant_gainfunction tegra210_mixer_set_audio_ciffunction tegra210_mixer_in_hw_paramsfunction tegra210_mixer_out_hw_paramsfunction tegra210_mixer_fade_status_infofunction tegra210_mixer_wr_regfunction tegra210_mixer_rd_regfunction tegra210_mixer_volatile_regfunction tegra210_mixer_precious_regfunction tegra210_mixer_platform_probefunction tegra210_mixer_platform_remove
Annotated Snippet
if (instant_gain) {
val = 1;
} else {
if (i == DURATION_N3_ID)
val = mixer->duration[id];
else if (i == DURATION_INV_N3_ID)
val = div_u64(BIT_ULL(31 + TEGRA210_MIXER_PRESCALAR),
mixer->duration[id]);
else
val = gain_params.duration[i];
}
err = tegra210_mixer_write_ram(mixer,
REG_DURATION_PARAM(reg, i),
val);
if (err < 0)
goto rpm_put;
}
/* Trigger to apply gain configurations */
err = tegra210_mixer_write_ram(mixer, reg + REG_CFG_DONE_TRIGGER,
VAL_CFG_DONE_TRIGGER);
rpm_put:
pm_runtime_put(cmpnt->dev);
return err;
}
static int tegra210_mixer_fade_duration_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 1;
uinfo->value.integer.min = TEGRA210_MIXER_FADE_DURATION_MIN;
uinfo->value.integer.max = TEGRA210_MIXER_FADE_DURATION_MAX;
return 0;
}
static int tegra210_mixer_get_fade_duration(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
ucontrol->value.integer.value[0] = mixer->duration[mc->reg];
return 0;
}
static int tegra210_mixer_put_fade_duration(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
unsigned int id = mc->reg;
long duration = ucontrol->value.integer.value[0];
if (duration < (long)TEGRA210_MIXER_FADE_DURATION_MIN ||
duration > TEGRA210_MIXER_FADE_DURATION_MAX)
return -EINVAL;
if (mixer->duration[id] == duration)
return 0;
mixer->duration[id] = duration;
mixer->fade_pending[id] = true;
return 1;
}
static int tegra210_mixer_get_fade_gain(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct soc_mixer_control *mc =
(struct soc_mixer_control *)kcontrol->private_value;
struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol);
struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt);
ucontrol->value.integer.value[0] = mixer->fade_gain[mc->reg];
return 0;
}
static int tegra210_mixer_put_fade_gain(struct snd_kcontrol *kcontrol,
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/io.h`, `linux/math64.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/platform_device.h`, `linux/pm_runtime.h`.
- Detected declarations: `function tegra210_mixer_runtime_suspend`, `function tegra210_mixer_runtime_resume`, `function tegra210_mixer_write_ram`, `function tegra210_mixer_configure_gain`, `function tegra210_mixer_fade_duration_info`, `function tegra210_mixer_get_fade_duration`, `function tegra210_mixer_put_fade_duration`, `function tegra210_mixer_get_fade_gain`, `function tegra210_mixer_put_fade_gain`, `function tegra210_mixer_get_fade_switch`.
- 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.