]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - sound/soc/sh/fsi.c
Merge remote-tracking branch 'asoc/topic/fsi' into asoc-next
[can-eth-gw-linux.git] / sound / soc / sh / fsi.c
index e74c4ebc957aa4771d9bdc9ee53a0b31331319d8..a606d0f93d1cea4db2e88f47e8ba0d94b36aa59f 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/sh_dma.h>
 #include <linux/slab.h>
 #include <linux/module.h>
+#include <linux/workqueue.h>
 #include <sound/soc.h>
 #include <sound/pcm_params.h>
 #include <sound/sh_fsi.h>
@@ -232,7 +233,7 @@ struct fsi_stream {
         */
        struct dma_chan         *chan;
        struct sh_dmae_slave    slave; /* see fsi_handler_init() */
-       struct tasklet_struct   tasklet;
+       struct work_struct      work;
        dma_addr_t              dma;
 };
 
@@ -1437,9 +1438,9 @@ static void fsi_dma_complete(void *data)
        snd_pcm_period_elapsed(io->substream);
 }
 
-static void fsi_dma_do_tasklet(unsigned long data)
+static void fsi_dma_do_work(struct work_struct *work)
 {
-       struct fsi_stream *io = (struct fsi_stream *)data;
+       struct fsi_stream *io = container_of(work, struct fsi_stream, work);
        struct fsi_priv *fsi = fsi_stream_to_priv(io);
        struct snd_soc_dai *dai;
        struct dma_async_tx_descriptor *desc;
@@ -1481,7 +1482,7 @@ static void fsi_dma_do_tasklet(unsigned long data)
         * FIXME
         *
         * In DMAEngine case, codec and FSI cannot be started simultaneously
-        * since FSI is using tasklet.
+        * since FSI is using the scheduler work queue.
         * Therefore, in capture case, probably FSI FIFO will have got
         * overflow error in this point.
         * in that case, DMA cannot start transfer until error was cleared.
@@ -1505,7 +1506,7 @@ static bool fsi_dma_filter(struct dma_chan *chan, void *param)
 
 static int fsi_dma_transfer(struct fsi_priv *fsi, struct fsi_stream *io)
 {
-       tasklet_schedule(&io->tasklet);
+       schedule_work(&io->work);
 
        return 0;
 }
@@ -1547,14 +1548,14 @@ static int fsi_dma_probe(struct fsi_priv *fsi, struct fsi_stream *io, struct dev
                return fsi_stream_probe(fsi, dev);
        }
 
-       tasklet_init(&io->tasklet, fsi_dma_do_tasklet, (unsigned long)io);
+       INIT_WORK(&io->work, fsi_dma_do_work);
 
        return 0;
 }
 
 static int fsi_dma_remove(struct fsi_priv *fsi, struct fsi_stream *io)
 {
-       tasklet_kill(&io->tasklet);
+       cancel_work_sync(&io->work);
 
        fsi_stream_stop(fsi, io);