sound/soc/sprd/sprd-mcdt.h
Source file repositories/reference/linux-study-clean/sound/soc/sprd/sprd-mcdt.h
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/sprd/sprd-mcdt.h- Extension
.h- Size
- 2780 bytes
- Lines
- 108
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct sprd_mcdt_chan_callbackstruct sprd_mcdt_chanenum sprd_mcdt_channel_typeenum sprd_mcdt_dma_chanfunction sprd_mcdt_free_chanfunction sprd_mcdt_chan_readfunction sprd_mcdt_chan_int_enablefunction sprd_mcdt_chan_int_disablefunction sprd_mcdt_chan_dma_disable
Annotated Snippet
struct sprd_mcdt_chan_callback {
void (*notify)(void *data);
void *data;
};
/**
* struct sprd_mcdt_chan - this struct represents a single channel instance
* @mcdt: the mcdt controller
* @id: channel id
* @fifo_phys: channel fifo physical address which is used for DMA transfer
* @type: channel type
* @cb: channel fifo interrupt's callback interface to notify the fifo events
* @dma_enable: indicate if use DMA mode to transfer data
* @int_enable: indicate if use interrupt mode to notify users to read or
* write data manually
* @list: used to link into the global list
*
* Note: users should not modify any members of this structure.
*/
struct sprd_mcdt_chan {
struct sprd_mcdt_dev *mcdt;
u8 id;
unsigned long fifo_phys;
enum sprd_mcdt_channel_type type;
enum sprd_mcdt_dma_chan dma_chan;
struct sprd_mcdt_chan_callback *cb;
bool dma_enable;
bool int_enable;
struct list_head list;
};
#if IS_ENABLED(CONFIG_SND_SOC_SPRD_MCDT)
struct sprd_mcdt_chan *sprd_mcdt_request_chan(u8 channel,
enum sprd_mcdt_channel_type type);
void sprd_mcdt_free_chan(struct sprd_mcdt_chan *chan);
int sprd_mcdt_chan_write(struct sprd_mcdt_chan *chan, char *tx_buf, u32 size);
int sprd_mcdt_chan_read(struct sprd_mcdt_chan *chan, char *rx_buf, u32 size);
int sprd_mcdt_chan_int_enable(struct sprd_mcdt_chan *chan, u32 water_mark,
struct sprd_mcdt_chan_callback *cb);
void sprd_mcdt_chan_int_disable(struct sprd_mcdt_chan *chan);
int sprd_mcdt_chan_dma_enable(struct sprd_mcdt_chan *chan,
enum sprd_mcdt_dma_chan dma_chan, u32 water_mark);
void sprd_mcdt_chan_dma_disable(struct sprd_mcdt_chan *chan);
#else
struct sprd_mcdt_chan *sprd_mcdt_request_chan(u8 channel,
enum sprd_mcdt_channel_type type)
{
return NULL;
}
void sprd_mcdt_free_chan(struct sprd_mcdt_chan *chan)
{ }
int sprd_mcdt_chan_write(struct sprd_mcdt_chan *chan, char *tx_buf, u32 size)
{
return -EINVAL;
}
int sprd_mcdt_chan_read(struct sprd_mcdt_chan *chan, char *rx_buf, u32 size)
{
return 0;
}
int sprd_mcdt_chan_int_enable(struct sprd_mcdt_chan *chan, u32 water_mark,
struct sprd_mcdt_chan_callback *cb)
{
return -EINVAL;
}
void sprd_mcdt_chan_int_disable(struct sprd_mcdt_chan *chan)
{ }
int sprd_mcdt_chan_dma_enable(struct sprd_mcdt_chan *chan,
enum sprd_mcdt_dma_chan dma_chan, u32 water_mark)
{
return -EINVAL;
}
void sprd_mcdt_chan_dma_disable(struct sprd_mcdt_chan *chan)
{ }
#endif
#endif /* __SPRD_MCDT_H */
Annotation
- Detected declarations: `struct sprd_mcdt_chan_callback`, `struct sprd_mcdt_chan`, `enum sprd_mcdt_channel_type`, `enum sprd_mcdt_dma_chan`, `function sprd_mcdt_free_chan`, `function sprd_mcdt_chan_read`, `function sprd_mcdt_chan_int_enable`, `function sprd_mcdt_chan_int_disable`, `function sprd_mcdt_chan_dma_disable`.
- 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.