On Thursday 13 Oct 2005 20:58, Hans Verkuil wrote:
> On Thursday 13 October 2005 20:45, Hans Verkuil wrote:
> > On Thursday 13 October 2005 20:40, Trev Jackson wrote:
> > > Thanks, SVN-2815 works OK now, by the way I've updated cs53l32a.c in
> > > ticket #42, however I've just realised that cs53l32a.h needs removing
> > > from the includes of ivtv-audio.c and I didn't delete it when I made
> > > the patch.  I don't think it is possible to delete a patch from a
> > > ticket, should I just add another patch or is it enough that I've
> > > mentioned this here.
> >
> > Just add a comment to the ticket. I hope to handle the ticket tonight.
>
> Thanks Trev,
>
> I've committed the changes to svn. Can you make one last change? If you
> look at wm8775.c you see that AUDC_SET_INPUT expects defines like
> AUDIO_RADIO (see media/audiochip.h for the full list of audio inputs). Can
> you change it so cs53132a expects the same argument? It's better too since
> it keeps knowledge of the registers inside the cs53132a module.
>
> Once that change is also made I'll move it to v4l.
>
> Thanks,
>
>       Hans
>
Hans

I've attached a patch for cs53l32a.c and ivtv-audio.c, which includes code for 
setting the input to AUDIO_TUNER, AUDIO_EXTERN, AUDIO_MUTE, AUDIO_UNMUTE or 
setting the volume (by passing parameter VIDEO_AUDIO_VOLUME).
Although the Mute and volume aren't used at the moment I thought I would 
include them for completeness.

Trev
--- cs53l32a.c.old	2005-10-13 22:47:48.000000000 +0100
+++ cs53l32a.c	2005-10-13 22:54:11.000000000 +0100
@@ -88,12 +88,30 @@
 	
 	switch (cmd) {
 	case AUDC_SET_INPUT:
-		if (*input != 0x01 && *input != 0x21) {
+		if (*input == AUDIO_TUNER) {
+			cs53l32a_write (client, 0x01, (u8)0x01);
+			break;
+		}
+		if (*input == AUDIO_EXTERN) {
+			cs53l32a_write (client, 0x01, (u8)0x21);
+			break;
+		}
+		if (*input == AUDIO_MUTE) {
+			cs53l32a_write (client, 0x01, (u8)0xF0);
+			break;
+		}
+		if (*input == AUDIO_UNMUTE) {
+			cs53l32a_write (client, 0x01, (u8)0x30);
+			break;
+		}
+		
+		/* All other inputs... */
 			cs53l32a_err("Invalid input %d.\n", *input);
 			return -EINVAL;
-		}
-		cs53l32a_write(client, 0x01,(u8)*input);
-		break;
+	case VIDEO_AUDIO_VOLUME:
+			cs53l32a_write (client, 0x04, (u8)*input);
+			cs53l32a_write (client, 0x05, (u8)*input);
+			break;
 	default:
 		return -EINVAL;
 	}
--- ivtv-audio.c.old	2005-10-13 22:46:15.000000000 +0100
+++ ivtv-audio.c	2005-10-13 22:46:36.000000000 +0100
@@ -151,11 +151,11 @@
 
 	switch (audio_input) {
 		case 0: // TV
-			cs_input = 0x01;
+			cs_input = AUDIO_TUNER;
 			break;
 			
 		case 1: // external line in
-			cs_input = 0x21;
+			cs_input = AUDIO_EXTERN;
 			break;
 			
 		default:
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to