*** /c/linux/wonder/old/msp3400.c	Mon Apr 30 13:35:52 2001
--- msp3400.c	Tue May  1 09:33:34 2001
***************
*** 101,106 ****
--- 101,107 ----
  	int acb;
  	int main, second;	/* sound carrier */
  	int scart;              /* input is scart */
+ 	int extaudio;
  
  	int muted;
  	int left, right;	/* volume */
***************
*** 514,519 ****
--- 515,521 ----
  	}
  
  	/* switch audio */
+ 	src = 0x0000;
  	switch (mode) {
  	case VIDEO_SOUND_STEREO:
  		src = 0x0020 | nicam;
***************
*** 538,543 ****
--- 540,546 ----
  		src = 0x0010 | nicam;
  		break;
  	}
+ 	src = src | msp->extaudio;
  	if (dolby) {
  		msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,0x0520);
  		msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,0x0620);
***************
*** 1364,1370 ****
  
  	case AUDC_SET_INPUT:
  #if 1
! 		dprintk(KERN_DEBUG "msp34xx: AUDC_SET_INPUT(%d)\n",*sarg);
  		/* hauppauge 44xxx scart switching */
  		msp->scart = 0;
  		switch (*sarg) {
--- 1367,1373 ----
  
  	case AUDC_SET_INPUT:
  #if 1
! 		dprintk("msp34xx: AUDC_SET_INPUT(%d)\n",*sarg);
  		/* hauppauge 44xxx scart switching */
  		msp->scart = 0;
  		switch (*sarg) {
***************
*** 1372,1382 ****
  			msp3400c_set_scart(client,SCART_IN2,0);
  			break;
  		case AUDIO_EXTERN:
! 			msp->scart   = 1;
  			msp3400c_set_scart(client,SCART_IN1,0);
! 			msp3400c_write(client,I2C_MSP3400C_DFP,0x0008,0x0220);
! 			break;
! 		default:
  			if (*sarg & AUDIO_MUTE)
  				msp3400c_set_scart(client,SCART_MUTE,0);
  			break;
--- 1375,1397 ----
  			msp3400c_set_scart(client,SCART_IN2,0);
  			break;
  		case AUDIO_EXTERN:
! 			msp->watch_stereo = 1;
! 			msp->extaudio = 0x0200;
  			msp3400c_set_scart(client,SCART_IN1,0);
!  			/* for ATI-TV-wonder by Lukas Gebauer <geby@volny.cz> */
!  			msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x3000);
!  			/* end modification */
!  			msp3400c_write(client,I2C_MSP3400C_DFP,0x0008,0x0220);
! 			break;
!  		/* for ATI-TV-wonder by Lukas Gebauer <geby@volny.cz> */
!  		case AUDIO_TUNER:
! 			msp->extaudio = 0;
!  			msp3400c_set_scart(client,SCART_IN1,0);
!  			msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x0000);
!  			msp3400c_write(client,I2C_MSP3400C_DFP,0x0008,0x0020);
!  			break;
!  		/* end modification */
!  		default:
  			if (*sarg & AUDIO_MUTE)
  				msp3400c_set_scart(client,SCART_MUTE,0);
  			break;
