[PATCH V1 2/3] Rename the PSC functions to DMA
Rename the functions in the mpc5200 DMA file from i2s to dma to reflect the file they are in. Signed-off-by: Jon Smirl jonsm...@gmail.com --- sound/soc/fsl/mpc5200_dma.c | 194 --- sound/soc/fsl/mpc5200_dma.h | 26 +++-- sound/soc/fsl/mpc5200_psc_i2s.c | 160 3 files changed, 190 insertions(+), 190 deletions(-) diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index cccaff4..c82ef75 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -34,21 +34,21 @@ MODULE_LICENSE(GPL); /* * Interrupt handlers */ -static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) +static irqreturn_t psc_dma_status_irq(int irq, void *_psc_dma) { - struct psc_i2s *psc_i2s = _psc_i2s; - struct mpc52xx_psc __iomem *regs = psc_i2s-psc_regs; + struct psc_dma *psc_dma = _psc_dma; + struct mpc52xx_psc __iomem *regs = psc_dma-psc_regs; u16 isr; isr = in_be16(regs-mpc52xx_psc_isr); /* Playback underrun error */ - if (psc_i2s-playback.active (isr MPC52xx_PSC_IMR_TXEMP)) - psc_i2s-stats.underrun_count++; + if (psc_dma-playback.active (isr MPC52xx_PSC_IMR_TXEMP)) + psc_dma-stats.underrun_count++; /* Capture overrun error */ - if (psc_i2s-capture.active (isr MPC52xx_PSC_IMR_ORERR)) - psc_i2s-stats.overrun_count++; + if (psc_dma-capture.active (isr MPC52xx_PSC_IMR_ORERR)) + psc_dma-stats.overrun_count++; out_8(regs-command, 4 4); /* reset the error status */ @@ -56,7 +56,7 @@ static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) } /** - * psc_i2s_bcom_enqueue_next_buffer - Enqueue another audio buffer + * psc_dma_bcom_enqueue_next_buffer - Enqueue another audio buffer * @s: pointer to stream private data structure * * Enqueues another audio period buffer into the bestcomm queue. @@ -65,7 +65,7 @@ static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) * the queue. Otherwise the enqueue will fail and the audio ring buffer * will get out of sync */ -static void psc_i2s_bcom_enqueue_next_buffer(struct psc_i2s_stream *s) +static void psc_dma_bcom_enqueue_next_buffer(struct psc_dma_stream *s) { struct bcom_bd *bd; @@ -82,9 +82,9 @@ static void psc_i2s_bcom_enqueue_next_buffer(struct psc_i2s_stream *s) } /* Bestcomm DMA irq handler */ -static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) +static irqreturn_t psc_dma_bcom_irq(int irq, void *_psc_dma_stream) { - struct psc_i2s_stream *s = _psc_i2s_stream; + struct psc_dma_stream *s = _psc_dma_stream; /* For each finished period, dequeue the completed period buffer * and enqueue a new one in it's place. */ @@ -93,7 +93,7 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) s-period_current_pt += s-period_bytes; if (s-period_current_pt = s-period_end) s-period_current_pt = s-period_start; - psc_i2s_bcom_enqueue_next_buffer(s); + psc_dma_bcom_enqueue_next_buffer(s); bcom_enable(s-bcom_task); } @@ -106,39 +106,39 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) } /** - * psc_i2s_startup: create a new substream + * psc_dma_startup: create a new substream * * This is the first function called when a stream is opened. * * If this is the first stream open, then grab the IRQ and program most of * the PSC registers. */ -int psc_i2s_startup(struct snd_pcm_substream *substream, +int psc_dma_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream-private_data; - struct psc_i2s *psc_i2s = rtd-dai-cpu_dai-private_data; + struct psc_dma *psc_dma = rtd-dai-cpu_dai-private_data; int rc; - dev_dbg(psc_i2s-dev, psc_i2s_startup(substream=%p)\n, substream); + dev_dbg(psc_dma-dev, psc_dma_startup(substream=%p)\n, substream); - if (!psc_i2s-playback.active - !psc_i2s-capture.active) { + if (!psc_dma-playback.active + !psc_dma-capture.active) { /* Setup the IRQs */ - rc = request_irq(psc_i2s-irq, psc_i2s_status_irq, IRQF_SHARED, -psc-i2s-status, psc_i2s); - rc |= request_irq(psc_i2s-capture.irq, - psc_i2s_bcom_irq, IRQF_SHARED, - psc-i2s-capture, psc_i2s-capture); - rc |= request_irq(psc_i2s-playback.irq, - psc_i2s_bcom_irq, IRQF_SHARED, - psc-i2s-playback, psc_i2s-playback); + rc = request_irq(psc_dma-irq, psc_dma_status_irq, IRQF_SHARED, +
Re: [PATCH V1 2/3] Rename the PSC functions to DMA
On Sun, Apr 26, 2009 at 1:53 PM, Jon Smirl jonsm...@gmail.com wrote: Rename the functions in the mpc5200 DMA file from i2s to dma to reflect the file they are in. Signed-off-by: Jon Smirl jonsm...@gmail.com Acked-by: Grant Likely grant.lik...@secretlab.ca --- sound/soc/fsl/mpc5200_dma.c | 194 --- sound/soc/fsl/mpc5200_dma.h | 26 +++-- sound/soc/fsl/mpc5200_psc_i2s.c | 160 3 files changed, 190 insertions(+), 190 deletions(-) diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index cccaff4..c82ef75 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -34,21 +34,21 @@ MODULE_LICENSE(GPL); /* * Interrupt handlers */ -static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) +static irqreturn_t psc_dma_status_irq(int irq, void *_psc_dma) { - struct psc_i2s *psc_i2s = _psc_i2s; - struct mpc52xx_psc __iomem *regs = psc_i2s-psc_regs; + struct psc_dma *psc_dma = _psc_dma; + struct mpc52xx_psc __iomem *regs = psc_dma-psc_regs; u16 isr; isr = in_be16(regs-mpc52xx_psc_isr); /* Playback underrun error */ - if (psc_i2s-playback.active (isr MPC52xx_PSC_IMR_TXEMP)) - psc_i2s-stats.underrun_count++; + if (psc_dma-playback.active (isr MPC52xx_PSC_IMR_TXEMP)) + psc_dma-stats.underrun_count++; /* Capture overrun error */ - if (psc_i2s-capture.active (isr MPC52xx_PSC_IMR_ORERR)) - psc_i2s-stats.overrun_count++; + if (psc_dma-capture.active (isr MPC52xx_PSC_IMR_ORERR)) + psc_dma-stats.overrun_count++; out_8(regs-command, 4 4); /* reset the error status */ @@ -56,7 +56,7 @@ static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) } /** - * psc_i2s_bcom_enqueue_next_buffer - Enqueue another audio buffer + * psc_dma_bcom_enqueue_next_buffer - Enqueue another audio buffer * @s: pointer to stream private data structure * * Enqueues another audio period buffer into the bestcomm queue. @@ -65,7 +65,7 @@ static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) * the queue. Otherwise the enqueue will fail and the audio ring buffer * will get out of sync */ -static void psc_i2s_bcom_enqueue_next_buffer(struct psc_i2s_stream *s) +static void psc_dma_bcom_enqueue_next_buffer(struct psc_dma_stream *s) { struct bcom_bd *bd; @@ -82,9 +82,9 @@ static void psc_i2s_bcom_enqueue_next_buffer(struct psc_i2s_stream *s) } /* Bestcomm DMA irq handler */ -static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) +static irqreturn_t psc_dma_bcom_irq(int irq, void *_psc_dma_stream) { - struct psc_i2s_stream *s = _psc_i2s_stream; + struct psc_dma_stream *s = _psc_dma_stream; /* For each finished period, dequeue the completed period buffer * and enqueue a new one in it's place. */ @@ -93,7 +93,7 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) s-period_current_pt += s-period_bytes; if (s-period_current_pt = s-period_end) s-period_current_pt = s-period_start; - psc_i2s_bcom_enqueue_next_buffer(s); + psc_dma_bcom_enqueue_next_buffer(s); bcom_enable(s-bcom_task); } @@ -106,39 +106,39 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) } /** - * psc_i2s_startup: create a new substream + * psc_dma_startup: create a new substream * * This is the first function called when a stream is opened. * * If this is the first stream open, then grab the IRQ and program most of * the PSC registers. */ -int psc_i2s_startup(struct snd_pcm_substream *substream, +int psc_dma_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream-private_data; - struct psc_i2s *psc_i2s = rtd-dai-cpu_dai-private_data; + struct psc_dma *psc_dma = rtd-dai-cpu_dai-private_data; int rc; - dev_dbg(psc_i2s-dev, psc_i2s_startup(substream=%p)\n, substream); + dev_dbg(psc_dma-dev, psc_dma_startup(substream=%p)\n, substream); - if (!psc_i2s-playback.active - !psc_i2s-capture.active) { + if (!psc_dma-playback.active + !psc_dma-capture.active) { /* Setup the IRQs */ - rc = request_irq(psc_i2s-irq, psc_i2s_status_irq, IRQF_SHARED, - psc-i2s-status, psc_i2s); - rc |= request_irq(psc_i2s-capture.irq, - psc_i2s_bcom_irq, IRQF_SHARED, - psc-i2s-capture, psc_i2s-capture); - rc |= request_irq(psc_i2s-playback.irq, - psc_i2s_bcom_irq,
Re: [PATCH V1 2/3] Rename the PSC functions to DMA
On Sun, Apr 26, 2009 at 10:04 PM, Grant Likely grant.lik...@secretlab.ca wrote: On Sun, Apr 26, 2009 at 1:53 PM, Jon Smirl jonsm...@gmail.com wrote: Rename the functions in the mpc5200 DMA file from i2s to dma to reflect the file they are in. Signed-off-by: Jon Smirl jonsm...@gmail.com Acked-by: Grant Likely grant.lik...@secretlab.ca Okay, I've taken a second look now (as per my comment on 3/3), and yes, I'm still okay with the name changes because the header file scope is restricted. If this header was in include/linux/, then I'd say the prefix should be more specific. g. --- sound/soc/fsl/mpc5200_dma.c | 194 --- sound/soc/fsl/mpc5200_dma.h | 26 +++-- sound/soc/fsl/mpc5200_psc_i2s.c | 160 3 files changed, 190 insertions(+), 190 deletions(-) diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index cccaff4..c82ef75 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -34,21 +34,21 @@ MODULE_LICENSE(GPL); /* * Interrupt handlers */ -static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) +static irqreturn_t psc_dma_status_irq(int irq, void *_psc_dma) { - struct psc_i2s *psc_i2s = _psc_i2s; - struct mpc52xx_psc __iomem *regs = psc_i2s-psc_regs; + struct psc_dma *psc_dma = _psc_dma; + struct mpc52xx_psc __iomem *regs = psc_dma-psc_regs; u16 isr; isr = in_be16(regs-mpc52xx_psc_isr); /* Playback underrun error */ - if (psc_i2s-playback.active (isr MPC52xx_PSC_IMR_TXEMP)) - psc_i2s-stats.underrun_count++; + if (psc_dma-playback.active (isr MPC52xx_PSC_IMR_TXEMP)) + psc_dma-stats.underrun_count++; /* Capture overrun error */ - if (psc_i2s-capture.active (isr MPC52xx_PSC_IMR_ORERR)) - psc_i2s-stats.overrun_count++; + if (psc_dma-capture.active (isr MPC52xx_PSC_IMR_ORERR)) + psc_dma-stats.overrun_count++; out_8(regs-command, 4 4); /* reset the error status */ @@ -56,7 +56,7 @@ static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) } /** - * psc_i2s_bcom_enqueue_next_buffer - Enqueue another audio buffer + * psc_dma_bcom_enqueue_next_buffer - Enqueue another audio buffer * @s: pointer to stream private data structure * * Enqueues another audio period buffer into the bestcomm queue. @@ -65,7 +65,7 @@ static irqreturn_t psc_i2s_status_irq(int irq, void *_psc_i2s) * the queue. Otherwise the enqueue will fail and the audio ring buffer * will get out of sync */ -static void psc_i2s_bcom_enqueue_next_buffer(struct psc_i2s_stream *s) +static void psc_dma_bcom_enqueue_next_buffer(struct psc_dma_stream *s) { struct bcom_bd *bd; @@ -82,9 +82,9 @@ static void psc_i2s_bcom_enqueue_next_buffer(struct psc_i2s_stream *s) } /* Bestcomm DMA irq handler */ -static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) +static irqreturn_t psc_dma_bcom_irq(int irq, void *_psc_dma_stream) { - struct psc_i2s_stream *s = _psc_i2s_stream; + struct psc_dma_stream *s = _psc_dma_stream; /* For each finished period, dequeue the completed period buffer * and enqueue a new one in it's place. */ @@ -93,7 +93,7 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) s-period_current_pt += s-period_bytes; if (s-period_current_pt = s-period_end) s-period_current_pt = s-period_start; - psc_i2s_bcom_enqueue_next_buffer(s); + psc_dma_bcom_enqueue_next_buffer(s); bcom_enable(s-bcom_task); } @@ -106,39 +106,39 @@ static irqreturn_t psc_i2s_bcom_irq(int irq, void *_psc_i2s_stream) } /** - * psc_i2s_startup: create a new substream + * psc_dma_startup: create a new substream * * This is the first function called when a stream is opened. * * If this is the first stream open, then grab the IRQ and program most of * the PSC registers. */ -int psc_i2s_startup(struct snd_pcm_substream *substream, +int psc_dma_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = substream-private_data; - struct psc_i2s *psc_i2s = rtd-dai-cpu_dai-private_data; + struct psc_dma *psc_dma = rtd-dai-cpu_dai-private_data; int rc; - dev_dbg(psc_i2s-dev, psc_i2s_startup(substream=%p)\n, substream); + dev_dbg(psc_dma-dev, psc_dma_startup(substream=%p)\n, substream); - if (!psc_i2s-playback.active - !psc_i2s-capture.active) { + if (!psc_dma-playback.active + !psc_dma-capture.active) { /* Setup the IRQs */ - rc = request_irq(psc_i2s-irq, psc_i2s_status_irq, IRQF_SHARED, -