summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/b2c2/flexcop-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/b2c2/flexcop-pci.c')
-rw-r--r--linux/drivers/media/dvb/b2c2/flexcop-pci.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/linux/drivers/media/dvb/b2c2/flexcop-pci.c b/linux/drivers/media/dvb/b2c2/flexcop-pci.c
index cea47437a..cde8c67b7 100644
--- a/linux/drivers/media/dvb/b2c2/flexcop-pci.c
+++ b/linux/drivers/media/dvb/b2c2/flexcop-pci.c
@@ -2,7 +2,7 @@
* This file is part of linux driver the digital TV devices equipped with B2C2 FlexcopII(b)/III
*
* flexcop-pci.c - covers the PCI part including DMA transfers.
- *
+ *
* see flexcop.c for copyright information.
*/
@@ -41,7 +41,7 @@ struct flexcop_pci {
#define FC_PCI_INIT 0x01
#define FC_PCI_DMA_INIT 0x02
int init_state;
-
+
void __iomem *io_mem;
u32 irq;
/* buffersize (at least for DMA1, need to be % 188 == 0,
@@ -63,19 +63,19 @@ static flexcop_ibi_value flexcop_pci_read_ibi_reg (struct flexcop_device *fc, fl
struct flexcop_pci *fc_pci = fc->bus_specific;
flexcop_ibi_value v;
v.raw = readl(fc_pci->io_mem + r);
-
+
if (lastrreg != r || lastrval != v.raw) {
lastrreg = r; lastrval = v.raw;
deb_reg("new rd: %3x: %08x\n",r,v.raw);
}
-
+
return v;
}
static int flexcop_pci_write_ibi_reg(struct flexcop_device *fc, flexcop_ibi_register r, flexcop_ibi_value v)
{
struct flexcop_pci *fc_pci = fc->bus_specific;
-
+
if (lastwreg != r || lastwval != v.raw) {
lastwreg = r; lastwval = v.raw;
deb_reg("new wr: %3x: %08x\n",r,v.raw);
@@ -107,17 +107,17 @@ static irqreturn_t flexcop_pci_irq(int irq, void *dev_id, struct pt_regs *regs)
flexcop_pass_dmx_packets(fc_pci->fc_dev,fc_pci->dma[0].cpu_addr0,fc_pci->dma[0].size / 188);
else
flexcop_pass_dmx_packets(fc_pci->fc_dev,fc_pci->dma[0].cpu_addr1,fc_pci->dma[0].size / 188);
-
+
deb_irq("page change to page: %d\n",!fc_pci->active_dma1_addr);
fc_pci->active_dma1_addr = !fc_pci->active_dma1_addr;
} else if (v.irq_20c.DMA1_Timer_Status == 1) {
- /* for the timer IRQ we only can use buffer dmx feeding, because we don't have
+ /* for the timer IRQ we only can use buffer dmx feeding, because we don't have
* complete TS packets when reading from the DMA memory */
dma_addr_t cur_addr =
fc->read_ibi_reg(fc,dma1_008).dma_0x8.dma_cur_addr << 2;
u32 cur_pos = cur_addr - fc_pci->dma[0].dma_addr0;
- /* buffer end was reached, restarted from the beginning
+ /* buffer end was reached, restarted from the beginning
* pass the data from last_cur_pos to the buffer end to the demux
*/
if (cur_pos < fc_pci->last_dma1_cur_pos) {
@@ -125,8 +125,8 @@ static irqreturn_t flexcop_pci_irq(int irq, void *dev_id, struct pt_regs *regs)
fc_pci->dma[0].cpu_addr0 + fc_pci->last_dma1_cur_pos,
(fc_pci->dma[0].size*2 - 1) - fc_pci->last_dma1_cur_pos);
fc_pci->last_dma1_cur_pos = 0;
- }
-
+ }
+
if (cur_pos > fc_pci->last_dma1_cur_pos) {
flexcop_pass_dmx_data(fc_pci->fc_dev,
fc_pci->dma[0].cpu_addr0 + fc_pci->last_dma1_cur_pos,
@@ -140,7 +140,7 @@ static irqreturn_t flexcop_pci_irq(int irq, void *dev_id, struct pt_regs *regs)
* the data book is wrong, or I'm unable to read it correctly */
/* if (v.irq_20c.DMA1_Size_IRQ_Status == 1) { packet counter */
-
+
return IRQ_HANDLED;
}
@@ -159,10 +159,10 @@ static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff)
fc_pci->active_dma1_addr = 0;
flexcop_dma_control_size_irq(fc,FC_DMA_1,1);
}
-
+
/* flexcop_dma_config_packet_count(fc,FC_DMA_1,0xc0);
flexcop_dma_control_packet_irq(fc,FC_DMA_1,1); */
-
+
deb_irq("irqs enabled\n");
} else {
if (fc_pci->fc_dev->pid_filtering)
@@ -173,7 +173,7 @@ static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff)
// flexcop_dma_control_packet_irq(fc,FC_DMA_1,0);
deb_irq("irqs disabled\n");
}
-
+
return 0;
}
@@ -188,7 +188,7 @@ static int flexcop_pci_dma_init(struct flexcop_pci *fc_pci)
flexcop_sram_set_dest(fc_pci->fc_dev,FC_SRAM_DEST_MEDIA | FC_SRAM_DEST_NET, FC_SRAM_DEST_TARGET_DMA1);
flexcop_sram_set_dest(fc_pci->fc_dev,FC_SRAM_DEST_CAO | FC_SRAM_DEST_CAI, FC_SRAM_DEST_TARGET_DMA2);
-
+
fc_pci->init_state |= FC_PCI_DMA_INIT;
goto success;
dma1_free:
@@ -211,7 +211,7 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
{
int ret;
u8 card_rev;
-
+
pci_read_config_byte(fc_pci->pdev, PCI_CLASS_REVISION, &card_rev);
info("card revision %x", card_rev);
@@ -225,7 +225,7 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
if ((ret = pci_request_regions(fc_pci->pdev, DRIVER_NAME)) != 0)
goto err_pci_disable_device;
-
+
fc_pci->io_mem = pci_iomap(fc_pci->pdev, 0, 0x800);
if (!fc_pci->io_mem) {
@@ -233,13 +233,13 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
ret = -EIO;
goto err_pci_release_regions;
}
-
+
pci_set_drvdata(fc_pci->pdev, fc_pci);
if ((ret = request_irq(fc_pci->pdev->irq, flexcop_pci_irq,
- SA_SHIRQ, DRIVER_NAME, fc_pci)) != 0)
+ SA_SHIRQ, DRIVER_NAME, fc_pci)) != 0)
goto err_pci_iounmap;
-
+
fc_pci->init_state |= FC_PCI_INIT;
goto success;
@@ -250,7 +250,7 @@ err_pci_release_regions:
pci_release_regions(fc_pci->pdev);
err_pci_disable_device:
pci_disable_device(fc_pci->pdev);
-
+
success:
return ret;
}
@@ -287,14 +287,14 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
fc->write_ibi_reg = flexcop_pci_write_ibi_reg;
fc->i2c_request = flexcop_i2c_request;
fc->get_mac_addr = flexcop_eeprom_check_mac_addr;
-
+
fc->stream_control = flexcop_pci_stream_control;
fc->pid_filtering = enable_pid_filtering;
fc->bus_type = FC_PCI;
fc->dev = &pdev->dev;
-
+
/* bus specific part */
fc_pci->pdev = pdev;
if ((ret = flexcop_pci_init(fc_pci)) != 0)
@@ -303,7 +303,7 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
/* init flexcop */
if ((ret = flexcop_device_initialize(fc)) != 0)
goto err_pci_exit;
-
+
/* init dma */
if ((ret = flexcop_pci_dma_init(fc_pci)) != 0)
goto err_fc_exit;