Commit a8ce6c87 authored by Michael Hunold's avatar Michael Hunold Committed by Linus Torvalds

[PATCH] DVB: rework debugging in av7110

- [DVB] av7110: switch from stupid DEB_xx() debug macros to saner dprintk() style debugging
- [DVB] av7110: fix dvb-ttpci ca write() polling
- [DVB] budget: switch from stupid DEB_xx() debug macros to saner dprintk() style debugging
Signed-off-by: default avatarMichael Hunold <hunold@linuxtv.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 297f778c
This diff is collapsed.
......@@ -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};
......
......@@ -98,8 +98,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
......@@ -115,8 +113,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;
......@@ -127,7 +123,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;
......@@ -169,7 +165,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;
......@@ -202,7 +198,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;
......@@ -243,8 +239,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;
......@@ -275,8 +269,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;
}
......@@ -286,7 +280,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;
......@@ -325,7 +319,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);
......@@ -353,7 +347,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;
......@@ -366,7 +360,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;
}
......@@ -403,7 +397,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);
......@@ -415,7 +409,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);
}
......@@ -427,7 +421,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;
......@@ -460,7 +454,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;
......@@ -490,7 +484,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;
......@@ -769,7 +763,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:
......@@ -810,8 +804,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;
......@@ -834,8 +826,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;
......@@ -874,7 +864,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);
......@@ -901,7 +891,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;
......@@ -918,7 +908,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);
......@@ -937,7 +927,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");
......@@ -954,7 +944,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)
......@@ -984,7 +974,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 &&
......@@ -1180,7 +1170,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))
......@@ -1296,7 +1286,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;
......@@ -1320,7 +1310,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);
......@@ -1335,7 +1325,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;
......@@ -1349,7 +1339,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);
......
......@@ -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,13 +223,16 @@ 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);
poll_wait(file, &wbuf->queue, wait);
if (!dvb_ringbuffer_empty(rbuf))
mask |= POLLIN;
if (dvb_ringbuffer_avail(wbuf) > 1024)
mask |= POLLOUT;
mask |= (POLLIN | POLLRDNORM);
if (dvb_ringbuffer_free(wbuf) > 1024)
mask |= (POLLOUT | POLLWRNORM);
return mask;
}
......@@ -241,7 +244,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 +321,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 +331,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);
}
......
This diff is collapsed.
......@@ -4,18 +4,13 @@
#include <linux/moduleparam.h>
#include <linux/input.h>
#include <linux/proc_fs.h>
#include <linux/bitops.h>
#include <asm/bitops.h>
#include "av7110.h"
#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) */
......
......@@ -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];
......@@ -99,7 +99,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;
......@@ -110,7 +110,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;
......@@ -128,7 +128,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...*/
......@@ -171,13 +171,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;
}
}
......@@ -188,7 +188,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
......@@ -201,7 +201,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
......@@ -212,10 +212,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) {
......@@ -230,7 +231,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:
......@@ -239,7 +240,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;
......@@ -258,10 +259,10 @@ int av7110_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
// 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);
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 */
......@@ -282,29 +283,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;
......@@ -319,7 +320,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;
......@@ -333,7 +334,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;
......@@ -358,7 +359,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)
......@@ -376,14 +377,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;
......@@ -399,7 +400,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));
......@@ -408,7 +409,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:
......@@ -506,13 +507,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
......@@ -531,8 +532,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;
......
......@@ -127,19 +127,18 @@ static int saa7113_init (struct budget_av *budget_av)
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;
}
......@@ -171,7 +170,7 @@ 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 +197,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;
......@@ -299,7 +298,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 +311,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;
......@@ -384,21 +380,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);
}
......
......@@ -500,7 +500,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);
......@@ -523,7 +523,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;
......@@ -606,10 +606,8 @@ 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);
}
......
......@@ -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;
......@@ -65,7 +65,7 @@ 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;
......@@ -171,7 +171,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 +188,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);
......@@ -202,7 +202,7 @@ 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;
......@@ -251,7 +251,7 @@ 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 +294,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;
......@@ -377,7 +377,7 @@ 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 +398,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);
......
......@@ -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;
......@@ -71,7 +71,7 @@ static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int
{
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);
......@@ -90,7 +90,7 @@ 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);
}
......@@ -101,7 +101,7 @@ static int av7110_send_diseqc_msg(struct budget_patch *budget, int len, u8 *msg,
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;
......@@ -126,7 +126,7 @@ int budget_patch_diseqc_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *
{
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:
......@@ -171,7 +171,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);
......@@ -251,10 +251,8 @@ 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);
}
......
......@@ -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);
}
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment