Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334464
b: refs/heads/master
c: 57451e4
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mark Brown committed Oct 9, 2012
1 parent ab032dc commit 0595890
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a92b078eab17d09ac600446954d8b0d7998c6168
refs/heads/master: 57451e437796548d658d03c2c4aab659eafcd799
15 changes: 8 additions & 7 deletions trunk/sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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/sh_fsi.h>

Expand Down Expand Up @@ -223,7 +224,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;
};

Expand Down Expand Up @@ -1085,9 +1086,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;
Expand Down Expand Up @@ -1129,7 +1130,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.
Expand All @@ -1153,7 +1154,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;
}
Expand Down Expand Up @@ -1195,14 +1196,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);

Expand Down

0 comments on commit 0595890

Please sign in to comment.