Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316195
b: refs/heads/master
c: 5514efd
h: refs/heads/master
i:
  316193: e3f387b
  316191: e44d201
v: v3
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Jun 3, 2012
1 parent ce078b3 commit d7dfdab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 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: 01a0c1139c2bd075d005253093e7060022c5d0cb
refs/heads/master: 5514efdfe0384576ef38c66b1672b6826696fbf3
19 changes: 4 additions & 15 deletions trunk/sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,13 +1089,10 @@ static void fsi_dma_do_tasklet(unsigned long data)
{
struct fsi_stream *io = (struct fsi_stream *)data;
struct fsi_priv *fsi = fsi_stream_to_priv(io);
struct dma_chan *chan;
struct snd_soc_dai *dai;
struct dma_async_tx_descriptor *desc;
struct scatterlist sg;
struct snd_pcm_runtime *runtime;
enum dma_data_direction dir;
dma_cookie_t cookie;
int is_play = fsi_stream_is_play(fsi, io);
int len;
dma_addr_t buf;
Expand All @@ -1104,22 +1101,15 @@ static void fsi_dma_do_tasklet(unsigned long data)
return;

dai = fsi_get_dai(io->substream);
chan = io->chan;
runtime = io->substream->runtime;
dir = is_play ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
len = samples_to_bytes(runtime, io->period_samples);
buf = fsi_dma_get_area(io);

dma_sync_single_for_device(dai->dev, buf, len, dir);

sg_init_table(&sg, 1);
sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf)),
len , offset_in_page(buf));
sg_dma_address(&sg) = buf;
sg_dma_len(&sg) = len;

desc = dmaengine_prep_slave_sg(chan, &sg, 1, dir,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
desc = dmaengine_prep_slave_single(io->chan, buf, len, dir,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc) {
dev_err(dai->dev, "dmaengine_prep_slave_sg() fail\n");
return;
Expand All @@ -1128,13 +1118,12 @@ static void fsi_dma_do_tasklet(unsigned long data)
desc->callback = fsi_dma_complete;
desc->callback_param = io;

cookie = desc->tx_submit(desc);
if (cookie < 0) {
if (dmaengine_submit(desc) < 0) {
dev_err(dai->dev, "tx_submit() fail\n");
return;
}

dma_async_issue_pending(chan);
dma_async_issue_pending(io->chan);

/*
* FIXME
Expand Down

0 comments on commit d7dfdab

Please sign in to comment.