aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/b2c2/flexcop-dma.c
diff options
context:
space:
mode:
authorUwe Bugla <uwe.bugla@gmx.de>2009-03-29 06:46:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:47 -0400
commit1589a993f074124c3edfff03656e910bb472eeaa (patch)
treea4be3dc715f569de56014a3b23b6171e09ae3639 /drivers/media/dvb/b2c2/flexcop-dma.c
parent7def728f558c99489cc89f4c5d62dd64dc0289b4 (diff)
V4L/DVB (11287): Code cleanup (passes checkpatch now) of the b2c2-flexcop-drivers 1/2
This patch cleans up the source code of the b2c2 flexcop-driver. It is the first of a total of two. The code is now passing the checkpatch-script. Signed-off-by: Uwe Bugla <uwe.bugla@gmx.de> Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/b2c2/flexcop-dma.c')
-rw-r--r--drivers/media/dvb/b2c2/flexcop-dma.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-dma.c b/drivers/media/dvb/b2c2/flexcop-dma.c
index 26f0011a5078..2881e0d956ad 100644
--- a/drivers/media/dvb/b2c2/flexcop-dma.c
+++ b/drivers/media/dvb/b2c2/flexcop-dma.c
@@ -1,13 +1,12 @@
1/* 1/*
2 * This file is part of linux driver the digital TV devices equipped with B2C2 FlexcopII(b)/III 2 * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
3 * 3 * flexcop-dma.c - configuring and controlling the DMA of the FlexCop
4 * flexcop-dma.c - methods for configuring and controlling the DMA of the FlexCop. 4 * see flexcop.c for copyright information
5 *
6 * see flexcop.c for copyright information.
7 */ 5 */
8#include "flexcop.h" 6#include "flexcop.h"
9 7
10int flexcop_dma_allocate(struct pci_dev *pdev, struct flexcop_dma *dma, u32 size) 8int flexcop_dma_allocate(struct pci_dev *pdev,
9 struct flexcop_dma *dma, u32 size)
11{ 10{
12 u8 *tcpu; 11 u8 *tcpu;
13 dma_addr_t tdma = 0; 12 dma_addr_t tdma = 0;
@@ -32,7 +31,8 @@ EXPORT_SYMBOL(flexcop_dma_allocate);
32 31
33void flexcop_dma_free(struct flexcop_dma *dma) 32void flexcop_dma_free(struct flexcop_dma *dma)
34{ 33{
35 pci_free_consistent(dma->pdev, dma->size*2,dma->cpu_addr0, dma->dma_addr0); 34 pci_free_consistent(dma->pdev, dma->size*2,
35 dma->cpu_addr0, dma->dma_addr0);
36 memset(dma,0,sizeof(struct flexcop_dma)); 36 memset(dma,0,sizeof(struct flexcop_dma));
37} 37}
38EXPORT_SYMBOL(flexcop_dma_free); 38EXPORT_SYMBOL(flexcop_dma_free);
@@ -44,8 +44,8 @@ int flexcop_dma_config(struct flexcop_device *fc,
44 flexcop_ibi_value v0x0,v0x4,v0xc; 44 flexcop_ibi_value v0x0,v0x4,v0xc;
45 v0x0.raw = v0x4.raw = v0xc.raw = 0; 45 v0x0.raw = v0x4.raw = v0xc.raw = 0;
46 46
47 v0x0.dma_0x0.dma_address0 = dma->dma_addr0 >> 2; 47 v0x0.dma_0x0.dma_address0 = dma->dma_addr0 >> 2;
48 v0xc.dma_0xc.dma_address1 = dma->dma_addr1 >> 2; 48 v0xc.dma_0xc.dma_address1 = dma->dma_addr1 >> 2;
49 v0x4.dma_0x4_write.dma_addr_size = dma->size / 4; 49 v0x4.dma_0x4_write.dma_addr_size = dma->size / 4;
50 50
51 if ((dma_idx & FC_DMA_1) == dma_idx) { 51 if ((dma_idx & FC_DMA_1) == dma_idx) {
@@ -57,7 +57,8 @@ int flexcop_dma_config(struct flexcop_device *fc,
57 fc->write_ibi_reg(fc,dma2_014,v0x4); 57 fc->write_ibi_reg(fc,dma2_014,v0x4);
58 fc->write_ibi_reg(fc,dma2_01c,v0xc); 58 fc->write_ibi_reg(fc,dma2_01c,v0xc);
59 } else { 59 } else {
60 err("either DMA1 or DMA2 can be configured at the within one flexcop_dma_config call."); 60 err("either DMA1 or DMA2 can be configured within one "
61 "flexcop_dma_config call.");
61 return -EINVAL; 62 return -EINVAL;
62 } 63 }
63 64
@@ -81,7 +82,8 @@ int flexcop_dma_xfer_control(struct flexcop_device *fc,
81 r0x0 = dma2_010; 82 r0x0 = dma2_010;
82 r0xc = dma2_01c; 83 r0xc = dma2_01c;
83 } else { 84 } else {
84 err("either transfer DMA1 or DMA2 can be started within one flexcop_dma_xfer_control call."); 85 err("either transfer DMA1 or DMA2 can be started within one "
86 "flexcop_dma_xfer_control call.");
85 return -EINVAL; 87 return -EINVAL;
86 } 88 }
87 89
@@ -154,8 +156,7 @@ EXPORT_SYMBOL(flexcop_dma_control_timer_irq);
154 156
155/* 1 cycles = 1.97 msec */ 157/* 1 cycles = 1.97 msec */
156int flexcop_dma_config_timer(struct flexcop_device *fc, 158int flexcop_dma_config_timer(struct flexcop_device *fc,
157 flexcop_dma_index_t dma_idx, 159 flexcop_dma_index_t dma_idx, u8 cycles)
158 u8 cycles)
159{ 160{
160 flexcop_ibi_register r = (dma_idx & FC_DMA_1) ? dma1_004 : dma2_014; 161 flexcop_ibi_register r = (dma_idx & FC_DMA_1) ? dma1_004 : dma2_014;
161 flexcop_ibi_value v = fc->read_ibi_reg(fc,r); 162 flexcop_ibi_value v = fc->read_ibi_reg(fc,r);