sound/soc/codecs/sta350.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/sta350.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/sta350.c- Extension
.c- Size
- 37332 bytes
- Lines
- 1259
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/module.hlinux/moduleparam.hlinux/init.hlinux/delay.hlinux/pm.hlinux/i2c.hlinux/of.hlinux/regmap.hlinux/regulator/consumer.hlinux/gpio/consumer.hlinux/slab.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-dapm.hsound/initval.hsound/tlv.hsound/sta350.hsta350.h
Detected Declarations
struct sta350_privfunction sta350_coefficient_infofunction sta350_coefficient_getfunction sta350_coefficient_putfunction sta350_sync_coef_shadowfunction sta350_cache_syncfunction sta350_set_dai_sysclkfunction sta350_set_dai_fmtfunction sta350_hw_paramsfunction sta350_startup_sequencefunction sta350_set_bias_levelfunction sta350_probefunction sta350_removefunction sta350_probe_dtfunction sta350_i2c_probe
Annotated Snippet
struct sta350_priv {
struct regmap *regmap;
struct regulator_bulk_data supplies[ARRAY_SIZE(sta350_supply_names)];
struct sta350_platform_data *pdata;
unsigned int mclk;
unsigned int format;
u32 coef_shadow[STA350_COEF_COUNT];
int shutdown;
struct gpio_desc *gpiod_nreset;
struct gpio_desc *gpiod_power_down;
struct mutex coeff_lock;
};
static const DECLARE_TLV_DB_SCALE(mvol_tlv, -12750, 50, 1);
static const DECLARE_TLV_DB_SCALE(chvol_tlv, -7950, 50, 1);
static const DECLARE_TLV_DB_SCALE(tone_tlv, -1200, 200, 0);
static const char * const sta350_drc_ac[] = {
"Anti-Clipping", "Dynamic Range Compression"
};
static const char * const sta350_auto_gc_mode[] = {
"User", "AC no clipping", "AC limited clipping (10%)",
"DRC nighttime listening mode"
};
static const char * const sta350_auto_xo_mode[] = {
"User", "80Hz", "100Hz", "120Hz", "140Hz", "160Hz", "180Hz",
"200Hz", "220Hz", "240Hz", "260Hz", "280Hz", "300Hz", "320Hz",
"340Hz", "360Hz"
};
static const char * const sta350_binary_output[] = {
"FFX 3-state output - normal operation", "Binary output"
};
static const char * const sta350_limiter_select[] = {
"Limiter Disabled", "Limiter #1", "Limiter #2"
};
static const char * const sta350_limiter_attack_rate[] = {
"3.1584", "2.7072", "2.2560", "1.8048", "1.3536", "0.9024",
"0.4512", "0.2256", "0.1504", "0.1123", "0.0902", "0.0752",
"0.0645", "0.0564", "0.0501", "0.0451"
};
static const char * const sta350_limiter_release_rate[] = {
"0.5116", "0.1370", "0.0744", "0.0499", "0.0360", "0.0299",
"0.0264", "0.0208", "0.0198", "0.0172", "0.0147", "0.0137",
"0.0134", "0.0117", "0.0110", "0.0104"
};
static const char * const sta350_noise_shaper_type[] = {
"Third order", "Fourth order"
};
static DECLARE_TLV_DB_RANGE(sta350_limiter_ac_attack_tlv,
0, 7, TLV_DB_SCALE_ITEM(-1200, 200, 0),
8, 16, TLV_DB_SCALE_ITEM(300, 100, 0),
);
static DECLARE_TLV_DB_RANGE(sta350_limiter_ac_release_tlv,
0, 0, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 0),
1, 1, TLV_DB_SCALE_ITEM(-2900, 0, 0),
2, 2, TLV_DB_SCALE_ITEM(-2000, 0, 0),
3, 8, TLV_DB_SCALE_ITEM(-1400, 200, 0),
8, 16, TLV_DB_SCALE_ITEM(-700, 100, 0),
);
static DECLARE_TLV_DB_RANGE(sta350_limiter_drc_attack_tlv,
0, 7, TLV_DB_SCALE_ITEM(-3100, 200, 0),
8, 13, TLV_DB_SCALE_ITEM(-1600, 100, 0),
14, 16, TLV_DB_SCALE_ITEM(-1000, 300, 0),
);
static DECLARE_TLV_DB_RANGE(sta350_limiter_drc_release_tlv,
0, 0, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 0),
1, 2, TLV_DB_SCALE_ITEM(-3800, 200, 0),
3, 4, TLV_DB_SCALE_ITEM(-3300, 200, 0),
5, 12, TLV_DB_SCALE_ITEM(-3000, 200, 0),
13, 16, TLV_DB_SCALE_ITEM(-1500, 300, 0),
);
static SOC_ENUM_SINGLE_DECL(sta350_drc_ac_enum,
STA350_CONFD, STA350_CONFD_DRC_SHIFT,
sta350_drc_ac);
static SOC_ENUM_SINGLE_DECL(sta350_noise_shaper_enum,
STA350_CONFE, STA350_CONFE_NSBW_SHIFT,
sta350_noise_shaper_type);
static SOC_ENUM_SINGLE_DECL(sta350_auto_gc_enum,
STA350_AUTO1, STA350_AUTO1_AMGC_SHIFT,
sta350_auto_gc_mode);
static SOC_ENUM_SINGLE_DECL(sta350_auto_xo_enum,
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/init.h`, `linux/delay.h`, `linux/pm.h`, `linux/i2c.h`, `linux/of.h`, `linux/regmap.h`.
- Detected declarations: `struct sta350_priv`, `function sta350_coefficient_info`, `function sta350_coefficient_get`, `function sta350_coefficient_put`, `function sta350_sync_coef_shadow`, `function sta350_cache_sync`, `function sta350_set_dai_sysclk`, `function sta350_set_dai_fmt`, `function sta350_hw_params`, `function sta350_startup_sequence`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.