diff options
-rw-r--r-- | sys/dev/sound/pci/fm801.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c index 639200a..1293687 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -223,7 +223,7 @@ fm801_rdcd(kobj_t obj, void *devinfo, int regno) } if (i >= TIMO) { printf("fm801 rdcd: write codec invalid\n"); - return 0; + return -1; } return fm801_rd(fm801,FM_CODEC_DATA,2); @@ -613,6 +613,13 @@ fm801_pci_attach(device_t dev) codec = AC97_CREATE(dev, fm801, fm801_ac97); if (codec == NULL) goto oops; + /* + * XXX: quick check that device actually has sound capabilities. + * The problem is that some cards built around fm801 chip only + * have radio tuner onboard, but no sound capabilities. + */ + if (fm801_rdcd(NULL, fm801, AC97_REG_POWER) == -1) goto oops; + if (mixer_init(dev, ac97_getmixerclass(), codec) == -1) goto oops; fm801->irqid = 0; |