summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci/av7110_v4l.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110_v4l.c')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_v4l.c70
1 files changed, 35 insertions, 35 deletions
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;