The SF64-PCR card has no sound support but stupidly uses the same PCI id
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 9 Aug 2004 19:49:28 +0000 (19:49 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 9 Aug 2004 19:49:28 +0000 (19:49 +0000)
as other cards.  The hack that was supposed to detect the lack of sound
support does not work, causing a number of other cards to improperly probe
as not having sound support.  so disable it for the moment.  People who
actually have this card will have to set I_HAVE_SF64_PCR in their
/etc/make.conf.

Source: Barry Bouwsma

sys/dev/sound/pci/fm801.c

index 5dda071..6f5f75e 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/sound/pci/fm801.c,v 1.3.2.8 2002/12/24 21:17:42 semenu Exp $
- * $DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.4 2003/08/07 21:17:13 dillon Exp $
+ * $DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.5 2004/08/09 19:49:28 dillon Exp $
  */
 
 #include <dev/sound/pcm/sound.h>
@@ -32,7 +32,7 @@
 #include <bus/pci/pcireg.h>
 #include <bus/pci/pcivar.h>
 
-SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.4 2003/08/07 21:17:13 dillon Exp $");
+SND_DECLARE_FILE("$DragonFly: src/sys/dev/sound/pci/fm801.c,v 1.5 2004/08/09 19:49:28 dillon Exp $");
 
 #define PCI_VENDOR_FORTEMEDIA  0x1319
 #define PCI_DEVICE_FORTEMEDIA1 0x08011319
@@ -737,11 +737,24 @@ fm801_pci_probe( device_t dev )
                 * power-on value should be `0', while on AC97-less tuner
                 * card (SF64-PCR) it was 0x80.
                 */
+               /*
+                * HACK (on top of the hack above?)
+                * Unfortunately, some fully-sound-capable cards, like the
+                * TerraTec 512i, return 0x80.  I don't know of any other
+                * differences to detect between the cards.  As I have one
+                * of these cards but not an SF64-PCR, I'd prefer to have
+                * the card work, as would others with the same card.
+                * Therefore, not knowing better, disable this check.
+                */
+#ifdef I_HAVE_SF64_PCR
                if (bus_space_read_1(st, sh, 0x28) == 0) {
+#endif
                        device_set_desc(dev,
                            "Forte Media FM801 Audio Controller");
                        result = 0;
+#ifdef I_HAVE_SF64_PCR
                }
+#endif
 
                bus_release_resource(dev, regtype, regid, reg);
        }