sound/soc/fsl/mpc5200_dma.h

Source file repositories/reference/linux-study-clean/sound/soc/fsl/mpc5200_dma.h

File Facts

System
Linux kernel
Corpus path
sound/soc/fsl/mpc5200_dma.h
Extension
.h
Size
2408 bytes
Lines
89
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct psc_dma_stream {
	struct snd_pcm_runtime *runtime;
	int active;
	struct psc_dma *psc_dma;
	struct bcom_task *bcom_task;
	int irq;
	struct snd_pcm_substream *stream;
	int period_next;
	int period_current;
	int period_bytes;
	int period_count;

	/* AC97 state */
	u32 ac97_slot_bits;
};

/**
 * psc_dma - Private driver data
 * @name: short name for this device ("PSC0", "PSC1", etc)
 * @psc_regs: pointer to the PSC's registers
 * @fifo_regs: pointer to the PSC's FIFO registers
 * @irq: IRQ of this PSC
 * @dev: struct device pointer
 * @dai: the CPU DAI for this device
 * @sicr: Base value used in serial interface control register; mode is ORed
 *        with this value.
 * @playback: Playback stream context data
 * @capture: Capture stream context data
 */
struct psc_dma {
	char name[32];
	struct mpc52xx_psc __iomem *psc_regs;
	struct mpc52xx_psc_fifo __iomem *fifo_regs;
	unsigned int irq;
	struct device *dev;
	spinlock_t lock;
	struct mutex mutex;
	u32 sicr;
	uint sysclk;
	int imr;
	int id;
	unsigned int slots;

	/* per-stream data */
	struct psc_dma_stream playback;
	struct psc_dma_stream capture;

	/* Statistics */
	struct {
		unsigned long overrun_count;
		unsigned long underrun_count;
	} stats;
};

/* Utility for retrieving psc_dma_stream structure from a substream */
static inline struct psc_dma_stream *
to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma)
{
	if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE)
		return &psc_dma->capture;
	return &psc_dma->playback;
}

int mpc5200_audio_dma_create(struct platform_device *op);
int mpc5200_audio_dma_destroy(struct platform_device *op);

#endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */

Annotation

Implementation Notes