Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Distribution Guide
STMicroelectronics DMA API
ST Logo
  Contents   Next
	const char * dmac_id =STM_DMAC_ID;
	const char * lb_cap_channel = STM_DMA_CAP_LOW_BW;
	const char * hb_cap_channel = STM_DMA_CAP_HIGH_BW;
	struct stm_dma_params dmap;

	if(chip->fdma_channel <0){
			if((err=request_dma_bycap(&dmac_id,&hb_cap_channel,"STB7100_PCM_DMA"))<0){
				if((err=request_dma_bycap(&dmac_id,&lb_cap_channel,"STB7100_PCM_DMA"))<0){
					return -ENODEV;
				}
			}
			chip->fdma_channel= err;
	}

	declare_dma_parms(
					&dmap,
					MODE_PACED,
					STM_DMA_LIST_CIRC,
					STM_DMA_SETUP_CONTEXT_TASK,
					STM_DMA_NOBLOCK_MODE,
			     	(char*)STM_DMAC_ID);

	chip->buffer_start_addr = (unsigned long)runtime->dma_addr;

	dma_parms_paced(&dmap,
			snd_pcm_lib_buffer_bytes(substream),
			chip->fdma_req);

	dma_parms_addrs(&dmap,runtime->dma_addr,
			virt_to_phys(chip->pcm_player+STM_PCMP_DATA_FIFO),
			snd_pcm_lib_buffer_bytes(substream));

	dma_compile_list(&dmap);
	chip->dmap = dmap;
	/*play the audio...*/
	int res = dma_xfer_list(chip->fdma_channel,&chip->dmap);

	
	/*now stop*/
		dma_stop_channel(chip->fdma_channel);
	dma_free_descriptor(&chip->dmap);
	dma_free((chip->fdma_channel);
	return err;

  Contents   Next
Valid HTML 4.01! Last updated: 2006/11/09 12:20:57
© Copyright STMicroelectronics Limited, 2005
Printer