#include <sound/soc.h>
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
-#include "ep93xx-pcm.h"
 
 static int edb93xx_hw_params(struct snd_pcm_substream *substream,
                             struct snd_pcm_hw_params *params)
 
 #include <sound/soc.h>
 
 #include <linux/platform_data/dma-ep93xx.h>
-#include "ep93xx-pcm.h"
 
 /*
  * Per channel (1-4) registers.
 /* currently ALSA only supports a single AC97 device */
 static struct ep93xx_ac97_info *ep93xx_ac97_info;
 
-static struct ep93xx_pcm_dma_params ep93xx_ac97_pcm_out = {
+static struct ep93xx_dma_data ep93xx_ac97_pcm_out = {
        .name           = "ac97-pcm-out",
        .dma_port       = EP93XX_DMA_AAC1,
+       .direction      = DMA_MEM_TO_DEV,
 };
 
-static struct ep93xx_pcm_dma_params ep93xx_ac97_pcm_in = {
+static struct ep93xx_dma_data ep93xx_ac97_pcm_in = {
        .name           = "ac97-pcm-in",
        .dma_port       = EP93XX_DMA_AAC1,
+       .direction      = DMA_DEV_TO_MEM,
 };
 
 static inline unsigned ep93xx_ac97_read_reg(struct ep93xx_ac97_info *info,
 static int ep93xx_ac97_startup(struct snd_pcm_substream *substream,
                               struct snd_soc_dai *dai)
 {
-       struct ep93xx_pcm_dma_params *dma_data;
+       struct ep93xx_dma_data *dma_data;
 
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
                dma_data = &ep93xx_ac97_pcm_out;
 
 #include <mach/ep93xx-regs.h>
 #include <linux/platform_data/dma-ep93xx.h>
 
-#include "ep93xx-pcm.h"
-
 #define EP93XX_I2S_TXCLKCFG            0x00
 #define EP93XX_I2S_RXCLKCFG            0x04
 #define EP93XX_I2S_GLCTRL              0x0C
        struct clk                      *mclk;
        struct clk                      *sclk;
        struct clk                      *lrclk;
-       struct ep93xx_pcm_dma_params    *dma_params;
+       struct ep93xx_dma_data          *dma_data;
        void __iomem                    *regs;
 };
 
-struct ep93xx_pcm_dma_params ep93xx_i2s_dma_params[] = {
+struct ep93xx_dma_data ep93xx_i2s_dma_data[] = {
        [SNDRV_PCM_STREAM_PLAYBACK] = {
                .name           = "i2s-pcm-out",
                .dma_port       = EP93XX_DMA_I2S1,
+               .direction      = DMA_MEM_TO_DEV,
        },
        [SNDRV_PCM_STREAM_CAPTURE] = {
                .name           = "i2s-pcm-in",
                .dma_port       = EP93XX_DMA_I2S1,
+               .direction      = DMA_DEV_TO_MEM,
        },
 };
 
        struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 
        snd_soc_dai_set_dma_data(cpu_dai, substream,
-                                &info->dma_params[substream->stream]);
+                                &info->dma_data[substream->stream]);
        return 0;
 }
 
        }
 
        dev_set_drvdata(&pdev->dev, info);
-       info->dma_params = ep93xx_i2s_dma_params;
+       info->dma_data = ep93xx_i2s_dma_data;
 
        err = snd_soc_register_dai(&pdev->dev, &ep93xx_i2s_dai);
        if (err)
 
 #include <mach/hardware.h>
 #include <mach/ep93xx-regs.h>
 
-#include "ep93xx-pcm.h"
-
 static const struct snd_pcm_hardware ep93xx_pcm_hardware = {
        .info                   = (SNDRV_PCM_INFO_MMAP          |
                                   SNDRV_PCM_INFO_MMAP_VALID    |
 static int ep93xx_pcm_open(struct snd_pcm_substream *substream)
 {
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-       struct ep93xx_pcm_dma_params *dma_params;
-       struct ep93xx_dma_data *dma_data;
-       int ret;
 
        snd_soc_set_runtime_hwparams(substream, &ep93xx_pcm_hardware);
 
-       dma_data = kmalloc(sizeof(*dma_data), GFP_KERNEL);
-       if (!dma_data)
-               return -ENOMEM;
-
-       dma_params = snd_soc_dai_get_dma_data(cpu_dai, substream);
-       dma_data->port = dma_params->dma_port;
-       dma_data->name = dma_params->name;
-       dma_data->direction = snd_pcm_substream_to_dma_direction(substream);
-
-       ret = snd_dmaengine_pcm_open(substream, ep93xx_pcm_dma_filter, dma_data);
-       if (ret) {
-               kfree(dma_data);
-               return ret;
-       }
-
-       snd_dmaengine_pcm_set_data(substream, dma_data);
-
-       return 0;
-}
-
-static int ep93xx_pcm_close(struct snd_pcm_substream *substream)
-{
-       struct dma_data *dma_data = snd_dmaengine_pcm_get_data(substream);
-
-       snd_dmaengine_pcm_close(substream);
-       kfree(dma_data);
-       return 0;
+       return snd_dmaengine_pcm_open(substream, ep93xx_pcm_dma_filter,
+                       snd_soc_dai_get_dma_data(rtd->cpu_dai, substream));
 }
 
 static int ep93xx_pcm_hw_params(struct snd_pcm_substream *substream,
 
 static struct snd_pcm_ops ep93xx_pcm_ops = {
        .open           = ep93xx_pcm_open,
-       .close          = ep93xx_pcm_close,
+       .close          = snd_dmaengine_pcm_close,
        .ioctl          = snd_pcm_lib_ioctl,
        .hw_params      = ep93xx_pcm_hw_params,
        .hw_free        = ep93xx_pcm_hw_free,
 
+++ /dev/null
-/*
- * sound/soc/ep93xx/ep93xx-pcm.h - EP93xx ALSA PCM interface
- *
- * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
- * Copyright (C) 2006 Applied Data Systems
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef _EP93XX_SND_SOC_PCM_H
-#define _EP93XX_SND_SOC_PCM_H
-
-struct ep93xx_pcm_dma_params {
-       char    *name;
-       int     dma_port;
-};
-
-#endif /* _EP93XX_SND_SOC_PCM_H */
 
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 
-#include "ep93xx-pcm.h"
-
 static struct snd_soc_dai_link simone_dai = {
        .name           = "AC97",
        .stream_name    = "AC97 HiFi",
 
 #include <mach/hardware.h>
 
 #include "../codecs/tlv320aic23.h"
-#include "ep93xx-pcm.h"
 
 #define CODEC_CLOCK 5644800