]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ASoC: fsi: remove original filter from fsi_dma_probe()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 11 Dec 2013 04:46:59 +0000 (20:46 -0800)
committerMark Brown <broonie@linaro.org>
Wed, 11 Dec 2013 11:07:56 +0000 (11:07 +0000)
Remove original filter from fsi_dma_probe(),
and use SH-DMA suitable filter.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/sh/fsi.c

index b33ca7cd085bf4b766dee1900a4101beffc9fa72..6101055aae1dc6fe4e0f7851bd17dde646624f79 100644 (file)
@@ -232,9 +232,9 @@ struct fsi_stream {
         * these are for DMAEngine
         */
        struct dma_chan         *chan;
-       struct sh_dmae_slave    slave; /* see fsi_handler_init() */
        struct work_struct      work;
        dma_addr_t              dma;
+       int                     dma_id;
        int                     loop_cnt;
        int                     additional_pos;
 };
@@ -1410,15 +1410,6 @@ static void fsi_dma_do_work(struct work_struct *work)
        }
 }
 
-static bool fsi_dma_filter(struct dma_chan *chan, void *param)
-{
-       struct sh_dmae_slave *slave = param;
-
-       chan->private = slave;
-
-       return true;
-}
-
 static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io)
 {
        schedule_work(&io->work);
@@ -1446,15 +1437,34 @@ static int fsi_dma_push_start_stop(struct fsi_priv *fsi, struct fsi_stream *io,
 static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct device *dev)
 {
        dma_cap_mask_t mask;
+       int is_play = fsi_stream_is_play(fsi, io);
 
        dma_cap_zero(mask);
        dma_cap_set(DMA_SLAVE, mask);
 
-       io->chan = dma_request_channel(mask, fsi_dma_filter, &io->slave);
+       io->chan = dma_request_slave_channel_compat(mask,
+                               shdma_chan_filter, (void *)io->dma_id,
+                               dev, is_play ? "tx" : "rx");
+       if (io->chan) {
+               struct dma_slave_config cfg;
+               int ret;
+
+               cfg.slave_id    = io->dma_id;
+               cfg.dst_addr    = 0; /* use default addr */
+               cfg.src_addr    = 0; /* use default addr */
+               cfg.direction   = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
+
+               ret = dmaengine_slave_config(io->chan, &cfg);
+               if (ret < 0) {
+                       dma_release_channel(io->chan);
+                       io->chan = NULL;
+               }
+       }
+
        if (!io->chan) {
 
                /* switch to PIO handler */
-               if (fsi_stream_is_play(fsi, io))
+               if (is_play)
                        fsi->playback.handler   = &fsi_pio_push_handler;
                else
                        fsi->capture.handler    = &fsi_pio_pop_handler;
@@ -1960,7 +1970,7 @@ static void fsi_handler_init(struct fsi_priv *fsi,
        fsi->capture.priv       = fsi;
 
        if (info->tx_id) {
-               fsi->playback.slave.shdma_slave.slave_id = info->tx_id;
+               fsi->playback.dma_id  = info->tx_id;
                fsi->playback.handler = &fsi_dma_push_handler;
        }
 }