[linux-dvb] Patch 2 / 50: code cleanup for bt878
Uwe Bugla
uwe.bugla at gmx.de
Fri Jun 23 16:34:08 CEST 2006
#Applies against: 2.6.17
#Signed-off-by: Uwe Bugla <uwe.bugla at gmx.de>
#Changes: update Email addresses, wipe out outcommented code, update module authorship
--- a/drivers/media/dvb/bt8xx/bt878.c 2006-05-27 14:03:00
+++ b/drivers/media/dvb/bt8xx/bt878.c 2006-05-29 12:12:00
@@ -1,32 +1,26 @@
/*
- * bt878.c: part of the driver for the Pinnacle PCTV Sat DVB PCI card
- *
+ * bt878.c: driver part for bt8xx DVB cards
* Copyright (C) 2002 Peter Hettkamp <peter.hettkamp at htp-tel.de>
- *
* large parts based on the bttv driver
* Copyright (C) 1996,97,98 Ralph Metzler (rjkm at metzlerbros.de)
* & Marcus Metzler (mocm at metzlerbros.de)
- * (c) 1999,2000 Gerd Knorr <kraxel at goldbach.in-berlin.de>
+ * (c) 1999,2000 Gerd Knorr <kraxel at bytesex.org>
- *
+
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* Or, point your browser to http://www.gnu.org/copyleft/gpl.html
- *
*/
-
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
@@ -40,15 +34,13 @@
#include <linux/kmod.h>
#include <linux/vmalloc.h>
#include <linux/init.h>
-
#include "dmxdev.h"
#include "dvbdev.h"
#include "bt878.h"
#include "dst_priv.h"
-
/**************************************/
-/* Miscellaneous utility definitions */
+/* Miscellaneous utility definitions */
/**************************************/
static unsigned int bt878_verbose = 1;
@@ -70,11 +64,9 @@
#define btwrite(dat,adr) bmtwrite((dat), (bt->bt878_mem+(adr)))
#define btread(adr) bmtread(bt->bt878_mem+(adr))
-
#define btand(dat,adr) btwrite((dat) & btread(adr), adr)
#define btor(dat,adr) btwrite((dat) | btread(adr), adr)
#define btaor(dat,mask,adr) btwrite((dat) | ((mask) & btread(adr)), adr)
-
#if defined(dprintk)
#undef dprintk
#endif
@@ -140,7 +132,6 @@
#define RISC_SYNC_RESYNC (1 << 15)
#define RISC_SYNC_FM1 0x06
#define RISC_SYNC_VRO 0x0C
-
#define RISC_FLUSH() bt->risc_pos = 0
#define RISC_INSTR(instr) bt->risc_cpu[bt->risc_pos++] = cpu_to_le32(instr)
@@ -218,24 +209,13 @@
bt878_risc_program(bt, op_sync_orin);
controlreg &= ~0x1f;
controlreg |= 0x1b;
-
btwrite(bt->risc_dma, BT878_ARISC_START);
-
- /* original int mask had :
- * 6 2 8 4 0
- * 1111 1111 1000 0000 0000
- * SCERR|OCERR|PABORT|RIPERR|FDSR|FTRGT|FBUS|RISCI
- * Hacked for DST to:
- * SCERR | OCERR | FDSR | FTRGT | FBUS | RISCI
- */
int_mask = BT878_ASCERR | BT878_AOCERR | BT878_APABORT |
BT878_ARIPERR | BT878_APPERR | BT878_AFDSR | BT878_AFTRGT |
BT878_AFBUS | BT878_ARISCI;
-
/* ignore pesky bits */
int_mask &= ~irq_err_ignore;
-
btwrite(int_mask, BT878_AINT_MASK);
btwrite(controlreg, BT878_AGPIO_DMA_CTL);
}
@@ -273,19 +253,14 @@
u32 stat, astat, mask;
int count;
struct bt878 *bt;
-
bt = (struct bt878 *) dev_id;
-
count = 0;
while (1) {
stat = btread(BT878_AINT_STAT);
mask = btread(BT878_AINT_MASK);
if (!(astat = (stat & mask)))
return IRQ_NONE; /* this interrupt is not for me */
-/* dprintk("bt878(%d) debug: irq count %d, stat 0x%8.8x, mask 0x%8.8x\n",bt->nr,count,stat,mask); */
btwrite(astat, BT878_AINT_STAT); /* try to clear interupt condition */
-
-
if (astat & (BT878_ASCERR | BT878_AOCERR)) {
if (bt878_verbose) {
printk("bt878(%d): irq%s%s risc_pc=%08x\n",
@@ -342,29 +317,24 @@
bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet *mp)
{
int retval;
-
retval = 0;
if (mutex_lock_interruptible(&bt->gpio_lock))
return -ERESTARTSYS;
/* special gpio signal */
switch (cmd) {
case DST_IG_ENABLE:
- // dprintk("dvb_bt8xx: dst enable mask 0x%02x enb 0x%02x \n", mp->dstg.enb.mask, mp->dstg.enb.enable);
retval = bttv_gpio_enable(bt->bttv_nr,
mp->enb.mask,
mp->enb.enable);
break;
case DST_IG_WRITE:
- // dprintk("dvb_bt8xx: dst write gpio mask 0x%02x out 0x%02x\n", mp->dstg.outp.mask, mp->dstg.outp.highvals);
retval = bttv_write_gpio(bt->bttv_nr,
mp->outp.mask,
mp->outp.highvals);
-
break;
case DST_IG_READ:
/* read */
retval = bttv_read_gpio(bt->bttv_nr, &mp->rd.value);
- // dprintk("dvb_bt8xx: dst read gpio 0x%02x\n", (unsigned)mp->dstg.rd.value);
break;
case DST_IG_TS:
/* Set packet size */
@@ -501,13 +471,6 @@
pci_set_master(dev);
pci_set_drvdata(dev, bt);
-
-/* if(init_bt878(btv) < 0) {
- bt878_remove(dev);
- return -EIO;
- }
-*/
-
if ((result = bt878_mem_alloc(bt))) {
printk("bt878: failed to allocate memory!\n");
goto fail2;
@@ -599,9 +562,6 @@
(BT878_VERSION_CODE >> 16) & 0xff,
(BT878_VERSION_CODE >> 8) & 0xff,
BT878_VERSION_CODE & 0xff);
-/*
- bt878_check_chipset();
-*/
/* later we register inside of bt878_find_audio_dma()
* because we may want to ignore certain cards */
bt878_pci_driver_registered = 1;
@@ -619,12 +579,5 @@
module_init(bt878_init_module);
module_exit(bt878_cleanup_module);
-
-//MODULE_AUTHOR("XXX");
+MODULE_AUTHOR("Peter Hettkamp, Gerd Knorr, Ralph & Marcus Metzler");
MODULE_LICENSE("GPL");
-
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
--
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
More information about the linux-dvb
mailing list