[PATCH] Gemtek FM Radio PCI driver enhancement.

From: Jonathan Hudson (jonathan@daria.co.uk)
Date: Sat Jan 12 2002 - 13:18:07 EST


This small patch enables the Gemtek FM Radio PCI driver to report the
audio mode (mono or stereo) of the card. Applies to
2.4.17/2.5.2-pre11.

--- linux/drivers/media/radio/radio-gemtek-pci.c.orig Sat Jan 12 17:16:03 2002
+++ linux/drivers/media/radio/radio-gemtek-pci.c Sat Jan 12 17:19:51 2002
@@ -221,6 +221,7 @@
                 case VIDIOCGTUNER:
                 {
                         struct video_tuner t;
+ int signal;
 
                         if ( copy_from_user( &t, arg, sizeof( struct video_tuner ) ) )
                                 return -EFAULT;
@@ -228,11 +229,12 @@
                         if ( t.tuner )
                                 return -EINVAL;
 
+ signal = gemtek_pci_getsignal( card );
                         t.rangelow = GEMTEK_PCI_RANGE_LOW;
                         t.rangehigh = GEMTEK_PCI_RANGE_HIGH;
- t.flags = VIDEO_TUNER_LOW;
+ t.flags = VIDEO_TUNER_LOW | (7 << signal) ;
                         t.mode = VIDEO_MODE_AUTO;
- t.signal = 0xFFFF * gemtek_pci_getsignal( card );
+ t.signal = 0xFFFF * signal;
                         strcpy( t.name, "FM" );
 
                         if ( copy_to_user( arg, &t, sizeof( struct video_tuner ) ) )
@@ -282,6 +284,7 @@
                         a.flags |= VIDEO_AUDIO_MUTABLE;
                         a.volume = 1;
                         a.step = 65535;
+ a.mode = (1 << gemtek_pci_getsignal( card ));
                         strcpy( a.name, "Radio" );
 
                         if ( copy_to_user( arg, &a, sizeof( struct video_audio ) ) )
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jan 15 2002 - 21:00:38 EST