ASoC: fsi: Add fsi_dma_get_area
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 17 Sep 2010 04:48:05 +0000 (13:48 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sun, 19 Sep 2010 15:10:54 +0000 (16:10 +0100)
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/sh/fsi.c

index c8a8ddb245aacd6f344b5493e718f832db7b9132..aea5adb54e38f13620a8e9487e0a11dac980a13a 100644 (file)
@@ -357,6 +357,11 @@ static int fsi_get_fifo_residue(struct fsi_priv *fsi, int is_play)
        return residue;
 }
 
+static u8 *fsi_dma_get_area(struct fsi_priv *fsi)
+{
+       return fsi->substream->runtime->dma_area + fsi->byte_offset;
+}
+
 /************************************************************************
 
 
@@ -550,8 +555,7 @@ static int fsi_data_push(struct fsi_priv *fsi, int startup)
        if (fifo_free < send)
                send = fifo_free;
 
-       start = runtime->dma_area;
-       start += fsi->byte_offset;
+       start = fsi_dma_get_area(fsi);
 
        switch (width) {
        case 2:
@@ -633,8 +637,7 @@ static int fsi_data_pop(struct fsi_priv *fsi, int startup)
        if (free < fifo_fill)
                fifo_fill = free;
 
-       start = runtime->dma_area;
-       start += fsi->byte_offset;
+       start = fsi_dma_get_area(fsi);
 
        switch (width) {
        case 2: