[linux-dvb] two problems with a TechnoTrend Premium 2300 DVB-C
(FF)
Teppo Jalava
tjjalava at gmail.com
Sat Feb 11 20:01:34 CET 2006
On 2/11/06, Teppo Jalava <tjjalava at gmail.com> wrote:
> Don't know what's the current status, but there is a patch for this
> that was posted about a year ago. I don't know if it's included in the
> CVS, but here's one I've been using for my kernel (2.6.13).
Ups, forgot the attachment..
-------------- next part --------------
diff -u linux/drivers/media/dvb/ttpci/av7110.c patched/drivers/media/dvb/ttpci/av7110.c
--- linux/drivers/media/dvb/ttpci/av7110.c 2005-10-07 16:16:28.000000000 +0300
+++ patched/drivers/media/dvb/ttpci/av7110.c 2005-10-08 15:42:23.000000000 +0300
@@ -159,7 +159,7 @@
av7110->dvb_adapter.num, av7110->adac_type);
}
- if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP) {
+ if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP34x0 || av7110->adac_type == DVB_ADAC_MSP34x5) {
// switch DVB SCART on
ret = av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, MainSwitch, 1, 0);
if (ret < 0)
diff -u linux/drivers/media/dvb/ttpci/av7110.h patched/drivers/media/dvb/ttpci/av7110.h
--- linux/drivers/media/dvb/ttpci/av7110.h 2005-10-07 16:16:28.000000000 +0300
+++ patched/drivers/media/dvb/ttpci/av7110.h 2005-10-08 15:41:05.000000000 +0300
@@ -98,7 +98,8 @@
int adac_type; /* audio DAC type */
#define DVB_ADAC_TI 0
#define DVB_ADAC_CRYSTAL 1
-#define DVB_ADAC_MSP 2
+#define DVB_ADAC_MSP34x0 2
+#define DVB_ADAC_MSP34x5 3
#define DVB_ADAC_NONE -1
diff -u linux/drivers/media/dvb/ttpci/av7110_av.c patched/drivers/media/dvb/ttpci/av7110_av.c
--- linux/drivers/media/dvb/ttpci/av7110_av.c 2005-10-07 16:16:28.000000000 +0300
+++ patched/drivers/media/dvb/ttpci/av7110_av.c 2005-10-08 15:43:22.000000000 +0300
@@ -309,7 +309,7 @@
i2c_writereg(av7110, 0x20, 0x04, volright);
return 0;
- case DVB_ADAC_MSP:
+ case DVB_ADAC_MSP34x0:
vol = (volleft > volright) ? volleft : volright;
val = (vol * 0x73 / 255) << 8;
if (vol > 0)
@@ -318,6 +318,14 @@
msp_writereg(av7110, MSP_WR_DSP, 0x0000, val); /* loudspeaker */
msp_writereg(av7110, MSP_WR_DSP, 0x0006, val); /* headphonesr */
return 0;
+ case DVB_ADAC_MSP34x5:
+ vol = (volleft > volright) ? volleft : volright;
+ val = (vol * 0x73 / 255) << 8;
+ if (vol > 0)
+ balance = ((volright - volleft) * 127) / vol;
+ msp_writereg(av7110, MSP_WR_DSP, 0x0001, balance << 8);
+ msp_writereg(av7110, MSP_WR_DSP, 0x0000, val); /* loudspeaker */
+ return 0;
}
return 0;
}
diff -u linux/drivers/media/dvb/ttpci/av7110_v4l.c patched/drivers/media/dvb/ttpci/av7110_v4l.c
--- linux/drivers/media/dvb/ttpci/av7110_v4l.c 2005-10-07 16:16:28.000000000 +0300
+++ patched/drivers/media/dvb/ttpci/av7110_v4l.c 2005-10-08 15:55:18.000000000 +0300
@@ -44,6 +44,8 @@
u8 msg[5] = { dev, reg >> 8, reg & 0xff, val >> 8 , val & 0xff };
struct i2c_msg msgs = { .flags = 0, .addr = 0x40, .len = 5, .buf = msg };
+ if (av7110->adac_type == DVB_ADAC_MSP34x5)
+ msgs.addr =0x42;
if (i2c_transfer(&av7110->i2c_adap, &msgs, 1) != 1) {
dprintk(1, "dvb-ttpci: failed @ card %d, %u = %u\n",
av7110->dvb_adapter.num, reg, val);
@@ -61,6 +63,11 @@
{ .flags = I2C_M_RD, .addr = 0x40, .len = 2, .buf = msg2 }
};
+ if (av7110->adac_type == DVB_ADAC_MSP34x5){
+ msgs[0].addr = 0x42;
+ msgs[1].addr = 0x42;
+ }
+
if (i2c_transfer(&av7110->i2c_adap, &msgs[0], 2) != 2) {
dprintk(1, "dvb-ttpci: failed @ card %d, %u\n",
av7110->dvb_adapter.num, reg);
@@ -547,20 +554,27 @@
{
u16 version1, version2;
- if (i2c_writereg(av7110, 0x80, 0x0, 0x80) != 1
- || i2c_writereg(av7110, 0x80, 0x0, 0) != 1)
- return -ENODEV;
-
- printk("dvb-ttpci: DVB-C analog module @ card %d detected, initializing MSP3400\n",
- av7110->dvb_adapter.num);
- av7110->adac_type = DVB_ADAC_MSP;
+ if (i2c_writereg(av7110, 0x84, 0x0, 0x80) == 1
+ || i2c_writereg(av7110, 0x84, 0x0, 0) == 1){ //MSP34x5 check and reset
+ av7110->adac_type = DVB_ADAC_MSP34x5;
+ printk("dvb-ttpci: DVB-C analog module @ card %d detected, initializing MSP34x5\n",
+ av7110->dvb_adapter.num);
+ }
+ else if (i2c_writereg(av7110, 0x80, 0x0, 0x80) == 1
+ || i2c_writereg(av7110, 0x80, 0x0, 0) == 1){ //MSP34x0 check and reset
+ av7110->adac_type = DVB_ADAC_MSP34x0;
+ printk("dvb-ttpci: DVB-C analog module @ card %d detected, initializing MSP34x0\n",
+ av7110->dvb_adapter.num);
+ }
+ else return -ENODEV; //no MSP present
+
msleep(100); // the probing above resets the msp...
msp_readreg(av7110, MSP_RD_DSP, 0x001e, &version1);
msp_readreg(av7110, MSP_RD_DSP, 0x001f, &version2);
- dprintk(1, "dvb-ttpci: @ card %d MSP3400 version 0x%04x 0x%04x\n",
+ dprintk(1, "dvb-ttpci: @ card %d MSP34xx 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
+ msp_writereg(av7110, MSP_WR_DSP, 0x0013, 0x0c00); // scart 1 DA in->scart 1 out
+ msp_writereg(av7110, MSP_WR_DSP, 0x0000, 0x7f00); // loudspeaker volume +3dB
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, 0x0004, 0x7f00); // loudspeaker volume
Only in patched/drivers/media/dvb/ttpci/: av7110_v4l.c.orig
More information about the linux-dvb
mailing list