sound/soc/ti/davinci-mcasp.c
Source file repositories/reference/linux-study-clean/sound/soc/ti/davinci-mcasp.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/ti/davinci-mcasp.c- Extension
.c- Size
- 83489 bytes
- Lines
- 3042
- 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/init.hlinux/module.hlinux/device.hlinux/slab.hlinux/delay.hlinux/io.hlinux/clk.hlinux/pm_runtime.hlinux/of.hlinux/of_graph.hlinux/platform_data/davinci_asp.hlinux/math64.hlinux/bitmap.hlinux/gpio/driver.hlinux/property.hsound/asoundef.hsound/core.hsound/pcm.hsound/pcm_params.hsound/initval.hsound/soc.hsound/dmaengine_pcm.hedma-pcm.hsdma-pcm.hudma-pcm.hdavinci-mcasp.h
Detected Declarations
struct davinci_mcasp_contextstruct davinci_mcasp_ruledatastruct davinci_mcaspenum mcasp_graph_modefunction mcasp_set_bitsfunction mcasp_clr_bitsfunction mcasp_mod_bitsfunction mcasp_set_regfunction mcasp_get_regfunction mcasp_set_ctl_regfunction mcasp_is_synchronousfunction mcasp_is_frame_producerfunction mcasp_set_clk_pdirfunction for_each_set_bit_fromfunction mcasp_set_clk_pdir_streamfunction for_each_set_bit_fromfunction mcasp_set_axr_pdirfunction for_each_set_bitfunction mcasp_get_tdm_slotsfunction mcasp_get_slot_widthfunction mcasp_get_sysclk_freqfunction mcasp_get_bclk_divfunction mcasp_get_auxclk_fs_ratiofunction mcasp_is_auxclk_enabledfunction mcasp_start_rxfunction mcasp_start_txfunction davinci_mcasp_startfunction mcasp_stop_rxfunction mcasp_stop_txfunction davinci_mcasp_stopfunction davinci_mcasp_tx_irq_handlerfunction davinci_mcasp_rx_irq_handlerfunction davinci_mcasp_common_irq_handlerfunction davinci_mcasp_set_dai_fmtfunction __davinci_mcasp_set_clkdivfunction davinci_mcasp_set_clkdivfunction davinci_mcasp_set_sysclkfunction davinci_mcasp_ch_constraintfunction davinci_mcasp_set_ch_constraintsfunction davinci_mcasp_set_tdm_slotfunction davinci_config_channel_sizefunction mcasp_common_hw_paramfunction mcasp_i2s_hw_paramfunction mcasp_dit_hw_paramfunction davinci_mcasp_calc_clk_divfunction davinci_mcasp_tx_delayfunction davinci_mcasp_rx_delayfunction davinci_mcasp_delay
Annotated Snippet
struct davinci_mcasp_context {
u32 config_regs[ARRAY_SIZE(context_regs)];
u32 afifo_regs[2]; /* for read/write fifo control registers */
u32 *xrsr_regs; /* for serializer configuration */
bool pm_state;
};
#endif
struct davinci_mcasp_ruledata {
struct davinci_mcasp *mcasp;
int serializers;
int stream;
};
enum mcasp_graph_mode {
MCASP_GRAPH_NONE, /* 1:1, simple-audio-card, no of-graph endpoints */
MCASP_GRAPH_PORT, /* 1:1, audio-graph-card: port { endpoint } */
MCASP_GRAPH_PORTS, /* 1:N, audio-graph-card2 non-DPCM: ports { port@0; ... } */
MCASP_GRAPH_DPCM, /* N:M, audio-graph-card2 DPCM: N FE DAIs, detected via */
/* remote "dpcm" node in the sound card DT */
};
struct davinci_mcasp {
struct snd_dmaengine_dai_dma_data dma_data[2];
struct davinci_mcasp_pdata *pdata;
void __iomem *base;
u32 fifo_base;
struct device *dev;
struct snd_pcm_substream *substreams[2];
unsigned int dai_fmt;
u32 iec958_status;
/* Audio can not be enabled due to missing parameter(s) */
bool missing_audio_param;
/* McASP specific data */
int tdm_slots_tx;
int tdm_slots_rx;
u32 tdm_mask[2];
int slot_width_tx;
int slot_width_rx;
u8 op_mode;
u8 dismod;
u8 num_serializer;
u8 *serial_dir;
u8 version;
u8 bclk_div_tx;
u8 bclk_div_rx;
int streams;
u32 irq_request[2];
unsigned int sysclk_freq_tx;
unsigned int sysclk_freq_rx;
bool bclk_master;
bool async_mode;
u32 auxclk_fs_ratio_tx;
u32 auxclk_fs_ratio_rx;
unsigned long pdir; /* Pin direction bitfield */
/* McASP FIFO related */
u8 txnumevt;
u8 rxnumevt;
bool dat_port;
/* Used for comstraint setting on the second stream */
u32 channels;
int max_format_width;
u8 active_serializers[2];
/* Audio graph support */
enum mcasp_graph_mode graph_mode;
int num_dais;
#ifdef CONFIG_GPIOLIB
struct gpio_chip gpio_chip;
#endif
#ifdef CONFIG_PM
struct davinci_mcasp_context context;
#endif
struct davinci_mcasp_ruledata ruledata[2];
struct snd_pcm_hw_constraint_list chconstr[2];
};
static inline void mcasp_set_bits(struct davinci_mcasp *mcasp, u32 offset,
u32 val)
Annotation
- Immediate include surface: `linux/init.h`, `linux/module.h`, `linux/device.h`, `linux/slab.h`, `linux/delay.h`, `linux/io.h`, `linux/clk.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct davinci_mcasp_context`, `struct davinci_mcasp_ruledata`, `struct davinci_mcasp`, `enum mcasp_graph_mode`, `function mcasp_set_bits`, `function mcasp_clr_bits`, `function mcasp_mod_bits`, `function mcasp_set_reg`, `function mcasp_get_reg`, `function mcasp_set_ctl_reg`.
- 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.