Re: two problems with a TechnoTrend Premium 2300 DVB-C (FF)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Samstag, 11. Februar 2006 22:27 schrieb Steffen Roegner:
> Teppo Jalava wrote:
> > On 2/11/06, Teppo Jalava <tjjalava@xxxxxxxxx> 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..
> >
> > ------------------------------------------------------------------------
> >
> > 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
> >
> >
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > 
> > linux-dvb@xxxxxxxxxxx
> > http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
>
> Howdy, tt-Users!
>
> I think I should mention, that this patch misses a little detail
> (besides it's architectural problems): the last line sets what is called
> loudspeaker volume.
> But the msp34x5G chip manual states, that (bits 15:8 of register) 0x0004
> is for adjusting loudness gain instead, which is not quite the same.
> Setting this to 0x7f00 instead totally overdrives analog audio, so the
> correct setting would be 0x0000 (at least this works for me).
> So if you are going to use this, you want to append this to the patch
> (instead of the last line):
>
> - 	msp_writereg(av7110, MSP_WR_DSP, 0x0004, 0x7f00); // loudspeaker volume
> +	msp_writereg(av7110, MSP_WR_DSP, 0x0004, 0x0000); // loudness gain
>
>
> There should be a newly written version of the dvb-ttpci driver
> available soonly which then makes correct use of the msp3400 module ...
>
> cheers
> Steffen

thanks - now my analog out works!

lukas

_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux