sound/soc/mediatek/mt8196/mt8196-dai-i2s.c
Source file repositories/reference/linux-study-clean/sound/soc/mediatek/mt8196/mt8196-dai-i2s.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/mediatek/mt8196/mt8196-dai-i2s.c- Extension
.c- Size
- 99545 bytes
- Lines
- 2614
- 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.
- 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/bitops.hlinux/regmap.hsound/pcm_params.hmt8196-afe-clk.hmt8196-afe-common.hmt8196-interconnection.h../common/mtk-afe-fe-dai.h
Detected Declarations
struct mtk_afe_i2s_privstruct mtk_base_etdm_datafunction get_etdm_wlenfunction get_etdm_lrck_widthfunction get_etdm_ratefunction get_etdm_inconn_ratefunction is_etdm_in_pad_topfunction get_i2s_wlenfunction get_i2s_id_by_namefunction mtk_apll_eventfunction mtk_mclk_en_eventfunction mtk_afe_i2s_share_connectfunction mtk_afe_i2s_apll_connectfunction mtk_afe_i2s_mclk_connectfunction mtk_afe_mclk_apll_connectfunction mtk_dai_i2s_configfunction mtk_dai_i2s_hw_paramsfunction mtk_dai_i2s_set_sysclkfunction mtk_dai_i2s_set_fmtfunction mt8196_dai_i2s_get_sharefunction init_i2s_priv_datafunction mt8196_dai_i2s_register
Annotated Snippet
struct mtk_afe_i2s_priv {
u8 id;
u32 rate; /* for determine which apll to use */
int low_jitter_en;
const char *share_property_name;
int share_i2s_id;
u32 mclk_rate;
u8 mclk_id;
u8 mclk_apll;
u8 ch_num;
u8 sync;
u8 ip_mode;
u8 format;
};
/* this enum is merely for mtk_afe_i2s_priv & mtk_base_etdm_data declare */
enum {
DAI_I2SIN0,
DAI_I2SIN1,
DAI_I2SIN2,
DAI_I2SIN3,
DAI_I2SIN4,
DAI_I2SIN6,
DAI_I2SOUT0,
DAI_I2SOUT1,
DAI_I2SOUT2,
DAI_I2SOUT3,
DAI_I2SOUT4,
DAI_I2SOUT6,
DAI_FMI2S_MASTER,
DAI_I2S_NUM,
};
static bool is_etdm_in_pad_top(unsigned int dai_num)
{
switch (dai_num) {
case DAI_I2SOUT4:
case DAI_I2SIN4:
return true;
default:
return false;
}
}
struct mtk_base_etdm_data {
u16 enable_reg;
u16 enable_mask;
u8 enable_shift;
u16 sync_reg;
u16 sync_mask;
u8 sync_shift;
u16 ch_reg;
u16 ch_mask;
u8 ch_shift;
u16 ip_mode_reg;
u16 ip_mode_mask;
u8 ip_mode_shift;
u16 init_count_reg;
u16 init_count_mask;
u8 init_count_shift;
u16 init_point_reg;
u16 init_point_mask;
u8 init_point_shift;
u16 lrck_reset_reg;
u16 lrck_reset_mask;
u8 lrck_reset_shift;
u16 clk_source_reg;
u16 clk_source_mask;
u8 clk_source_shift;
u16 ck_en_sel_reg;
u16 ck_en_sel_mask;
u8 ck_en_sel_shift;
u16 fs_timing_reg;
u16 fs_timing_mask;
u8 fs_timing_shift;
u16 relatch_en_sel_reg;
u16 relatch_en_sel_mask;
u8 relatch_en_sel_shift;
u16 use_afifo_reg;
u16 use_afifo_mask;
u8 use_afifo_shift;
u16 afifo_mode_reg;
u16 afifo_mode_mask;
u8 afifo_mode_shift;
u16 almost_end_ch_reg;
u16 almost_end_ch_mask;
u8 almost_end_ch_shift;
u16 almost_end_bit_reg;
u16 almost_end_bit_mask;
u8 almost_end_bit_shift;
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/regmap.h`, `sound/pcm_params.h`, `mt8196-afe-clk.h`, `mt8196-afe-common.h`, `mt8196-interconnection.h`, `../common/mtk-afe-fe-dai.h`.
- Detected declarations: `struct mtk_afe_i2s_priv`, `struct mtk_base_etdm_data`, `function get_etdm_wlen`, `function get_etdm_lrck_width`, `function get_etdm_rate`, `function get_etdm_inconn_rate`, `function is_etdm_in_pad_top`, `function get_i2s_wlen`, `function get_i2s_id_by_name`, `function mtk_apll_event`.
- Atlas domain: Driver Families / sound/soc.
- 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.