sound/soc/codecs/cs35l45.h
Source file repositories/reference/linux-study-clean/sound/soc/codecs/cs35l45.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/cs35l45.h- Extension
.h- Size
- 16830 bytes
- Lines
- 515
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pm_runtime.hlinux/regmap.hlinux/regulator/consumer.hdt-bindings/sound/cs35l45.hwm_adsp.h
Detected Declarations
struct cs35l45_irqstruct cs35l45_privateenum cs35l45_cspl_mboxstateenum cs35l45_cspl_mboxcmdenum control_bus_typeenum amp_modeenum cs35l45_irq_listenum mbox3_events
Annotated Snippet
struct cs35l45_irq {
int irq;
const char *name;
irqreturn_t (*handler)(int irq, void *data);
};
#define CS35L45_REG_IRQ(_reg, _irq) \
[CS35L45_ ## _irq ## _IRQ] = { \
.reg_offset = (CS35L45_ ## _reg) - CS35L45_IRQ1_EINT_1, \
.mask = CS35L45_ ## _irq ## _MASK \
}
enum cs35l45_irq_list {
CS35L45_AMP_SHORT_ERR_IRQ,
CS35L45_UVLO_VDDBATT_ERR_IRQ,
CS35L45_BST_SHORT_ERR_IRQ,
CS35L45_BST_UVP_ERR_IRQ,
CS35L45_TEMP_ERR_IRQ,
CS35L45_AMP_CAL_ERR_IRQ,
CS35L45_UVLO_VDDLV_ERR_IRQ,
CS35L45_GLOBAL_ERROR_IRQ,
CS35L45_DSP_WDT_EXPIRE_IRQ,
CS35L45_PLL_UNLOCK_FLAG_RISE_IRQ,
CS35L45_PLL_LOCK_FLAG_IRQ,
CS35L45_DSP_VIRT2_MBOX_IRQ,
CS35L45_NUM_IRQ
};
#define CS35L45_MBOX3_CMD_MASK 0xFF
#define CS35L45_MBOX3_CMD_SHIFT 0
#define CS35L45_MBOX3_DATA_MASK 0xFFFFFF00
#define CS35L45_MBOX3_DATA_SHIFT 8
enum mbox3_events {
EVENT_SPEAKER_STATUS = 0x66,
EVENT_BOOT_DONE = 0x67,
};
struct cs35l45_private {
struct wm_adsp dsp; /* needs to be first member */
struct device *dev;
struct regmap *regmap;
struct gpio_desc *reset_gpio;
struct regulator *vdd_batt;
struct regulator *vdd_a;
bool initialized;
bool sysclk_set;
u8 slot_width;
u8 slot_count;
int amplifier_mode;
int irq_invert;
int irq;
unsigned int i2c_addr;
enum control_bus_type bus_type;
struct regmap_irq_chip_data *irq_data;
};
extern const struct dev_pm_ops cs35l45_pm_ops;
extern const struct regmap_config cs35l45_i2c_regmap;
extern const struct regmap_config cs35l45_spi_regmap;
int cs35l45_apply_patch(struct cs35l45_private *cs35l45);
int cs35l45_get_clk_freq_id(unsigned int freq);
int cs35l45_probe(struct cs35l45_private *cs35l45);
void cs35l45_remove(struct cs35l45_private *cs35l45);
#endif /* CS35L45_H */
Annotation
- Immediate include surface: `linux/pm_runtime.h`, `linux/regmap.h`, `linux/regulator/consumer.h`, `dt-bindings/sound/cs35l45.h`, `wm_adsp.h`.
- Detected declarations: `struct cs35l45_irq`, `struct cs35l45_private`, `enum cs35l45_cspl_mboxstate`, `enum cs35l45_cspl_mboxcmd`, `enum control_bus_type`, `enum amp_mode`, `enum cs35l45_irq_list`, `enum mbox3_events`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.