sound/pci/ctxfi/cthw20k2.c
Source file repositories/reference/linux-study-clean/sound/pci/ctxfi/cthw20k2.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/ctxfi/cthw20k2.c- Extension
.c- Size
- 53719 bytes
- Lines
- 2390
- Domain
- Driver Families
- Bucket
- sound/pci
- 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/types.hlinux/slab.hlinux/pci.hlinux/io.hlinux/string.hlinux/kernel.hlinux/interrupt.hlinux/delay.hcthw20k2.hct20k2reg.h
Detected Declarations
struct hw20k2struct src_rsc_ctrl_blkstruct src_mgr_ctrl_blkstruct srcimapstruct srcimp_mgr_ctrl_blkstruct amixer_rsc_ctrl_blkstruct dai_ctrl_blkstruct daoimapstruct dao_ctrl_blkstruct daio_mgr_ctrl_blkstruct dac_confstruct adc_confstruct daio_confstruct trn_confstruct regs_cs4382function src_get_rsc_ctrl_blkfunction src_put_rsc_ctrl_blkfunction src_set_statefunction src_set_bmfunction src_set_rsrfunction src_set_sffunction src_set_wrfunction src_set_pmfunction src_set_romfunction src_set_vofunction src_set_stfunction src_set_iefunction src_set_ilszfunction src_set_bpfunction src_set_ciszfunction src_set_cafunction src_set_safunction src_set_lafunction src_set_pitchfunction src_set_clear_zbufsfunction src_set_dirtyfunction src_set_dirty_allfunction src_param_pitch_mixerfunction src_commit_writefunction src_get_cafunction src_get_dirtyfunction src_dirty_conj_maskfunction src_mgr_enbs_srcfunction src_mgr_enb_srcfunction src_mgr_dsb_srcfunction src_mgr_commit_writefunction src_mgr_get_ctrl_blkfunction src_mgr_put_ctrl_blk
Annotated Snippet
struct hw20k2 {
struct hw hw;
/* for i2c */
unsigned char dev_id;
unsigned char addr_size;
unsigned char data_size;
int mic_source;
};
static u32 hw_read_20kx(struct hw *hw, u32 reg);
static void hw_write_20kx(struct hw *hw, u32 reg, u32 data);
/*
* Type definition block.
* The layout of control structures can be directly applied on 20k2 chip.
*/
/*
* SRC control block definitions.
*/
/* SRC resource control block */
#define SRCCTL_STATE 0x00000007
#define SRCCTL_BM 0x00000008
#define SRCCTL_RSR 0x00000030
#define SRCCTL_SF 0x000001C0
#define SRCCTL_WR 0x00000200
#define SRCCTL_PM 0x00000400
#define SRCCTL_ROM 0x00001800
#define SRCCTL_VO 0x00002000
#define SRCCTL_ST 0x00004000
#define SRCCTL_IE 0x00008000
#define SRCCTL_ILSZ 0x000F0000
#define SRCCTL_BP 0x00100000
#define SRCCCR_CISZ 0x000007FF
#define SRCCCR_CWA 0x001FF800
#define SRCCCR_D 0x00200000
#define SRCCCR_RS 0x01C00000
#define SRCCCR_NAL 0x3E000000
#define SRCCCR_RA 0xC0000000
#define SRCCA_CA 0x0FFFFFFF
#define SRCCA_RS 0xE0000000
#define SRCSA_SA 0x0FFFFFFF
#define SRCLA_LA 0x0FFFFFFF
/* Mixer Parameter Ring ram Low and Hight register.
* Fixed-point value in 8.24 format for parameter channel */
#define MPRLH_PITCH 0xFFFFFFFF
/* SRC resource register dirty flags */
union src_dirty {
struct {
u16 ctl:1;
u16 ccr:1;
u16 sa:1;
u16 la:1;
u16 ca:1;
u16 mpr:1;
u16 czbfs:1; /* Clear Z-Buffers */
u16 rsv:9;
} bf;
u16 data;
};
struct src_rsc_ctrl_blk {
unsigned int ctl;
unsigned int ccr;
unsigned int ca;
unsigned int sa;
unsigned int la;
unsigned int mpr;
union src_dirty dirty;
};
/* SRC manager control block */
union src_mgr_dirty {
struct {
u16 enb0:1;
u16 enb1:1;
u16 enb2:1;
u16 enb3:1;
u16 enb4:1;
u16 enb5:1;
u16 enb6:1;
u16 enb7:1;
Annotation
- Immediate include surface: `linux/types.h`, `linux/slab.h`, `linux/pci.h`, `linux/io.h`, `linux/string.h`, `linux/kernel.h`, `linux/interrupt.h`, `linux/delay.h`.
- Detected declarations: `struct hw20k2`, `struct src_rsc_ctrl_blk`, `struct src_mgr_ctrl_blk`, `struct srcimap`, `struct srcimp_mgr_ctrl_blk`, `struct amixer_rsc_ctrl_blk`, `struct dai_ctrl_blk`, `struct daoimap`, `struct dao_ctrl_blk`, `struct daio_mgr_ctrl_blk`.
- Atlas domain: Driver Families / sound/pci.
- 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.