sound/soc/codecs/tda7419.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/tda7419.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/tda7419.c- Extension
.c- Size
- 22036 bytes
- Lines
- 642
- 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/i2c.hlinux/init.hlinux/module.hlinux/regmap.hsound/core.hsound/control.hsound/soc.hsound/tlv.h
Detected Declarations
struct tda7419_datastruct tda7419_vol_controlfunction tda7419_readable_regfunction tda7419_vol_is_stereofunction tda7419_vol_infofunction tda7419_vol_get_valuefunction tda7419_vol_getfunction tda7419_vol_put_valuefunction tda7419_vol_putfunction tda7419_probe
Annotated Snippet
struct tda7419_data {
struct regmap *regmap;
};
static bool tda7419_readable_reg(struct device *dev, unsigned int reg)
{
return false;
}
static const struct reg_default tda7419_regmap_defaults[] = {
{ TDA7419_MAIN_SRC_REG, 0xfe },
{ TDA7419_LOUDNESS_REG, 0xfe },
{ TDA7419_MUTE_CLK_REG, 0xfe },
{ TDA7419_VOLUME_REG, 0xfe },
{ TDA7419_TREBLE_REG, 0xfe },
{ TDA7419_MIDDLE_REG, 0xfe },
{ TDA7419_BASS_REG, 0xfe },
{ TDA7419_SECOND_SRC_REG, 0xfe },
{ TDA7419_SUB_MID_BASS_REG, 0xfe },
{ TDA7419_MIXING_GAIN_REG, 0xfe },
{ TDA7419_ATTENUATOR_LF_REG, 0xfe },
{ TDA7419_ATTENUATOR_RF_REG, 0xfe },
{ TDA7419_ATTENUATOR_LR_REG, 0xfe },
{ TDA7419_ATTENUATOR_RR_REG, 0xfe },
{ TDA7419_MIXING_LEVEL_REG, 0xfe },
{ TDA7419_ATTENUATOR_SUB_REG, 0xfe },
{ TDA7419_SA_CLK_AC_REG, 0xfe },
{ TDA7419_TESTING_REG, 0xfe },
};
static const struct regmap_config tda7419_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = TDA7419_TESTING_REG,
.cache_type = REGCACHE_RBTREE,
.readable_reg = tda7419_readable_reg,
.reg_defaults = tda7419_regmap_defaults,
.num_reg_defaults = ARRAY_SIZE(tda7419_regmap_defaults),
};
struct tda7419_vol_control {
int min, max;
unsigned int reg, rreg, mask, thresh;
unsigned int invert:1;
};
static inline bool tda7419_vol_is_stereo(struct tda7419_vol_control *tvc)
{
if (tvc->reg == tvc->rreg)
return false;
return true;
}
static int tda7419_vol_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
struct tda7419_vol_control *tvc =
(struct tda7419_vol_control *)kcontrol->private_value;
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = tda7419_vol_is_stereo(tvc) ? 2 : 1;
uinfo->value.integer.min = tvc->min;
uinfo->value.integer.max = tvc->max;
return 0;
}
static inline int tda7419_vol_get_value(int val, unsigned int mask,
int min, int thresh,
unsigned int invert)
{
val &= mask;
if (val < thresh) {
if (invert)
val = 0 - val;
} else if (val > thresh) {
if (invert)
val = val - thresh;
else
val = thresh - val;
}
if (val < min)
val = min;
return val;
}
static int tda7419_vol_get(struct snd_kcontrol *kcontrol,
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/init.h`, `linux/module.h`, `linux/regmap.h`, `sound/core.h`, `sound/control.h`, `sound/soc.h`, `sound/tlv.h`.
- Detected declarations: `struct tda7419_data`, `struct tda7419_vol_control`, `function tda7419_readable_reg`, `function tda7419_vol_is_stereo`, `function tda7419_vol_info`, `function tda7419_vol_get_value`, `function tda7419_vol_get`, `function tda7419_vol_put_value`, `function tda7419_vol_put`, `function tda7419_probe`.
- 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.