sound/soc/uniphier/evea.c
Source file repositories/reference/linux-study-clean/sound/soc/uniphier/evea.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/uniphier/evea.c- Extension
.c- Size
- 15436 bytes
- Lines
- 570
- 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/module.hlinux/of.hlinux/regmap.hlinux/reset.hsound/pcm.hsound/soc.h
Detected Declarations
struct evea_privfunction evea_set_power_state_onfunction evea_set_power_state_offfunction evea_update_switch_linfunction evea_update_switch_lofunction evea_update_switch_hpfunction evea_update_switch_allfunction evea_get_switch_linfunction evea_set_switch_linfunction evea_get_switch_lofunction evea_set_switch_lofunction evea_get_switch_hpfunction evea_set_switch_hpfunction evea_codec_probefunction evea_codec_suspendfunction evea_codec_resumefunction evea_probefunction evea_remove
Annotated Snippet
struct evea_priv {
struct clk *clk, *clk_exiv;
struct reset_control *rst, *rst_exiv, *rst_adamv;
struct regmap *regmap;
int switch_lin;
int switch_lo;
int switch_hp;
};
static const char * const linsw1_sel1_text[] = {
"LIN1", "LIN2", "LIN3"
};
static SOC_ENUM_SINGLE_DECL(linsw1_sel1_enum,
ALINSW1, ALINSW1_SEL1_SHIFT,
linsw1_sel1_text);
static const struct snd_kcontrol_new linesw1_mux[] = {
SOC_DAPM_ENUM("Line In 1 Source", linsw1_sel1_enum),
};
static const struct snd_soc_dapm_widget evea_widgets[] = {
SND_SOC_DAPM_ADC("ADC", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_MUX("Line In 1 Mux", SND_SOC_NOPM, 0, 0, linesw1_mux),
SND_SOC_DAPM_INPUT("LIN1_LP"),
SND_SOC_DAPM_INPUT("LIN1_RP"),
SND_SOC_DAPM_INPUT("LIN2_LP"),
SND_SOC_DAPM_INPUT("LIN2_RP"),
SND_SOC_DAPM_INPUT("LIN3_LP"),
SND_SOC_DAPM_INPUT("LIN3_RP"),
SND_SOC_DAPM_DAC("DAC HP", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_DAC("DAC LO1", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_DAC("DAC LO2", NULL, SND_SOC_NOPM, 0, 0),
SND_SOC_DAPM_OUTPUT("HP1_L"),
SND_SOC_DAPM_OUTPUT("HP1_R"),
SND_SOC_DAPM_OUTPUT("LO2_L"),
SND_SOC_DAPM_OUTPUT("LO2_R"),
};
static const struct snd_soc_dapm_route evea_routes[] = {
{ "Line In 1", NULL, "ADC" },
{ "ADC", NULL, "Line In 1 Mux" },
{ "Line In 1 Mux", "LIN1", "LIN1_LP" },
{ "Line In 1 Mux", "LIN1", "LIN1_RP" },
{ "Line In 1 Mux", "LIN2", "LIN2_LP" },
{ "Line In 1 Mux", "LIN2", "LIN2_RP" },
{ "Line In 1 Mux", "LIN3", "LIN3_LP" },
{ "Line In 1 Mux", "LIN3", "LIN3_RP" },
{ "DAC HP", NULL, "Headphone 1" },
{ "DAC LO1", NULL, "Line Out 1" },
{ "DAC LO2", NULL, "Line Out 2" },
{ "HP1_L", NULL, "DAC HP" },
{ "HP1_R", NULL, "DAC HP" },
{ "LO2_L", NULL, "DAC LO2" },
{ "LO2_R", NULL, "DAC LO2" },
};
static void evea_set_power_state_on(struct evea_priv *evea)
{
struct regmap *map = evea->regmap;
regmap_update_bits(map, AANAPOW, AANAPOW_A_POWD,
AANAPOW_A_POWD);
regmap_update_bits(map, ADAC1ODC, ADAC1ODC_HP_DIS_RES_MASK,
ADAC1ODC_HP_DIS_RES_ON);
regmap_update_bits(map, ADAC1ODC, ADAC1ODC_ADAC_RAMPCLT_MASK,
ADAC1ODC_ADAC_RAMPCLT_REDUCE);
regmap_update_bits(map, ADACSEQ2(0), ADACSEQ2_ADACIN_FIX, 0);
regmap_update_bits(map, ADACSEQ2(1), ADACSEQ2_ADACIN_FIX, 0);
regmap_update_bits(map, ADACSEQ2(2), ADACSEQ2_ADACIN_FIX, 0);
}
static void evea_set_power_state_off(struct evea_priv *evea)
{
struct regmap *map = evea->regmap;
regmap_update_bits(map, ADAC1ODC, ADAC1ODC_HP_DIS_RES_MASK,
ADAC1ODC_HP_DIS_RES_ON);
regmap_update_bits(map, ADACSEQ1(0), ADACSEQ1_MMUTE,
ADACSEQ1_MMUTE);
regmap_update_bits(map, ADACSEQ1(1), ADACSEQ1_MMUTE,
ADACSEQ1_MMUTE);
regmap_update_bits(map, ADACSEQ1(2), ADACSEQ1_MMUTE,
Annotation
- Immediate include surface: `linux/clk.h`, `linux/module.h`, `linux/of.h`, `linux/regmap.h`, `linux/reset.h`, `sound/pcm.h`, `sound/soc.h`.
- Detected declarations: `struct evea_priv`, `function evea_set_power_state_on`, `function evea_set_power_state_off`, `function evea_update_switch_lin`, `function evea_update_switch_lo`, `function evea_update_switch_hp`, `function evea_update_switch_all`, `function evea_get_switch_lin`, `function evea_set_switch_lin`, `function evea_get_switch_lo`.
- 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.