[PATCH] Gemtek FM Radio PCI driver enhancement.

Jonathan Hudson (jonathan@daria.co.uk)
Sat, 12 Jan 2002 18:18:07 +0000


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/