/* Called after closing the device, but before snd_card_saa7134_capture_close It stops the DMA audio and releases the buffers.  */
static int snd_card_saa7134_hw_free(struct snd_pcm_substream *substream)
/* Called after closing the device, but before snd_card_saa7134_capture_close It stops the DMA audio and releases the buffers.  */
static int snd_card_saa7134_hw_free(struct snd_pcm_substream *substream)
{
	snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
	struct saa7134_dev *dev;
	dev = saa7134->dev;
	if (substream->runtime->dma_area) {
		saa7134_pgtable_free(dev->pci, &dev->dmasound.pt);
		videobuf_sg_dma_unmap(&dev->pci->dev, &dev->dmasound.dma);
		dsp_buffer_free(dev);
		substream->runtime->dma_area = NULL;
	}
	return 0;
}