include/sound/cs35l56.h
Source file repositories/reference/linux-study-clean/include/sound/cs35l56.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/cs35l56.h- Extension
.h- Size
- 16476 bytes
- Lines
- 461
- Domain
- Driver Families
- Bucket
- include/sound
- 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/bits.hlinux/debugfs.hlinux/firmware/cirrus/cs_dsp.hlinux/regulator/consumer.hlinux/regmap.hlinux/spi/spi.hsound/cs-amp-lib.h
Detected Declarations
struct snd_ctl_elem_valuestruct cs35l56_spi_payloadstruct cs35l56_fw_regstruct cs35l56_cal_debugfs_fopsstruct cs35l56_basefunction cs35l56_is_otp_registerfunction cs35l56_init_config_for_spifunction cs35l56_is_spi
Annotated Snippet
struct cs35l56_spi_payload {
__be32 addr;
__be16 pad;
__be32 value;
} __packed;
static_assert(sizeof(struct cs35l56_spi_payload) == 10);
struct cs35l56_fw_reg {
unsigned int fw_ver;
unsigned int halo_state;
unsigned int pm_cur_stat;
unsigned int prot_sts;
unsigned int transducer_actual_ps;
unsigned int user_mute;
unsigned int user_volume;
unsigned int posture_number;
};
struct cs35l56_cal_debugfs_fops {
const struct debugfs_short_fops calibrate;
const struct debugfs_short_fops cal_temperature;
const struct debugfs_short_fops cal_data;
};
struct cs35l56_base {
struct device *dev;
struct regmap *regmap;
struct cs_dsp *dsp;
int irq;
struct mutex irq_lock;
u8 type;
u8 rev;
bool init_done;
bool fw_patched;
bool secured;
bool can_hibernate;
bool cal_data_valid;
s8 cal_index;
u8 num_amps;
struct cirrus_amp_cal_data cal_data;
struct gpio_desc *reset_gpio;
struct cs35l56_spi_payload *spi_payload_buf;
const struct cs35l56_fw_reg *fw_reg;
const struct cirrus_amp_cal_controls *calibration_controls;
struct dentry *debugfs;
u64 silicon_uid;
u8 onchip_spkid_gpios[5];
u8 num_onchip_spkid_gpios;
u8 onchip_spkid_pulls[5];
u8 num_onchip_spkid_pulls;
};
static inline bool cs35l56_is_otp_register(unsigned int reg)
{
return (reg >> 16) == 3;
}
static inline int cs35l56_init_config_for_spi(struct cs35l56_base *cs35l56,
struct spi_device *spi)
{
cs35l56->spi_payload_buf = devm_kzalloc(&spi->dev,
sizeof(*cs35l56->spi_payload_buf),
GFP_KERNEL | GFP_DMA);
if (!cs35l56->spi_payload_buf)
return -ENOMEM;
return 0;
}
static inline bool cs35l56_is_spi(struct cs35l56_base *cs35l56)
{
return IS_ENABLED(CONFIG_SPI_MASTER) && !!cs35l56->spi_payload_buf;
}
extern const struct regmap_config cs35l56_regmap_i2c;
extern const struct regmap_config cs35l56_regmap_spi;
extern const struct regmap_config cs35l56_regmap_sdw;
extern const struct regmap_config cs35l63_regmap_i2c;
extern const struct regmap_config cs35l63_regmap_sdw;
extern const struct cirrus_amp_cal_controls cs35l56_calibration_controls;
extern const char * const cs35l56_cal_set_status_text[3];
extern const char * const cs35l56_tx_input_texts[CS35L56_NUM_INPUT_SRC];
extern const unsigned int cs35l56_tx_input_values[CS35L56_NUM_INPUT_SRC];
int cs35l56_set_asp_patch(struct cs35l56_base *cs35l56_base);
int cs35l56_set_patch(struct cs35l56_base *cs35l56_base);
int cs35l56_mbox_send(struct cs35l56_base *cs35l56_base, unsigned int command);
int cs35l56_firmware_shutdown(struct cs35l56_base *cs35l56_base);
Annotation
- Immediate include surface: `linux/bits.h`, `linux/debugfs.h`, `linux/firmware/cirrus/cs_dsp.h`, `linux/regulator/consumer.h`, `linux/regmap.h`, `linux/spi/spi.h`, `sound/cs-amp-lib.h`.
- Detected declarations: `struct snd_ctl_elem_value`, `struct cs35l56_spi_payload`, `struct cs35l56_fw_reg`, `struct cs35l56_cal_debugfs_fops`, `struct cs35l56_base`, `function cs35l56_is_otp_register`, `function cs35l56_init_config_for_spi`, `function cs35l56_is_spi`.
- Atlas domain: Driver Families / include/sound.
- 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.