sound/soc/codecs/cs35l33.c
Source file repositories/reference/linux-study-clean/sound/soc/codecs/cs35l33.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/codecs/cs35l33.c- Extension
.c- Size
- 35244 bytes
- Lines
- 1288
- 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.
- 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/kernel.hlinux/init.hlinux/delay.hlinux/i2c.hlinux/slab.hlinux/workqueue.hlinux/platform_device.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.hsound/soc-dapm.hsound/initval.hsound/tlv.hlinux/gpio/consumer.hsound/cs35l33.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/regulator/machine.hlinux/of.hcs35l33.hcirrus_legacy.h
Detected Declarations
struct cs35l33_privatestruct cs35l33_mclk_divfunction cs35l33_volatile_registerfunction cs35l33_writeable_registerfunction cs35l33_readable_registerfunction cs35l33_spkrdrv_eventfunction cs35l33_sdin_eventfunction cs35l33_sdout_eventfunction cs35l33_set_bias_levelfunction cs35l33_get_mclk_coefffunction cs35l33_set_dai_fmtfunction cs35l33_pcm_hw_paramsfunction cs35l33_pcm_startupfunction cs35l33_set_tristatefunction cs35l33_set_tdm_slotfunction cs35l33_component_set_sysclkfunction cs35l33_set_hg_datafunction cs35l33_set_bst_ipkfunction cs35l33_probefunction cs35l33_runtime_resumefunction cs35l33_runtime_suspendfunction cs35l33_get_hg_datafunction cs35l33_irq_threadfunction cs35l33_of_get_pdatafunction cs35l33_i2c_probefunction cs35l33_i2c_remove
Annotated Snippet
struct cs35l33_private {
struct snd_soc_component *component;
struct cs35l33_pdata pdata;
struct regmap *regmap;
struct gpio_desc *reset_gpio;
bool amp_cal;
int mclk_int;
struct regulator_bulk_data core_supplies[2];
int num_core_supplies;
bool is_tdm_mode;
bool enable_soft_ramp;
};
static const struct reg_default cs35l33_reg[] = {
{CS35L33_PWRCTL1, 0x85},
{CS35L33_PWRCTL2, 0xFE},
{CS35L33_CLK_CTL, 0x0C},
{CS35L33_BST_PEAK_CTL, 0x90},
{CS35L33_PROTECT_CTL, 0x55},
{CS35L33_BST_CTL1, 0x00},
{CS35L33_BST_CTL2, 0x01},
{CS35L33_ADSP_CTL, 0x00},
{CS35L33_ADC_CTL, 0xC8},
{CS35L33_DAC_CTL, 0x14},
{CS35L33_DIG_VOL_CTL, 0x00},
{CS35L33_CLASSD_CTL, 0x04},
{CS35L33_AMP_CTL, 0x90},
{CS35L33_INT_MASK_1, 0xFF},
{CS35L33_INT_MASK_2, 0xFF},
{CS35L33_DIAG_LOCK, 0x00},
{CS35L33_DIAG_CTRL_1, 0x40},
{CS35L33_DIAG_CTRL_2, 0x00},
{CS35L33_HG_MEMLDO_CTL, 0x62},
{CS35L33_HG_REL_RATE, 0x03},
{CS35L33_LDO_DEL, 0x12},
{CS35L33_HG_HEAD, 0x0A},
{CS35L33_HG_EN, 0x05},
{CS35L33_TX_VMON, 0x00},
{CS35L33_TX_IMON, 0x03},
{CS35L33_TX_VPMON, 0x02},
{CS35L33_TX_VBSTMON, 0x05},
{CS35L33_TX_FLAG, 0x06},
{CS35L33_TX_EN1, 0x00},
{CS35L33_TX_EN2, 0x00},
{CS35L33_TX_EN3, 0x00},
{CS35L33_TX_EN4, 0x00},
{CS35L33_RX_AUD, 0x40},
{CS35L33_RX_SPLY, 0x03},
{CS35L33_RX_ALIVE, 0x04},
{CS35L33_BST_CTL4, 0x63},
};
static const struct reg_sequence cs35l33_patch[] = {
{ 0x00, 0x99, 0 },
{ 0x59, 0x02, 0 },
{ 0x52, 0x30, 0 },
{ 0x39, 0x45, 0 },
{ 0x57, 0x30, 0 },
{ 0x2C, 0x68, 0 },
{ 0x00, 0x00, 0 },
};
static bool cs35l33_volatile_register(struct device *dev, unsigned int reg)
{
switch (reg) {
case CS35L33_DEVID_AB:
case CS35L33_DEVID_CD:
case CS35L33_DEVID_E:
case CS35L33_REV_ID:
case CS35L33_INT_STATUS_1:
case CS35L33_INT_STATUS_2:
case CS35L33_HG_STATUS:
return true;
default:
return false;
}
}
static bool cs35l33_writeable_register(struct device *dev, unsigned int reg)
{
switch (reg) {
/* these are read only registers */
case CS35L33_DEVID_AB:
case CS35L33_DEVID_CD:
case CS35L33_DEVID_E:
case CS35L33_REV_ID:
case CS35L33_INT_STATUS_1:
case CS35L33_INT_STATUS_2:
case CS35L33_HG_STATUS:
return false;
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/kernel.h`, `linux/init.h`, `linux/delay.h`, `linux/i2c.h`, `linux/slab.h`, `linux/workqueue.h`.
- Detected declarations: `struct cs35l33_private`, `struct cs35l33_mclk_div`, `function cs35l33_volatile_register`, `function cs35l33_writeable_register`, `function cs35l33_readable_register`, `function cs35l33_spkrdrv_event`, `function cs35l33_sdin_event`, `function cs35l33_sdout_event`, `function cs35l33_set_bias_level`, `function cs35l33_get_mclk_coeff`.
- 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.