summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2004-09-20 16:37:45 +0000
committerMichael Hunold <devnull@localhost>2004-09-20 16:37:45 +0000
commit61c72c4891a94b8377b55b655c8253c0ce500f08 (patch)
tree95498cf0fcf6821a9d9548c972424fea3d0f2504 /linux
parentf81e5554d91ce28da5a7c83c3a12772da8782f5f (diff)
downloadmediapointer-dvb-s2-61c72c4891a94b8377b55b655c8253c0ce500f08.tar.gz
mediapointer-dvb-s2-61c72c4891a94b8377b55b655c8253c0ce500f08.tar.bz2
- remove stupid DEB_* debugging macro horror from av7110 and budget drivers, replace them
with dprintk(level, msg) instead - remove whitespace and linefeed violations all over the place
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c109
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.h5
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_av.c62
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_ca.c12
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.c98
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_ir.c9
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_v4l.c70
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-av.c43
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-ci.c22
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-core.c26
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-patch.c25
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.c17
-rw-r--r--linux/drivers/media/dvb/ttpci/budget.h9
13 files changed, 216 insertions, 291 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 74681b903..d0fb0c602 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -67,7 +67,8 @@
#include "av7110_ca.h"
#include "av7110_ipack.h"
-static int av7110_debug;
+int av7110_debug;
+
static int vidmode = CVBS_RGB_OUT;
static int pids_off;
static int adac = DVB_ADAC_TI;
@@ -110,7 +111,7 @@ static void init_av7110_av(struct av7110 *av7110)
av7110->has_analog_tuner = 0;
av7110->current_input = 0;
if (i2c_writereg(av7110, 0x20, 0x00, 0x00) == 1) {
- printk ("av7110(%d): Crystal audio DAC detected\n",
+ printk ("dvb-ttpci: Crystal audio DAC @ card %d detected\n",
av7110->dvb_adapter->num);
av7110->adac_type = DVB_ADAC_CRYSTAL;
i2c_writereg(av7110, 0x20, 0x01, 0xd2);
@@ -125,13 +126,13 @@ static void init_av7110_av(struct av7110 *av7110)
/* done. */
}
else if (dev->pci->subsystem_vendor == 0x110a) {
- printk("av7110(%d): DVB-C w/o analog module detected\n",
+ printk("dvb-ttpci: DVB-C w/o analog module @ card %d detected\n",
av7110->dvb_adapter->num);
av7110->adac_type = DVB_ADAC_NONE;
}
else {
av7110->adac_type = adac;
- printk("av7110(%d): adac type set to %d\n",
+ printk("dvb-ttpci: adac type set to %d @ card %d\n",
av7110->dvb_adapter->num, av7110->adac_type);
}
@@ -150,7 +151,7 @@ static void init_av7110_av(struct av7110 *av7110)
static void recover_arm(struct av7110 *av7110)
{
- DEB_EE(("av7110: %p\n",av7110));
+ dprintk(4, "%p\n",av7110);
av7110_bootarm(av7110);
msleep(100);
@@ -160,7 +161,7 @@ static void recover_arm(struct av7110 *av7110)
static void arm_error(struct av7110 *av7110)
{
- DEB_EE(("av7110: %p\n",av7110));
+ dprintk(4, "%p\n",av7110);
av7110->arm_errors++;
av7110->arm_ready = 0;
@@ -173,7 +174,7 @@ static int arm_thread(void *data)
u16 newloops = 0;
int timeout;
- DEB_EE(("av7110: %p\n",av7110));
+ dprintk(4, "%p\n",av7110);
lock_kernel ();
daemonize ("arm_mon");
@@ -199,7 +200,7 @@ static int arm_thread(void *data)
up(&av7110->dcomlock);
if (newloops == av7110->arm_loops) {
- printk(KERN_ERR "av7110%d: ARM crashed!\n",
+ printk(KERN_ERR "dvb-ttpci: ARM crashed @ card %d\n",
av7110->dvb_adapter->num);
arm_error(av7110);
@@ -231,7 +232,7 @@ void av7110_setup_irc_config(struct av7110 *av7110, u32 ir_config)
{
static struct av7110 *last;
- DEB_EE(("av7110: %p\n",av7110));
+ dprintk(4, "%p\n",av7110);
if (!av7110)
av7110 = last;
@@ -248,13 +249,13 @@ static void (*irc_handler)(u32);
void av7110_register_irc_handler(void (*func)(u32))
{
- DEB_EE(("registering %p\n", func));
+ dprintk(4, "registering %p\n", func);
irc_handler = func;
}
void av7110_unregister_irc_handler(void (*func)(u32))
{
- DEB_EE(("unregistering %p\n", func));
+ dprintk(4, "unregistering %p\n", func);
irc_handler = NULL;
}
@@ -268,7 +269,7 @@ DECLARE_TASKLET(irtask, run_handlers, 0);
void IR_handle(struct av7110 *av7110, u32 ircom)
{
- DEB_S(("av7110: ircommand = %08x\n", ircom));
+ dprintk(4, "ircommand = %08x\n", ircom);
irtask.data = (unsigned long) ircom;
tasklet_schedule(&irtask);
}
@@ -283,8 +284,6 @@ static inline int DvbDmxFilterCallback(u8 * buffer1, size_t buffer1_len,
enum dmx_success success,
struct av7110 *av7110)
{
- DEB_INT(("av7110: %p\n", av7110));
-
if (!dvbdmxfilter->feed->demux->dmx.frontend)
return 0;
if (dvbdmxfilter->feed->demux->dmx.frontend->source == DMX_MEMORY_FE)
@@ -344,7 +343,7 @@ static void debiirq (unsigned long data)
int type = av7110->debitype;
int handle = (type >> 8) & 0x1f;
-// DEB_EE(("av7110: %p\n",av7110));
+// dprintk(4, "%p\n",av7110);
print_time("debi");
saa7146_write(av7110->dev, IER,
@@ -476,10 +475,8 @@ static void gpioirq (unsigned long data)
u32 rxbuf, txbuf;
int len;
- //printk("GPIO0 irq\n");
-
if (av7110->debitype !=-1)
- printk("GPIO0 irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",
+ printk("dvb-ttpci: GPIO0 irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n",
jiffies, saa7146_read(av7110->dev, PSR),
saa7146_read(av7110->dev, SSR));
@@ -497,10 +494,10 @@ static void gpioirq (unsigned long data)
txbuf = irdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2);
len = (av7110->debilen + 3) & ~3;
-// DEB_D(("GPIO0 irq %d %d\n", av7110->debitype, av7110->debilen));
+// dprintk(8, "GPIO0 irq %d %d\n", av7110->debitype, av7110->debilen);
print_time("gpio");
-// DEB_D(("GPIO0 irq %02x\n", av7110->debitype&0xff));
+// dprintk(8, "GPIO0 irq %02x\n", av7110->debitype&0xff);
switch (av7110->debitype & 0xff) {
case DATA_TS_PLAY:
@@ -519,10 +516,10 @@ static void gpioirq (unsigned long data)
iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2);
av7110->video_size.h = h_ar & 0xfff;
- DEB_D(("GPIO0 irq: DATA_MPEG_VIDEO_EVENT: w/h/ar = %u/%u/%u\n",
+ dprintk(8, "GPIO0 irq: DATA_MPEG_VIDEO_EVENT: w/h/ar = %u/%u/%u\n",
av7110->video_size.w,
av7110->video_size.h,
- av7110->video_size.aspect_ratio));
+ av7110->video_size.aspect_ratio);
event.type = VIDEO_EVENT_SIZE_CHANGED;
event.u.size.w = av7110->video_size.w;
@@ -610,7 +607,7 @@ static void gpioirq (unsigned long data)
iwdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2);
break;
}
- DEB_D(("GPIO0 PES_PLAY len=%04x\n", len));
+ dprintk(8, "GPIO0 PES_PLAY len=%04x\n", len);
iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2);
iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, len, 2);
saa7146_wait_for_debi_done(av7110->dev);
@@ -688,7 +685,7 @@ static void gpioirq (unsigned long data)
break;
default:
- printk("gpioirq unknown type=%d len=%d\n",
+ printk("dvb-ttpci: gpioirq unknown type=%d len=%d\n",
av7110->debitype, av7110->debilen);
break;
}
@@ -705,7 +702,7 @@ static int dvb_osd_ioctl(struct inode *inode, struct file *file,
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (cmd == OSD_SEND_CMD)
return av7110_osd_cmd(av7110, (osd_cmd_t *) parg);
@@ -736,7 +733,7 @@ static struct dvb_device dvbdev_osd = {
static inline int SetPIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
u16 subpid, u16 pcrpid)
{
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (vpid == 0x1fff || apid == 0x1fff ||
ttpid == 0x1fff || subpid == 0x1fff || pcrpid == 0x1fff) {
@@ -754,7 +751,7 @@ static inline int SetPIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
void ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
u16 subpid, u16 pcrpid)
{
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (down_interruptible(&av7110->pid_mutex))
return;
@@ -793,7 +790,7 @@ static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter)
// u16 mode=0x0320;
u16 mode=0xb96a;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (dvbdmxfilter->type == DMX_TYPE_SEC) {
if (hw_sections) {
@@ -817,7 +814,7 @@ static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter)
ret = av7110_fw_request(av7110, buf, 20, &handle, 1);
if (ret < 0) {
- printk("StartHWFilter error\n");
+ dprintk(1, "StartHWFilter error\n");
return ret;
}
@@ -835,13 +832,11 @@ static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter)
int ret;
u16 handle;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
handle = dvbdmxfilter->hw_handle;
if (handle > 32) {
- DEB_S(("dvb: StopHWFilter tried to stop invalid filter %d.\n",
- handle));
- DEB_S(("dvb: filter type = %d\n", dvbdmxfilter->type));
+ dprintk(1, "StopHWFilter tried to stop invalid filter %d, filter type = %d\n", handle, dvbdmxfilter->type);
return 0;
}
@@ -852,10 +847,10 @@ static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter)
buf[2] = handle;
ret = av7110_fw_request(av7110, buf, 3, answ, 2);
if (ret)
- printk("StopHWFilter error\n");
+ dprintk(1, "StopHWFilter error\n");
if (answ[1] != handle) {
- DEB_S(("dvb: filter %d shutdown error :%d\n", handle, answ[1]));
+ dprintk(2, "filter %d shutdown error :%d\n", handle, answ[1]);
ret = -1;
}
return ret;
@@ -869,7 +864,7 @@ static void dvb_feed_start_pid(struct dvb_demux_feed *dvbdmxfeed)
u16 *pid = dvbdmx->pids, npids[5];
int i;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
npids[0] = npids[1] = npids[2] = npids[3] = npids[4] = 0xffff;
i = dvbdmxfeed->pes_type;
@@ -902,7 +897,7 @@ static void dvb_feed_stop_pid(struct dvb_demux_feed *dvbdmxfeed)
u16 *pid = dvbdmx->pids, npids[5];
int i;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (dvbdmxfeed->pes_type <= 1) {
av7110_av_stop(av7110, dvbdmxfeed->pes_type ? RP_VIDEO : RP_AUDIO);
@@ -935,7 +930,7 @@ static int av7110_start_feed(struct dvb_demux_feed *feed)
struct dvb_demux *demux = feed->demux;
struct av7110 *av7110 = (struct av7110 *) demux->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (!demux->dmx.frontend)
return -EINVAL;
@@ -993,7 +988,7 @@ static int av7110_stop_feed(struct dvb_demux_feed *feed)
struct dvb_demux *demux = feed->demux;
struct av7110 *av7110 = (struct av7110 *) demux->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (feed->type == DMX_TYPE_TS) {
if (feed->ts_type & TS_DECODER) {
@@ -1035,7 +1030,7 @@ static void restart_feeds(struct av7110 *av7110)
int mode;
int i;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
mode = av7110->playing;
av7110->playing = 0;
@@ -1068,7 +1063,7 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num,
BUG();
av7110 = (struct av7110 *) dvbdemux->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (num != 0)
return -EINVAL;
@@ -1078,14 +1073,14 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num,
printk(KERN_ERR "%s: av7110_fw_request error\n", __FUNCTION__);
return -EIO;
}
- DEB_EE(("av7110: fwstc = %04hx %04hx %04hx %04hx\n",
- fwstc[0], fwstc[1], fwstc[2], fwstc[3]));
+ dprintk(2, "fwstc = %04hx %04hx %04hx %04hx\n",
+ fwstc[0], fwstc[1], fwstc[2], fwstc[3]);
*stc = (((uint64_t) ((fwstc[3] & 0x8000) >> 15)) << 32) |
(((uint64_t) fwstc[1]) << 16) | ((uint64_t) fwstc[0]);
*base = 1;
- DEB_EE(("av7110: stc = %lu\n", (unsigned long)*stc));
+ dprintk(4, "stc = %lu\n", (unsigned long)*stc);
return 0;
}
@@ -1099,7 +1094,7 @@ static int av7110_diseqc_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *
{
struct av7110 *av7110 = fe->before_after_data;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
switch (cmd) {
case FE_SET_TONE:
@@ -1138,7 +1133,7 @@ static void av7110_before_after_tune(fe_status_t s, void *data)
{
struct av7110 *av7110 = data;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
av7110->fe_synced = (s & FE_HAS_LOCK) ? 1 : 0;
@@ -1168,7 +1163,7 @@ static int av7110_register(struct av7110 *av7110)
int ret, i;
struct dvb_demux *dvbdemux = &av7110->demux;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (av7110->registered)
return -1;
@@ -1243,7 +1238,7 @@ static void dvb_unregister(struct av7110 *av7110)
{
struct dvb_demux *dvbdemux = &av7110->demux;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (!av7110->registered)
return;
@@ -1396,7 +1391,7 @@ static int get_firmware(struct av7110* av7110)
/* check if the firmware is available */
av7110->bin_fw = (unsigned char*) vmalloc(fw->size);
if (NULL == av7110->bin_fw) {
- DEB_D(("out of memory\n"));
+ dprintk(1, "out of memory\n");
release_firmware(fw);
return -ENOMEM;
}
@@ -1439,14 +1434,14 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
struct av7110 *av7110 = NULL;
int ret = 0;
- DEB_EE(("dev: %p\n", dev));
+ dprintk(4, "dev: %p\n", dev);
/* prepare the av7110 device struct */
if (!(av7110 = kmalloc (sizeof (struct av7110), GFP_KERNEL))) {
- printk ("%s: out of memory!\n", __FUNCTION__);
+ dprintk(1, "out of memory\n");
return -ENOMEM;
}
- DEB_EE(("av7110: %p\n", av7110));
+
memset(av7110, 0, sizeof(struct av7110));
av7110->card_name = (char*) pci_ext->ext_priv;
@@ -1546,11 +1541,11 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
}
if (FW_VERSION(av7110->arm_app)<0x2501)
- printk ("av7110: Warning, firmware version 0x%04x is too old. "
+ printk ("dvb-ttpci: Warning, firmware version 0x%04x is too old. "
"System might be unstable!\n", FW_VERSION(av7110->arm_app));
if (kernel_thread(arm_thread, (void *) av7110, 0) < 0) {
- printk(KERN_ERR "av7110(%d): faile to start arm_mon kernel thread\n",
+ printk("dvb-ttpci: failed to start arm_mon kernel thread @ card %d\n",
av7110->dvb_adapter->num);
goto err2;
}
@@ -1571,7 +1566,7 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
if (ret)
goto err3;
- printk(KERN_INFO "av7110: found av7110-%d.\n", av7110_num);
+ printk(KERN_INFO "dvb-ttpci: found av7110-%d.\n", av7110_num);
av7110->device_initialized = 1;
av7110_num++;
return 0;
@@ -1603,7 +1598,7 @@ err:
static int av7110_detach (struct saa7146_dev* saa)
{
struct av7110 *av7110 = (struct av7110*)saa->ext_priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if( 0 == av7110->device_initialized ) {
return 0;
@@ -1652,8 +1647,6 @@ static void av7110_irq(struct saa7146_dev* dev, u32 *isr)
{
struct av7110 *av7110 = (struct av7110*)dev->ext_priv;
-// DEB_INT(("dev: %p, av7110: %p\n",dev,av7110));
-
if (*isr & MASK_19)
tasklet_schedule (&av7110->debi_tasklet);
diff --git a/linux/drivers/media/dvb/ttpci/av7110.h b/linux/drivers/media/dvb/ttpci/av7110.h
index f35b03163..abdc8ab8a 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.h
+++ b/linux/drivers/media/dvb/ttpci/av7110.h
@@ -27,6 +27,11 @@
#include <media/saa7146_vv.h>
+extern int av7110_debug;
+
+#define dprintk(level,args...) \
+ do { if ((av7110_debug & level)) { printk("dvb-ttpci: %s(): ", __FUNCTION__); printk(args); } } while (0)
+
#define MAXFILT 32
enum {AV_PES_STREAM, PS_STREAM, TS_STREAM, PES_STREAM};
diff --git a/linux/drivers/media/dvb/ttpci/av7110_av.c b/linux/drivers/media/dvb/ttpci/av7110_av.c
index 52633adee..153c1b041 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_av.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_av.c
@@ -97,8 +97,6 @@ int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
{
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) p2t->priv;
-// DEB_EE(("struct dvb_filter_pes2ts:%p\n", p2t));
-
if (!(dvbdmxfeed->ts_type & TS_PACKET))
return 0;
if (buf[3] == 0xe0) // video PES do not have a length in TS
@@ -114,8 +112,6 @@ static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data)
{
struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *) priv;
-// DEB_EE(("dvb_demux_feed:%p\n", dvbdmxfeed));
-
dvbdmxfeed->cb.ts(data, 188, NULL, 0,
&dvbdmxfeed->feed.ts, DMX_OK);
return 0;
@@ -126,7 +122,7 @@ int av7110_av_start_record(struct av7110 *av7110, int av,
{
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
- DEB_EE(("av7110: %p, dvb_demux_feed:%p\n", av7110, dvbdmxfeed));
+ dprintk(2, "av7110:%p, , dvb_demux_feed:%p\n", av7110, dvbdmxfeed);
if (av7110->playing || (av7110->rec_mode & av))
return -EBUSY;
@@ -168,7 +164,7 @@ int av7110_av_start_record(struct av7110 *av7110, int av,
int av7110_av_start_play(struct av7110 *av7110, int av)
{
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (av7110->rec_mode)
return -EBUSY;
@@ -201,7 +197,7 @@ int av7110_av_start_play(struct av7110 *av7110, int av)
void av7110_av_stop(struct av7110 *av7110, int av)
{
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (!(av7110->playing & av) && !(av7110->rec_mode & av))
return;
@@ -242,8 +238,6 @@ int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
u32 sync;
u16 blen;
- DEB_EE(("dvb_ring_buffer_t: %p\n", buf));
-
if (!dlen) {
wake_up(&buf->queue);
return -1;
@@ -274,8 +268,8 @@ int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
dvb_ringbuffer_read(buf, dest, (size_t) blen, 0);
- DEB_S(("pread=0x%08lx, pwrite=0x%08lx\n",
- (unsigned long) buf->pread, (unsigned long) buf->pwrite));
+ dprintk(2, "pread=0x%08lx, pwrite=0x%08lx\n",
+ (unsigned long) buf->pread, (unsigned long) buf->pwrite);
wake_up(&buf->queue);
return blen;
}
@@ -284,7 +278,7 @@ int av7110_set_volume(struct av7110 *av7110, int volleft, int volright)
{
int err, vol, val, balance = 0;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
av7110->mixer.volume_left = volleft;
av7110->mixer.volume_right = volright;
@@ -323,7 +317,7 @@ int av7110_set_volume(struct av7110 *av7110, int volleft, int volright)
void av7110_set_vidmode(struct av7110 *av7110, int mode)
{
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
av7110_fw_cmd(av7110, COMTYPE_ENCODER, LoadVidCode, 1, mode);
@@ -351,7 +345,7 @@ static void get_video_format(struct av7110 *av7110, u8 *buf, int count)
int sw;
u8 *p;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (av7110->sinfo)
return;
@@ -364,7 +358,7 @@ static void get_video_format(struct av7110 *av7110, u8 *buf, int count)
vsize = ((p[1] &0x0F) << 8) | (p[2]);
sw = (p[3] & 0x0F);
av7110_set_vidmode(av7110, sw2mode[sw]);
- DEB_S(("dvb: playback %dx%d fr=%d\n", hsize, vsize, sw));
+ dprintk(2, "playback %dx%d fr=%d\n", hsize, vsize, sw);
av7110->sinfo = 1;
break;
}
@@ -401,7 +395,7 @@ static inline long aux_ring_buffer_write(struct dvb_ringbuffer *rbuf,
static void play_video_cb(u8 *buf, int count, void *priv)
{
struct av7110 *av7110 = (struct av7110 *) priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if ((buf[3] & 0xe0) == 0xe0) {
get_video_format(av7110, buf, count);
@@ -413,7 +407,7 @@ static void play_video_cb(u8 *buf, int count, void *priv)
static void play_audio_cb(u8 *buf, int count, void *priv)
{
struct av7110 *av7110 = (struct av7110 *) priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
aux_ring_buffer_write(&av7110->aout, buf, count);
}
@@ -425,7 +419,7 @@ static ssize_t dvb_play(struct av7110 *av7110, const u8 __user *buf,
unsigned long count, int nonblock, int type)
{
unsigned long todo = count, n;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (!av7110->kbuf[type])
return -ENOBUFS;
@@ -458,7 +452,7 @@ static ssize_t dvb_play_kernel(struct av7110 *av7110, const u8 *buf,
unsigned long count, int nonblock, int type)
{
unsigned long todo = count, n;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (!av7110->kbuf[type])
return -ENOBUFS;
@@ -488,7 +482,7 @@ static ssize_t dvb_aplay(struct av7110 *av7110, const u8 __user *buf,
unsigned long count, int nonblock, int type)
{
unsigned long todo = count, n;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (!av7110->kbuf[type])
return -ENOBUFS;
@@ -767,7 +761,7 @@ int av7110_write_to_decoder(struct dvb_demux_feed *feed, const u8 *buf, size_t l
struct av7110 *av7110 = (struct av7110 *) demux->priv;
struct ipack *ipack = &av7110->ipack[feed->pes_type];
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
switch (feed->pes_type) {
case 0:
@@ -808,8 +802,6 @@ void dvb_video_add_event(struct av7110 *av7110, struct video_event *event)
struct dvb_video_events *events = &av7110->video_events;
int wp;
- DEB_D(("\n"));
-
spin_lock_bh(&events->lock);
wp = (events->eventw + 1) % MAX_VIDEO_EVENT;
@@ -832,8 +824,6 @@ static int dvb_video_get_event (struct av7110 *av7110, struct video_event *event
{
struct dvb_video_events *events = &av7110->video_events;
- DEB_D(("\n"));
-
if (events->overflow) {
events->overflow = 0;
return -EOVERFLOW;
@@ -872,7 +862,7 @@ static unsigned int dvb_video_poll(struct file *file, poll_table *wait)
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
unsigned int mask = 0;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if ((file->f_flags & O_ACCMODE) != O_RDONLY)
poll_wait(file, &av7110->avout.queue, wait);
@@ -899,7 +889,7 @@ static ssize_t dvb_video_write(struct file *file, const char __user *buf,
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if ((file->f_flags & O_ACCMODE) == O_RDONLY)
return -EPERM;
@@ -916,7 +906,7 @@ static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
unsigned int mask = 0;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
poll_wait(file, &av7110->aout.queue, wait);
@@ -935,7 +925,7 @@ static ssize_t dvb_audio_write(struct file *file, const char __user *buf,
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (av7110->audiostate.stream_source != AUDIO_SOURCE_MEMORY) {
printk(KERN_ERR "not audio source memory\n");
@@ -952,7 +942,7 @@ static int play_iframe(struct av7110 *av7110, u8 __user *buf, unsigned int len,
{
int i, n;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (!(av7110->playing & RP_VIDEO)) {
if (av7110_av_start_play(av7110, RP_VIDEO) < 0)
@@ -982,7 +972,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
unsigned long arg = (unsigned long) parg;
int ret = 0;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
if ( cmd != VIDEO_GET_STATUS && cmd != VIDEO_GET_EVENT &&
@@ -1178,7 +1168,7 @@ static int dvb_audio_ioctl(struct inode *inode, struct file *file,
unsigned long arg = (unsigned long) parg;
int ret = 0;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (((file->f_flags & O_ACCMODE) == O_RDONLY) &&
(cmd != AUDIO_GET_STATUS))
@@ -1294,7 +1284,7 @@ static int dvb_video_open(struct inode *inode, struct file *file)
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
int err;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if ((err = dvb_generic_open(inode, file)) < 0)
return err;
@@ -1318,7 +1308,7 @@ static int dvb_video_release(struct inode *inode, struct file *file)
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
av7110_av_stop(av7110, RP_VIDEO);
@@ -1333,7 +1323,7 @@ static int dvb_audio_open(struct inode *inode, struct file *file)
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
int err=dvb_generic_open(inode, file);
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
if (err < 0)
return err;
@@ -1347,7 +1337,7 @@ static int dvb_audio_release(struct inode *inode, struct file *file)
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(2, "av7110:%p, \n", av7110);
av7110_av_stop(av7110, RP_AUDIO);
return dvb_generic_release(inode, file);
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ca.c b/linux/drivers/media/dvb/ttpci/av7110_ca.c
index bb666b7d4..484869fe6 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_ca.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_ca.c
@@ -44,7 +44,7 @@
void CI_handle(struct av7110 *av7110, u8 *data, u16 len)
{
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(8, "av7110:%p\n",av7110);
if (len < 3)
return;
@@ -207,7 +207,7 @@ static int dvb_ca_open(struct inode *inode, struct file *file)
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
int err = dvb_generic_open(inode, file);
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(8, "av7110:%p\n",av7110);
if (err < 0)
return err;
@@ -223,7 +223,7 @@ static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer;
unsigned int mask = 0;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(8, "av7110:%p\n",av7110);
poll_wait(file, &rbuf->queue, wait);
if (!dvb_ringbuffer_empty(rbuf))
@@ -241,7 +241,7 @@ static int dvb_ca_ioctl(struct inode *inode, struct file *file,
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
unsigned long arg = (unsigned long) parg;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(8, "av7110:%p\n",av7110);
switch (cmd) {
case CA_RESET:
@@ -318,7 +318,7 @@ static ssize_t dvb_ca_write(struct file *file, const char __user *buf,
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(8, "av7110:%p\n",av7110);
return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos);
}
@@ -328,7 +328,7 @@ static ssize_t dvb_ca_read(struct file *file, char __user *buf,
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
struct av7110 *av7110 = (struct av7110 *) dvbdev->priv;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(8, "av7110:%p\n",av7110);
return ci_ll_read(&av7110->ci_rbuffer, file, buf, count, ppos);
}
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c
index f28869162..47f2de3c2 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c
@@ -110,7 +110,7 @@ void av7110_reset_arm(struct av7110 *av7110)
IER_ENABLE(av7110->dev, MASK_03);
av7110->arm_ready = 1;
- printk("av7110: ARM RESET\n");
+ dprintk(1, "reset ARM\n");
}
@@ -118,7 +118,7 @@ static int waitdebi(struct av7110 *av7110, int adr, int state)
{
int k;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
for (k = 0; k < 100; k++) {
if (irdebi(av7110, DEBINOSWAP, adr, 0, 2) == state)
@@ -134,7 +134,7 @@ static int load_dram(struct av7110 *av7110, u32 *data, int len)
int blocks, rest;
u32 base, bootblock = BOOT_BLOCK;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
blocks = len / BOOT_MAX_SIZE;
rest = len % BOOT_MAX_SIZE;
@@ -143,7 +143,7 @@ static int load_dram(struct av7110 *av7110, u32 *data, int len)
for (i = 0; i < blocks; i++) {
if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0)
return -1;
- DEB_D(("Writing DRAM block %d\n", i));
+ dprintk(4, "writing DRAM block %d\n", i);
mwdebi(av7110, DEBISWAB, bootblock,
((char*)data) + i * BOOT_MAX_SIZE, BOOT_MAX_SIZE);
bootblock ^= 0x1400;
@@ -206,7 +206,7 @@ int av7110_bootarm(struct av7110 *av7110)
u32 ret;
int i;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO);
@@ -222,17 +222,17 @@ int av7110_bootarm(struct av7110 *av7110)
/* test DEBI */
iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4);
if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) {
- printk(KERN_ERR "dvb: debi test in av7110_bootarm() failed: "
+ printk(KERN_ERR "dvb-ttpci: debi test in av7110_bootarm() failed: "
"%08x != %08x (check your BIOS hotplug settings)\n",
ret, 0x10325476);
return -1;
}
for (i = 0; i < 8192; i += 4)
iwdebi(av7110, DEBISWAP, DPRAM_BASE + i, 0x00, 4);
- DEB_D(("av7110_bootarm: debi test OK\n"));
+ dprintk(2, "debi test OK\n");
/* boot */
- DEB_D(("av7110_bootarm: load boot code\n"));
+ dprintk(1, "load boot code\n");
saa7146_setgpio(dev, ARM_IRQ_LINE, SAA7146_GPIO_IRQLO);
//saa7146_setgpio(dev, DEBI_DONE_LINE, SAA7146_GPIO_INPUT);
//saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);
@@ -241,25 +241,25 @@ int av7110_bootarm(struct av7110 *av7110)
iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2);
if (saa7146_wait_for_debi_done(av7110->dev)) {
- printk(KERN_ERR "dvb: av7110_bootarm(): "
+ printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): "
"saa7146_wait_for_debi_done() timed out\n");
return -1;
}
saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTHI);
mdelay(1);
- DEB_D(("av7110_bootarm: load dram code\n"));
+ dprintk(1, "load dram code\n");
if (load_dram(av7110, (u32 *)av7110->bin_root, av7110->size_root) < 0)
return -1;
saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO);
mdelay(1);
- DEB_D(("av7110_bootarm: load dpram code\n"));
+ dprintk(1, "load dpram code\n");
mwdebi(av7110, DEBISWAB, DPRAM_BASE, av7110->bin_dpram, av7110->size_dpram);
if (saa7146_wait_for_debi_done(av7110->dev)) {
- printk(KERN_ERR "dvb: av7110_bootarm(): "
+ printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): "
"saa7146_wait_for_debi_done() timed out after loading DRAM\n");
return -1;
}
@@ -289,10 +289,10 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
u32 stat;
#endif
-// DEB_EE(("av7110: %p\n", av7110));
+// dprintk(4, "%p\n", av7110);
if (!av7110->arm_ready) {
- DEB_D(("arm not ready.\n"));
+ dprintk(1, "arm not ready.\n");
return -1;
}
@@ -300,7 +300,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) {
msleep(1);
if (time_after(jiffies, start + ARM_WAIT_FREE)) {
- printk(KERN_ERR "%s: timeout waiting for COMMAND idle\n", __FUNCTION__);
+ printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND idle\n", __FUNCTION__);
return -1;
}
}
@@ -310,7 +310,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 )) {
msleep(1);
if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {
- printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
+ printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for HANDSHAKE_REG\n", __FUNCTION__);
return -1;
}
}
@@ -320,7 +320,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
while (rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2) & OSDQFull) {
msleep(1);
if (time_after(jiffies, start + ARM_WAIT_OSD)) {
- printk(KERN_ERR "%s: timeout waiting for !OSDQFull\n", __FUNCTION__);
+ printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for !OSDQFull\n", __FUNCTION__);
return -1;
}
}
@@ -339,7 +339,7 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
while (rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 )) {
msleep(1);
if (time_after(jiffies, start + ARM_WAIT_FREE)) {
- printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n",
+ printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND to complete\n",
__FUNCTION__);
return -1;
}
@@ -347,11 +347,11 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2);
if (stat & GPMQOver) {
- printk(KERN_ERR "%s: GPMQOver\n", __FUNCTION__);
+ printk(KERN_ERR "dvb-ttpci: %s(): GPMQOver\n", __FUNCTION__);
return -1;
}
else if (stat & OSDQOver) {
- printk(KERN_ERR "%s: OSDQOver\n", __FUNCTION__);
+ printk(KERN_ERR "dvb-ttpci: %s(): OSDQOver\n", __FUNCTION__);
return -1;
}
#endif
@@ -363,10 +363,10 @@ int av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
{
int ret;
-// DEB_EE(("av7110: %p\n", av7110));
+// dprintk(4, "%p\n", av7110);
if (!av7110->arm_ready) {
- DEB_D(("arm not ready.\n"));
+ dprintk(1, "arm not ready.\n");
return -1;
}
if (down_interruptible(&av7110->dcomlock))
@@ -375,7 +375,7 @@ int av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
ret = __av7110_send_fw_cmd(av7110, buf, length);
up(&av7110->dcomlock);
if (ret)
- printk("av7110_send_fw_cmd error\n");
+ printk("dvb-ttpci: %s(): av7110_send_fw_cmd error\n", __FUNCTION__);
return ret;
}
@@ -385,7 +385,7 @@ int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...)
u16 buf[num + 2];
int i, ret;
-// DEB_EE(("av7110: %p\n",av7110));
+// dprintk(4, "%p\n", av7110);
buf[0] = ((type << 8) | com);
buf[1] = num;
@@ -399,7 +399,7 @@ int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...)
ret = av7110_send_fw_cmd(av7110, buf, num + 2);
if (ret)
- printk("av7110_fw_cmd error\n");
+ printk("dvb-ttpci: av7110_fw_cmd error\n");
return ret;
}
@@ -409,7 +409,7 @@ int av7110_send_ci_cmd(struct av7110 *av7110, u8 subcom, u8 *buf, u8 len)
u16 cmd[18] = { ((COMTYPE_COMMON_IF << 8) + subcom),
16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
for(i = 0; i < len && i < 32; i++)
{
@@ -421,7 +421,7 @@ int av7110_send_ci_cmd(struct av7110 *av7110, u8 subcom, u8 *buf, u8 len)
ret = av7110_send_fw_cmd(av7110, cmd, 18);
if (ret)
- printk("av7110_send_ci_cmd error\n");
+ printk("dvb-ttpci: av7110_send_ci_cmd error\n");
return ret;
}
@@ -435,10 +435,10 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
u32 stat;
#endif
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (!av7110->arm_ready) {
- DEB_D(("arm not ready.\n"));
+ dprintk(1, "arm not ready.\n");
return -1;
}
@@ -447,7 +447,7 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
if ((err = __av7110_send_fw_cmd(av7110, request_buf, request_buf_len)) < 0) {
up(&av7110->dcomlock);
- printk("av7110_fw_request error\n");
+ printk("dvb-ttpci: av7110_fw_request error\n");
return err;
}
@@ -457,7 +457,7 @@ int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
msleep(1);
#endif
if (time_after(jiffies, start + ARM_WAIT_FREE)) {
- printk("%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
+ printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__);
up(&av7110->dcomlock);
return -1;
}
@@ -501,7 +501,7 @@ int av7110_fw_query(struct av7110 *av7110, u16 tag, u16* buf, s16 length)
int ret;
ret = av7110_fw_request(av7110, &tag, 0, buf, length);
if (ret)
- printk("av7110_fw_query error\n");
+ printk("dvb-ttpci: av7110_fw_query error\n");
return ret;
}
@@ -516,10 +516,10 @@ int av7110_firmversion(struct av7110 *av7110)
u16 buf[20];
u16 tag = ((COMTYPE_REQUEST << 8) + ReqVersion);
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (av7110_fw_query(av7110, tag, buf, 16)) {
- printk("DVB: AV7110-%d: ERROR: Failed to boot firmware\n",
+ printk("dvb-ttpci: failed to boot firmware @ card %d\n",
av7110->dvb_adapter->num);
return -EIO;
}
@@ -530,17 +530,17 @@ int av7110_firmversion(struct av7110 *av7110)
av7110->arm_app = (buf[6] << 16) + buf[7];
av7110->avtype = (buf[8] << 16) + buf[9];
- printk("DVB: AV711%d(%d) - firm %08x, rtsl %08x, vid %08x, app %08x\n",
- av7110->avtype, av7110->dvb_adapter->num, av7110->arm_fw,
+ printk("dvb-ttpci: info @ card %d: firm %08x, rtsl %08x, vid %08x, app %08x\n",
+ av7110->dvb_adapter->num, av7110->arm_fw,
av7110->arm_rtsl, av7110->arm_vid, av7110->arm_app);
/* print firmware capabilities */
if (FW_CI_LL_SUPPORT(av7110->arm_app))
- printk("DVB: AV711%d(%d) - firmware supports CI link layer interface\n",
- av7110->avtype, av7110->dvb_adapter->num);
+ printk("dvb-ttpci: firmware @ card %d supports CI link layer interface\n",
+ av7110->dvb_adapter->num);
else
- printk("DVB: AV711%d(%d) - no firmware support for CI link layer interface\n",
- av7110->avtype, av7110->dvb_adapter->num);
+ printk("dvb-ttpci: no firmware support for CI link layer interface @ card %d\n",
+ av7110->dvb_adapter->num);
return 0;
}
@@ -552,7 +552,7 @@ int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long bu
u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) + SendDiSEqC),
16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if (len > 10)
len = 10;
@@ -569,7 +569,7 @@ int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long bu
buf[i + 4] = msg[i];
if (av7110_send_fw_cmd(av7110, buf, 18))
- printk("av7110_diseqc_send error\n");
+ printk("dvb-ttpci: av7110_diseqc_send error\n");
return 0;
}
@@ -628,7 +628,7 @@ static int FlushText(struct av7110 *av7110)
while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) {
msleep(1);
if (time_after(jiffies, start + ARM_WAIT_OSD)) {
- printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n",
+ printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for BUFF1_BASE == 0\n",
__FUNCTION__);
up(&av7110->dcomlock);
return -1;
@@ -652,7 +652,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
while (rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2)) {
msleep(1);
if (time_after(jiffies, start + ARM_WAIT_OSD)) {
- printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n",
+ printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for BUFF1_BASE == 0\n",
__FUNCTION__);
up(&av7110->dcomlock);
return -1;
@@ -663,7 +663,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
while (rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2)) {
msleep(1);
if (time_after(jiffies, start + ARM_WAIT_SHAKE)) {
- printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n",
+ printk(KERN_ERR "dvb-ttpci: %s: timeout waiting for HANDSHAKE_REG\n",
__FUNCTION__);
up(&av7110->dcomlock);
return -1;
@@ -678,7 +678,7 @@ static int WriteText(struct av7110 *av7110, u8 win, u16 x, u16 y, u8* buf)
ret = __av7110_send_fw_cmd(av7110, cbuf, 5);
up(&av7110->dcomlock);
if (ret)
- printk("WriteText error\n");
+ printk("dvb-ttpci: WriteText error\n");
return ret;
}
@@ -741,7 +741,7 @@ static inline int LoadBitmap(struct av7110 *av7110, u16 format,
u8 c;
int ret;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
ret = wait_event_interruptible_timeout(av7110->bmpq, av7110->bmp_state != BMP_LOADING, HZ);
if (ret == -ERESTARTSYS || ret == 0) {
@@ -794,7 +794,7 @@ static int BlitBitmap(struct av7110 *av7110, u16 win, u16 x, u16 y, u16 trans)
{
int ret;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
BUG_ON (av7110->bmp_state == BMP_NONE);
@@ -812,7 +812,7 @@ static int BlitBitmap(struct av7110 *av7110, u16 win, u16 x, u16 y, u16 trans)
static inline int ReleaseBitmap(struct av7110 *av7110)
{
- DEB_EE(("av7110: %p\n",av7110));
+ dprintk(4, "%p\n", av7110);
if (av7110->bmp_state != BMP_LOADED)
return -1;
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ir.c b/linux/drivers/media/dvb/ttpci/av7110_ir.c
index 9847c0b97..10df56b54 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_ir.c
@@ -10,12 +10,7 @@
#define UP_TIMEOUT (HZ/4)
-static int av7110_ir_debug;
-
-module_param_named(debug_ir, av7110_ir_debug, int, 0644);
-MODULE_PARM_DESC(av7110_ir_debug, "Turn on/off IR debugging (default:off).");
-
-#define dprintk(x...) do { if (av7110_ir_debug) printk (x); } while (0)
+/* enable ir debugging by or'ing av7110_debug with 16 */
static struct input_dev input_dev;
@@ -78,7 +73,7 @@ static void av7110_emit_key(u32 ircom)
keycode = key_map[data];
- dprintk("#########%08x######### addr %i data 0x%02x (keycode %i)\n",
+ dprintk(16, "#########%08x######### addr %i data 0x%02x (keycode %i)\n",
ircom, addr, data, keycode);
/* check device address (if selected) */
diff --git a/linux/drivers/media/dvb/ttpci/av7110_v4l.c b/linux/drivers/media/dvb/ttpci/av7110_v4l.c
index e253c6f85..184205c49 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -45,8 +45,8 @@ int msp_writereg(struct av7110 *av7110, u8 dev, u16 reg, u16 val)
struct i2c_msg msgs = { .flags = 0, .addr = 0x40, .len = 5, .buf = msg };
if (i2c_transfer(&av7110->i2c_adap, &msgs, 1) != 1) {
- printk("av7110(%d): %s(%u = %u) failed\n",
- av7110->dvb_adapter->num, __FUNCTION__, reg, val);
+ dprintk(1, "dvb-ttpci: failed @ card %d, %u = %u\n",
+ av7110->dvb_adapter->num, reg, val);
return -EIO;
}
return 0;
@@ -62,8 +62,8 @@ int msp_readreg(struct av7110 *av7110, u8 dev, u16 reg, u16 *val)
};
if (i2c_transfer(&av7110->i2c_adap, &msgs[0], 2) != 2) {
- printk("av7110(%d): %s(%u) failed\n",
- av7110->dvb_adapter->num, __FUNCTION__, reg);
+ dprintk(1, "dvb-ttpci: failed @ card %d, %u\n",
+ av7110->dvb_adapter->num, reg);
return -EIO;
}
*val = (msg2[0] << 8) | msg2[1];
@@ -97,7 +97,7 @@ static int ves1820_writereg(struct saa7146_dev *dev, u8 reg, u8 data)
u8 buf[] = { 0x00, reg, data };
struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = 3 };
- DEB_EE(("av7710: dev: %p\n", dev));
+ dprintk(4, "dev: %p\n", dev);
if (1 != saa7146_i2c_transfer(dev, &msg, 1, 1))
return -1;
@@ -108,7 +108,7 @@ static int tuner_write(struct saa7146_dev *dev, u8 addr, u8 data [4])
{
struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = data, .len = 4 };
- DEB_EE(("av7710: dev: %p\n", dev));
+ dprintk(4, "dev: %p\n", dev);
if (1 != saa7146_i2c_transfer(dev, &msg, 1, 1))
return -1;
@@ -126,7 +126,7 @@ static int tuner_set_tv_freq(struct saa7146_dev *dev, u32 freq)
u8 config;
u8 buf[4];
- DEB_EE(("av7710: freq: 0x%08x\n", freq));
+ dprintk(4, "freq: 0x%08x\n", freq);
/* magic number: 614. tuning with the frequency given by v4l2
is always off by 614*62.5 = 38375 kHz...*/
@@ -169,13 +169,13 @@ int av7110_dvb_c_switch(struct saa7146_fh *fh)
u8 band = 0;
int source, sync, err;
- DEB_EE(("av7110: %p\n", av7110));
+ dprintk(4, "%p\n", av7110);
if ((vv->video_status & STATUS_OVERLAY) != 0) {
vv->ov_suspend = vv->video_fh;
err = saa7146_stop_preview(vv->video_fh); /* side effect: video_status is now 0, video_fh is NULL */
if (err != 0) {
- DEB_D(("warning: suspending video failed\n"));
+ dprintk(2, "suspending video failed\n");
vv->ov_suspend = NULL;
}
}
@@ -186,7 +186,7 @@ int av7110_dvb_c_switch(struct saa7146_fh *fh)
source = SAA7146_HPS_SOURCE_PORT_B;
sync = SAA7146_HPS_SYNC_PORT_B;
memcpy(standard, analog_standard, sizeof(struct saa7146_standard) * 2);
- printk("av7110: switching to analog TV\n");
+ dprintk(1, "switching to analog TV\n");
msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0000); // loudspeaker source
msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0000); // headphone source
msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0000); // SCART 1 source
@@ -199,7 +199,7 @@ int av7110_dvb_c_switch(struct saa7146_fh *fh)
source = SAA7146_HPS_SOURCE_PORT_A;
sync = SAA7146_HPS_SYNC_PORT_A;
memcpy(standard, dvb_standard, sizeof(struct saa7146_standard) * 2);
- printk("av7110: switching DVB mode\n");
+ dprintk(1, "switching DVB mode\n");
msp_writereg(av7110, MSP_WR_DSP, 0x0008, 0x0220); // loudspeaker source
msp_writereg(av7110, MSP_WR_DSP, 0x0009, 0x0220); // headphone source
msp_writereg(av7110, MSP_WR_DSP, 0x000a, 0x0220); // SCART 1 source
@@ -210,10 +210,11 @@ int av7110_dvb_c_switch(struct saa7146_fh *fh)
/* hmm, this does not do anything!? */
if (av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, adswitch))
- printk("ADSwitch error\n");
+ dprintk(1, "ADSwitch error\n");
if (ves1820_writereg(dev, 0x0f, band))
- printk("setting band in demodulator failed.\n");
+ dprintk(1, "setting band in demodulator failed.\n");
+
saa7146_set_hps_source_and_sync(dev, source, sync);
if (vv->ov_suspend != NULL) {
@@ -228,7 +229,7 @@ int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
{
struct saa7146_dev *dev = fh->dev;
struct av7110 *av7110 = (struct av7110*) dev->ext_priv;
- DEB_EE(("saa7146_dev: %p\n", dev));
+ dprintk(4, "saa7146_dev: %p\n", dev);
switch (cmd) {
case VIDIOC_G_TUNER:
@@ -237,7 +238,7 @@ int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
u16 stereo_det;
s8 stereo;
- DEB_EE(("VIDIOC_G_TUNER: %d\n", t->index));
+ dprintk(2, "VIDIOC_G_TUNER: %d\n", t->index);
if (!av7110->has_analog_tuner || t->index != 0)
return -EINVAL;
@@ -254,12 +255,12 @@ int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
t->signal = 0xffff;
t->afc = 0;
-// FIXME: standard / stereo detection is still broken
-msp_readreg(av7110, MSP_RD_DEM, 0x007e, &stereo_det);
-printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
+ // FIXME: standard / stereo detection is still broken
+ msp_readreg(av7110, MSP_RD_DEM, 0x007e, &stereo_det);
+ dprintk(1, "VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
msp_readreg(av7110, MSP_RD_DSP, 0x0018, &stereo_det);
- printk("VIDIOC_G_TUNER: msp3400 stereo detection: 0x%04x\n", stereo_det);
+ dprintk(1, "VIDIOC_G_TUNER: msp3400 stereo detection: 0x%04x\n", stereo_det);
stereo = (s8)(stereo_det >> 8);
if (stereo > 0x10) {
/* stereo */
@@ -280,29 +281,29 @@ printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
{
struct v4l2_tuner *t = arg;
u16 fm_matrix, src;
- DEB_EE(("VIDIOC_S_TUNER: %d\n", t->index));
+ dprintk(2, "VIDIOC_S_TUNER: %d\n", t->index);
if (!av7110->has_analog_tuner || av7110->current_input != 1)
return -EINVAL;
switch (t->audmode) {
case V4L2_TUNER_MODE_STEREO:
- DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_STEREO\n"));
+ dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_STEREO\n");
fm_matrix = 0x3001; // stereo
src = 0x0020;
break;
case V4L2_TUNER_MODE_LANG1:
- DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1\n"));
+ dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG1\n");
fm_matrix = 0x3000; // mono
src = 0x0000;
break;
case V4L2_TUNER_MODE_LANG2:
- DEB_D(("VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG2\n"));
+ dprintk(2, "VIDIOC_S_TUNER: V4L2_TUNER_MODE_LANG2\n");
fm_matrix = 0x3000; // mono
src = 0x0010;
break;
default: /* case V4L2_TUNER_MODE_MONO: {*/
- DEB_D(("VIDIOC_S_TUNER: TDA9840_SET_MONO\n"));
+ dprintk(2, "VIDIOC_S_TUNER: TDA9840_SET_MONO\n");
fm_matrix = 0x3000; // mono
src = 0x0030;
break;
@@ -317,7 +318,7 @@ printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
{
struct v4l2_frequency *f = arg;
- DEB_EE(("VIDIOC_G_FREQ: freq:0x%08x.\n", f->frequency));
+ dprintk(2, "VIDIOC_G_FREQ: freq:0x%08x.\n", f->frequency);
if (!av7110->has_analog_tuner || av7110->current_input != 1)
return -EINVAL;
@@ -331,7 +332,7 @@ printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
{
struct v4l2_frequency *f = arg;
- DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n", f->frequency));
+ dprintk(2, "VIDIOC_S_FREQUENCY: freq:0x%08x.\n", f->frequency);
if (!av7110->has_analog_tuner || av7110->current_input != 1)
return -EINVAL;
@@ -356,7 +357,7 @@ printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
{
struct v4l2_input *i = arg;
- DEB_EE(("VIDIOC_ENUMINPUT: %d\n", i->index));
+ dprintk(2, "VIDIOC_ENUMINPUT: %d\n", i->index);
if (av7110->has_analog_tuner ) {
if (i->index < 0 || i->index >= 2)
@@ -374,14 +375,14 @@ printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
{
int *input = (int *)arg;
*input = av7110->current_input;
- DEB_EE(("VIDIOC_G_INPUT: %d\n", *input));
+ dprintk(2, "VIDIOC_G_INPUT: %d\n", *input);
return 0;
}
case VIDIOC_S_INPUT:
{
int input = *(int *)arg;
- DEB_EE(("VIDIOC_S_INPUT: %d\n", input));
+ dprintk(2, "VIDIOC_S_INPUT: %d\n", input);
if (!av7110->has_analog_tuner )
return 0;
@@ -397,7 +398,7 @@ printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
{
struct v4l2_audio *a = arg;
- DEB_EE(("VIDIOC_G_AUDIO: %d\n", a->index));
+ dprintk(2, "VIDIOC_G_AUDIO: %d\n", a->index);
if (a->index != 0)
return -EINVAL;
memcpy(a, &msp3400_v4l2_audio, sizeof(struct v4l2_audio));
@@ -406,7 +407,7 @@ printk("VIDIOC_G_TUNER: msp3400 TV standard detection: 0x%04x\n", stereo_det);
case VIDIOC_S_AUDIO:
{
struct v4l2_audio *a = arg;
- DEB_EE(("VIDIOC_S_AUDIO: %d\n", a->index));
+ dprintk(2, "VIDIOC_S_AUDIO: %d\n", a->index);
break;
}
default:
@@ -504,13 +505,13 @@ int av7110_init_analog_module(struct av7110 *av7110)
|| i2c_writereg(av7110, 0x80, 0x0, 0) != 1)
return -ENODEV;
- printk("av7110(%d): DVB-C analog module detected, initializing MSP3400\n",
+ printk("dvb-ttpci: DVB-C analog module @ card %d detected, initializing MSP3400\n",
av7110->dvb_adapter->num);
av7110->adac_type = DVB_ADAC_MSP;
msleep(100); // the probing above resets the msp...
msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1);
msp_readreg(av7110, MSP_RD_DSP, 0x001f, &version2);
- printk("av7110(%d): MSP3400 version 0x%04x 0x%04x\n",
+ dprintk(1, "dvb-ttpci: @ card %d MSP3400 version 0x%04x 0x%04x\n",
av7110->dvb_adapter->num, version1, version2);
msp_writereg(av7110, MSP_WR_DSP, 0x0013, 0x0c00);
msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker + headphone
@@ -529,8 +530,7 @@ int av7110_init_analog_module(struct av7110 *av7110)
/* init the saa7113 */
while (*i != 0xff) {
if (i2c_writereg(av7110, 0x48, i[0], i[1]) != 1) {
- printk("av7110(%d): saa7113 initialization failed",
- av7110->dvb_adapter->num);
+ dprintk(1, "saa7113 initialization failed @ card %d", av7110->dvb_adapter->num);
break;
}
i += 2;
diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c
index 5bc672824..036442e33 100644
--- a/linux/drivers/media/dvb/ttpci/budget-av.c
+++ b/linux/drivers/media/dvb/ttpci/budget-av.c
@@ -44,7 +44,6 @@ struct budget_av {
* INITIALIZATION
****************************************************************************/
-
static u8 i2c_readreg (struct i2c_adapter *i2c, u8 id, u8 reg)
{
u8 mm1[] = {0x00};
@@ -77,7 +76,6 @@ static int i2c_readregs(struct i2c_adapter *i2c, u8 id, u8 reg, u8 *buf, u8 len)
return 0;
}
-
static int i2c_writereg (struct i2c_adapter *i2c, u8 id, u8 reg, u8 val)
{
u8 msg[2]={ reg, val };
@@ -90,7 +88,6 @@ static int i2c_writereg (struct i2c_adapter *i2c, u8 id, u8 reg, u8 val)
return i2c_transfer(i2c, &msgs, 1);
}
-
static const u8 saa7113_tab[] = {
0x01, 0x08,
0x02, 0xc0,
@@ -120,31 +117,28 @@ static const u8 saa7113_tab[] = {
0xff
};
-
static int saa7113_init (struct budget_av *budget_av)
{
struct budget *budget = &budget_av->budget;
const u8 *data = saa7113_tab;
if (i2c_writereg (&budget->i2c_adap, 0x4a, 0x01, 0x08) != 1) {
- DEB_D(("saa7113: not found on KNC card\n"));
+ dprintk(1, "saa7113 not found on KNC card\n");
return -ENODEV;
}
- INFO(("saa7113: detected and initializing\n"));
+ dprintk(1, "saa7113 detected and initializing\n");
while (*data != 0xff) {
i2c_writereg(&budget->i2c_adap, 0x4a, *data, *(data+1));
data += 2;
}
- DEB_D(("saa7113: status=%02x\n",
- i2c_readreg(&budget->i2c_adap, 0x4a, 0x1f)));
+ dprintk(1, "saa7113 status=%02x\n", i2c_readreg(&budget->i2c_adap, 0x4a, 0x1f));
return 0;
}
-
static int saa7113_setinput (struct budget_av *budget_av, int input)
{
struct budget *budget = &budget_av->budget;
@@ -165,13 +159,12 @@ static int saa7113_setinput (struct budget_av *budget_av, int input)
return 0;
}
-
static int budget_av_detach (struct saa7146_dev *dev)
{
struct budget_av *budget_av = (struct budget_av*) dev->ext_priv;
int err;
- DEB_EE(("dev: %p\n",dev));
+ dprintk(2, "dev: %p\n", dev);
if ( 1 == budget_av->has_saa7113 ) {
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO);
@@ -198,7 +191,7 @@ static int budget_av_attach (struct saa7146_dev* dev,
u8 *mac;
int err;
- DEB_EE(("dev: %p\n",dev));
+ dprintk(2, "dev: %p\n", dev);
if (bi->type != BUDGET_KNC1 && bi->type != BUDGET_CIN1200) {
return -ENODEV;
@@ -270,15 +263,12 @@ static int budget_av_attach (struct saa7146_dev* dev,
return 0;
}
-
-
#define KNC1_INPUTS 2
static struct v4l2_input knc1_inputs[KNC1_INPUTS] = {
{ 0, "Composite", V4L2_INPUT_TYPE_TUNER, 1, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 },
{ 1, "S-Video", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 },
};
-
static struct saa7146_extension_ioctls ioctls[] = {
{ VIDIOC_ENUMINPUT, SAA7146_EXCLUSIVE },
{ VIDIOC_G_INPUT, SAA7146_EXCLUSIVE },
@@ -286,7 +276,6 @@ static struct saa7146_extension_ioctls ioctls[] = {
{ 0, 0 }
};
-
static int av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
{
struct saa7146_dev *dev = fh->dev;
@@ -299,7 +288,7 @@ static int av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
{
struct v4l2_input *i = arg;
- DEB_EE(("VIDIOC_ENUMINPUT %d.\n",i->index));
+ dprintk(1, "VIDIOC_ENUMINPUT %d.\n", i->index);
if( i->index < 0 || i->index >= KNC1_INPUTS) {
return -EINVAL;
}
@@ -312,19 +301,16 @@ static int av_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
*input = budget_av->cur_input;
- DEB_EE(("VIDIOC_G_INPUT %d.\n",*input));
+ dprintk(1, "VIDIOC_G_INPUT %d.\n", *input);
return 0;
}
case VIDIOC_S_INPUT:
{
int input = *(int *)arg;
- DEB_EE(("VIDIOC_S_INPUT %d.\n", input));
+ dprintk(1, "VIDIOC_S_INPUT %d.\n", input);
return saa7113_setinput (budget_av, input);
}
default:
-/*
- DEB2(printk("does not handle this ioctl.\n"));
-*/
return -ENOIOCTLCMD;
}
return 0;
@@ -354,11 +340,8 @@ static struct saa7146_ext_vv vv_data = {
.ioctl = av_ioctl,
};
-
-
static struct saa7146_extension budget_extension;
-
MAKE_BUDGET_INFO(knc1, "KNC1 DVB-S", BUDGET_KNC1);
MAKE_BUDGET_INFO(cin1200, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200);
@@ -384,21 +367,13 @@ static struct saa7146_extension budget_extension = {
.irq_func = ttpci_budget_irq10_handler,
};
-
static int __init budget_av_init(void)
{
- DEB_EE((".\n"));
-
- if (saa7146_register_extension(&budget_extension))
- return -ENODEV;
-
- return 0;
+ return saa7146_register_extension(&budget_extension);
}
-
static void __exit budget_av_exit(void)
{
- DEB_EE((".\n"));
saa7146_unregister_extension(&budget_extension);
}
diff --git a/linux/drivers/media/dvb/ttpci/budget-ci.c b/linux/drivers/media/dvb/ttpci/budget-ci.c
index cade4979e..c2703e558 100644
--- a/linux/drivers/media/dvb/ttpci/budget-ci.c
+++ b/linux/drivers/media/dvb/ttpci/budget-ci.c
@@ -129,7 +129,6 @@ static u8 budget_debiwrite (struct budget_ci* budget_ci, u32 config, int addr, i
return 0;
}
-
/* from reading the following remotes:
Zenith Universal 7 / TV Mode 807 / VCR Mode 837
Hauppauge (from NOVA-CI-s box product)
@@ -184,7 +183,6 @@ static u16 key_map[64] = {
0,
};
-
static void msp430_ir_debounce (unsigned long data)
{
struct input_dev *dev = (struct input_dev *) data;
@@ -200,8 +198,6 @@ static void msp430_ir_debounce (unsigned long data)
input_event(dev, EV_KEY, key_map[dev->repeat_key], 2); /* REPEAT */
}
-
-
static void msp430_ir_interrupt (unsigned long data)
{
struct budget_ci *budget_ci = (struct budget_ci*) data;
@@ -238,7 +234,6 @@ static void msp430_ir_interrupt (unsigned long data)
}
}
-
static int msp430_ir_init (struct budget_ci *budget_ci)
{
struct saa7146_dev *saa = budget_ci->budget.dev;
@@ -266,7 +261,6 @@ static int msp430_ir_init (struct budget_ci *budget_ci)
return 0;
}
-
static void msp430_ir_deinit (struct budget_ci *budget_ci)
{
struct saa7146_dev *saa = budget_ci->budget.dev;
@@ -349,7 +343,6 @@ static int ciintf_slot_ts_enable(struct dvb_ca_en50221* ca, int slot) {
if (slot != 0) return -EINVAL;
-
saa7146_setgpio(saa, 1, SAA7146_GPIO_OUTLO);
tmp = budget_debiread(budget_ci, DEBICICTL, DEBIADDR_CICONTROL, 1);
@@ -359,7 +352,6 @@ static int ciintf_slot_ts_enable(struct dvb_ca_en50221* ca, int slot) {
return 0;
}
-
static void ciintf_interrupt (unsigned long data)
{
struct budget_ci *budget_ci = (struct budget_ci*) data;
@@ -428,7 +420,6 @@ static int ciintf_init(struct budget_ci* budget_ci)
budget_ci->slot_status = SLOTSTATUS_NONE;
if (flags & CICONTROL_CAMDETECT) budget_ci->slot_status = SLOTSTATUS_PRESENT;
-
// register CI interface
budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem;
budget_ci->ca.write_attribute_mem = ciintf_write_attribute_mem;
@@ -500,7 +491,7 @@ static void budget_ci_irq (struct saa7146_dev *dev, u32 *isr)
{
struct budget_ci *budget_ci = (struct budget_ci*) dev->ext_priv;
- DEB_EE(("dev: %p, budget_ci: %p\n", dev, budget_ci));
+ dprintk(8, "dev: %p, budget_ci: %p\n", dev, budget_ci);
if (*isr & MASK_06)
tasklet_schedule (&budget_ci->msp430_irq_tasklet);
@@ -512,8 +503,6 @@ static void budget_ci_irq (struct saa7146_dev *dev, u32 *isr)
tasklet_schedule (&budget_ci->ciintf_irq_tasklet);
}
-
-
static int budget_ci_attach (struct saa7146_dev* dev,
struct saa7146_pci_extension_data *info)
{
@@ -523,7 +512,7 @@ static int budget_ci_attach (struct saa7146_dev* dev,
if (!(budget_ci = kmalloc (sizeof(struct budget_ci), GFP_KERNEL)))
return -ENOMEM;
- DEB_EE(("budget_ci: %p\n", budget_ci));
+ dprintk(2, "budget_ci: %p\n", budget_ci);
spin_lock_init(&budget_ci->debilock);
budget_ci->budget.ci_present = 0;
@@ -545,8 +534,6 @@ static int budget_ci_attach (struct saa7146_dev* dev,
return 0;
}
-
-
static int budget_ci_detach (struct saa7146_dev* dev)
{
struct budget_ci *budget_ci = (struct budget_ci*) dev->ext_priv;
@@ -569,8 +556,6 @@ static int budget_ci_detach (struct saa7146_dev* dev)
return err;
}
-
-
static struct saa7146_extension budget_extension;
MAKE_BUDGET_INFO(ttbci, "TT-Budget/WinTV-NOVA-CI PCI", BUDGET_TT_HW_DISEQC);
@@ -600,16 +585,13 @@ static struct saa7146_extension budget_extension = {
.irq_func = budget_ci_irq,
};
-
static int __init budget_ci_init(void)
{
return saa7146_register_extension(&budget_extension);
}
-
static void __exit budget_ci_exit(void)
{
- DEB_EE((".\n"));
saa7146_unregister_extension(&budget_extension);
}
diff --git a/linux/drivers/media/dvb/ttpci/budget-core.c b/linux/drivers/media/dvb/ttpci/budget-core.c
index e4938bb1f..3ba209694 100644
--- a/linux/drivers/media/dvb/ttpci/budget-core.c
+++ b/linux/drivers/media/dvb/ttpci/budget-core.c
@@ -50,7 +50,7 @@ MODULE_PARM_DESC(budget_debug, "Turn on/off budget debugging (default:off).");
static int stop_ts_capture(struct budget *budget)
{
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
if (--budget->feeding)
return budget->feeding;
@@ -60,12 +60,11 @@ static int stop_ts_capture(struct budget *budget)
return 0;
}
-
static int start_ts_capture (struct budget *budget)
{
struct saa7146_dev *dev=budget->dev;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
if (budget->feeding)
return ++budget->feeding;
@@ -130,7 +129,6 @@ static int start_ts_capture (struct budget *budget)
return ++budget->feeding;
}
-
static void vpeirq (unsigned long data)
{
struct budget *budget = (struct budget*) data;
@@ -160,7 +158,6 @@ static void vpeirq (unsigned long data)
}
}
-
/****************************************************************************
* DVB API SECTION
****************************************************************************/
@@ -171,7 +168,7 @@ static int budget_start_feed(struct dvb_demux_feed *feed)
struct budget *budget = (struct budget*) demux->priv;
int status;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
if (!demux->dmx.frontend)
return -EINVAL;
@@ -188,7 +185,7 @@ static int budget_stop_feed(struct dvb_demux_feed *feed)
struct budget *budget = (struct budget *) demux->priv;
int status;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
spin_lock(&budget->feedlock);
status = stop_ts_capture (budget);
@@ -196,13 +193,12 @@ static int budget_stop_feed(struct dvb_demux_feed *feed)
return status;
}
-
static int budget_register(struct budget *budget)
{
struct dvb_demux *dvbdemux = &budget->demux;
int ret;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
dvbdemux->priv = (void *) budget;
@@ -246,12 +242,11 @@ static int budget_register(struct budget *budget)
return 0;
}
-
static void budget_unregister(struct budget *budget)
{
struct dvb_demux *dvbdemux=&budget->demux;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
dvb_net_release(&budget->dvb_net);
@@ -294,7 +289,7 @@ int ttpci_budget_init (struct budget *budget,
memset(budget, 0, sizeof(struct budget));
- DEB_EE(("dev: %p, budget: %p\n", dev, budget));
+ dprintk(2, "dev: %p, budget: %p\n", dev, budget);
budget->card = bi;
budget->dev = (struct saa7146_dev *) dev;
@@ -372,12 +367,11 @@ err:
return ret;
}
-
int ttpci_budget_deinit (struct budget *budget)
{
struct saa7146_dev *dev = budget->dev;
- DEB_EE(("budget: %p\n", budget));
+ dprintk(2, "budget: %p\n", budget);
budget_unregister (budget);
@@ -398,7 +392,7 @@ void ttpci_budget_irq10_handler (struct saa7146_dev* dev, u32 *isr)
{
struct budget *budget = (struct budget*)dev->ext_priv;
- DEB_EE(("dev: %p, budget: %p\n",dev,budget));
+ dprintk(8, "dev: %p, budget: %p\n",dev,budget);
if (*isr & MASK_10)
tasklet_schedule (&budget->vpe_tasklet);
@@ -420,8 +414,6 @@ void ttpci_budget_set_video_port(struct saa7146_dev* dev, int video_port)
spin_unlock(&budget->feedlock);
}
-
-
EXPORT_SYMBOL_GPL(ttpci_budget_init);
EXPORT_SYMBOL_GPL(ttpci_budget_deinit);
EXPORT_SYMBOL_GPL(ttpci_budget_irq10_handler);
diff --git a/linux/drivers/media/dvb/ttpci/budget-patch.c b/linux/drivers/media/dvb/ttpci/budget-patch.c
index 1ff5e5d1f..6cfe90960 100644
--- a/linux/drivers/media/dvb/ttpci/budget-patch.c
+++ b/linux/drivers/media/dvb/ttpci/budget-patch.c
@@ -30,9 +30,9 @@
* the project's page is at http://www.linuxtv.org/dvb/
*/
-#include "budget.h"
#include "av7110.h"
#include "av7110_hw.h"
+#include "budget.h"
#define budget_patch budget
@@ -51,7 +51,7 @@ static int budget_wdebi(struct budget_patch *budget, u32 config, int addr, u32 v
{
struct saa7146_dev *dev=budget->dev;
- DEB_EE(("budget: %p\n", budget));
+ dprintk(2, "budget: %p\n", budget);
if (count <= 0 || count > 4)
return -1;
@@ -66,12 +66,11 @@ static int budget_wdebi(struct budget_patch *budget, u32 config, int addr, u32 v
return 0;
}
-
static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int length)
{
int i;
- DEB_EE(("budget: %p\n", budget));
+ dprintk(2, "budget: %p\n", budget);
for (i = 2; i < length; i++)
budget_wdebi(budget, DEBINOSWAP, COMMAND + 2*i, (u32) buf[i], 2);
@@ -85,23 +84,21 @@ static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int
return 0;
}
-
static void av7110_set22k(struct budget_patch *budget, int state)
{
u16 buf[2] = {( COMTYPE_AUDIODAC << 8) | (state ? ON22K : OFF22K), 0};
- DEB_EE(("budget: %p\n", budget));
+ dprintk(2, "budget: %p\n", budget);
budget_av7110_send_fw_cmd(budget, buf, 2);
}
-
static int av7110_send_diseqc_msg(struct budget_patch *budget, int len, u8 *msg, int burst)
{
int i;
u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) | SendDiSEqC),
16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- DEB_EE(("budget: %p\n", budget));
+ dprintk(2, "budget: %p\n", budget);
if (len>10)
len=10;
@@ -121,12 +118,11 @@ static int av7110_send_diseqc_msg(struct budget_patch *budget, int len, u8 *msg,
return 0;
}
-
int budget_patch_diseqc_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
{
struct budget_patch *budget = fe->before_after_data;
- DEB_EE(("budget: %p\n", budget));
+ dprintk(2, "budget: %p\n", budget);
switch (cmd) {
case FE_SET_TONE:
@@ -161,7 +157,6 @@ int budget_patch_diseqc_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *
return 0;
}
-
static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *info)
{
struct budget_patch *budget;
@@ -171,7 +166,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte
if (!(budget = kmalloc (sizeof(struct budget_patch), GFP_KERNEL)))
return -ENOMEM;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
if ((err = ttpci_budget_init (budget, dev, info))) {
kfree (budget);
@@ -229,7 +224,6 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte
return 0;
}
-
static int budget_patch_detach (struct saa7146_dev* dev)
{
struct budget_patch *budget = (struct budget_patch*) dev->ext_priv;
@@ -245,20 +239,16 @@ static int budget_patch_detach (struct saa7146_dev* dev)
return err;
}
-
static int __init budget_patch_init(void)
{
return saa7146_register_extension(&budget_extension);
}
-
static void __exit budget_patch_exit(void)
{
- DEB_EE((".\n"));
saa7146_unregister_extension(&budget_extension);
}
-
static struct saa7146_extension budget_extension = {
.name = "budget_patch dvb\0",
.flags = 0,
@@ -272,7 +262,6 @@ static struct saa7146_extension budget_extension = {
.irq_func = ttpci_budget_irq10_handler,
};
-
module_init(budget_patch_init);
module_exit(budget_patch_exit);
diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c
index a90d7ad73..a6a3b973f 100644
--- a/linux/drivers/media/dvb/ttpci/budget.c
+++ b/linux/drivers/media/dvb/ttpci/budget.c
@@ -39,7 +39,7 @@
static void Set22K (struct budget *budget, int state)
{
struct saa7146_dev *dev=budget->dev;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
saa7146_setgpio(dev, 3, (state ? SAA7146_GPIO_OUTHI : SAA7146_GPIO_OUTLO));
}
@@ -51,7 +51,7 @@ static void Set22K (struct budget *budget, int state)
static void DiseqcSendBit (struct budget *budget, int data)
{
struct saa7146_dev *dev=budget->dev;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI);
udelay(data ? 500 : 1000);
@@ -64,7 +64,7 @@ static void DiseqcSendByte (struct budget *budget, int data)
{
int i, par=1, d;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
for (i=7; i>=0; i--) {
d = (data>>i)&1;
@@ -81,7 +81,7 @@ static int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, unsigned long
struct saa7146_dev *dev=budget->dev;
int i;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO);
mdelay(16);
@@ -110,7 +110,7 @@ int budget_diseqc_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
{
struct budget *budget = fe->before_after_data;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
switch (cmd) {
case FE_SET_TONE:
@@ -155,7 +155,7 @@ static int SetVoltage_Activy (struct budget *budget, fe_sec_voltage_t voltage)
{
struct saa7146_dev *dev=budget->dev;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
switch (voltage) {
case SEC_VOLTAGE_13:
@@ -176,7 +176,7 @@ static int budget_ioctl_activy (struct dvb_frontend *fe, unsigned int cmd, void
{
struct budget *budget = fe->before_after_data;
- DEB_EE(("budget: %p\n",budget));
+ dprintk(2, "budget: %p\n", budget);
switch (cmd) {
case FE_SET_VOLTAGE:
@@ -199,7 +199,7 @@ static int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_
return -ENOMEM;
}
- DEB_EE(("dev:%p, info:%p, budget:%p\n",dev,info,budget));
+ dprintk(2, "dev:%p, info:%p, budget:%p\n", dev, info, budget);
dev->ext_priv = budget;
@@ -289,7 +289,6 @@ static int __init budget_init(void)
static void __exit budget_exit(void)
{
- DEB_EE((".\n"));
saa7146_unregister_extension(&budget_extension);
}
diff --git a/linux/drivers/media/dvb/ttpci/budget.h b/linux/drivers/media/dvb/ttpci/budget.h
index 69495e2c9..70bb39af2 100644
--- a/linux/drivers/media/dvb/ttpci/budget.h
+++ b/linux/drivers/media/dvb/ttpci/budget.h
@@ -13,6 +13,13 @@
extern int budget_debug;
+#ifdef dprintk
+#undef dprintk
+#endif
+
+#define dprintk(level,args...) \
+ do { if ((budget_debug & level)) { printk("%s: %s(): ",__stringify(KBUILD_MODNAME), __FUNCTION__); printk(args); } } while (0)
+
struct budget_info {
char *name;
int type;
@@ -58,8 +65,6 @@ struct budget {
void *priv;
};
-
-
#define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
static struct budget_info x_var ## _info = { \
.name=x_name, \