include/sound/cs-amp-lib.h
Source file repositories/reference/linux-study-clean/include/sound/cs-amp-lib.h
File Facts
- System
- Linux kernel
- Corpus path
include/sound/cs-amp-lib.h- Extension
.h- Size
- 2848 bytes
- Lines
- 94
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/efi.hlinux/types.h
Detected Declarations
struct cs_dspstruct cirrus_amp_cal_datastruct cirrus_amp_efi_datastruct cirrus_amp_cal_controlsstruct cs_amp_test_hooksfunction cs_amp_cal_target_u64
Annotated Snippet
struct cirrus_amp_cal_data {
u32 calTarget[2];
u32 calTime[2];
s8 calAmbient;
u8 calStatus;
u16 calR;
} __packed;
struct cirrus_amp_efi_data {
u32 size;
u32 count;
struct cirrus_amp_cal_data data[] __counted_by(count);
} __packed;
/**
* struct cirrus_amp_cal_controls - definition of firmware calibration controls
* @alg_id: ID of algorithm containing the controls.
* @mem_region: DSP memory region containing the controls.
* @ambient: Name of control for calAmbient value.
* @calr: Name of control for calR value.
* @status: Name of control for calStatus value.
* @checksum: Name of control for checksum value.
*/
struct cirrus_amp_cal_controls {
unsigned int alg_id;
int mem_region;
const char *ambient;
const char *calr;
const char *status;
const char *checksum;
};
int cs_amp_write_cal_coeffs(struct cs_dsp *dsp,
const struct cirrus_amp_cal_controls *controls,
const struct cirrus_amp_cal_data *data);
int cs_amp_read_cal_coeffs(struct cs_dsp *dsp,
const struct cirrus_amp_cal_controls *controls,
struct cirrus_amp_cal_data *data);
int cs_amp_write_ambient_temp(struct cs_dsp *dsp,
const struct cirrus_amp_cal_controls *controls,
u32 temp);
int cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, int amp_index,
struct cirrus_amp_cal_data *out_data);
int cs_amp_set_efi_calibration_data(struct device *dev, int amp_index, int num_amps,
const struct cirrus_amp_cal_data *in_data);
int cs_amp_get_vendor_spkid(struct device *dev);
const char *cs_amp_devm_get_vendor_specific_variant_id(struct device *dev,
int ssid_vendor,
int ssid_device);
struct dentry *cs_amp_create_debugfs(struct device *dev);
static inline u64 cs_amp_cal_target_u64(const struct cirrus_amp_cal_data *data)
{
return ((u64)data->calTarget[1] << 32) | data->calTarget[0];
}
struct cs_amp_test_hooks {
efi_status_t (*get_efi_variable)(efi_char16_t *name,
efi_guid_t *guid,
u32 *returned_attr,
unsigned long *size,
void *buf);
efi_status_t (*set_efi_variable)(efi_char16_t *name,
efi_guid_t *guid,
u32 attr,
unsigned long size,
void *buf);
int (*write_cal_coeff)(struct cs_dsp *dsp,
const struct cirrus_amp_cal_controls *controls,
const char *ctl_name, u32 val);
int (*read_cal_coeff)(struct cs_dsp *dsp,
const struct cirrus_amp_cal_controls *controls,
const char *ctl_name, u32 *val);
};
extern const struct cs_amp_test_hooks * const cs_amp_test_hooks;
#endif /* CS_AMP_LIB_H */
Annotation
- Immediate include surface: `linux/efi.h`, `linux/types.h`.
- Detected declarations: `struct cs_dsp`, `struct cirrus_amp_cal_data`, `struct cirrus_amp_efi_data`, `struct cirrus_amp_cal_controls`, `struct cs_amp_test_hooks`, `function cs_amp_cal_target_u64`.
- Atlas domain: Driver Families / include/sound.
- 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.