diff options
author | sobomax <sobomax@FreeBSD.org> | 2004-09-15 23:47:17 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2004-09-15 23:47:17 +0000 |
commit | 708fc8a4b717807f121be897ed4b94b36291e0f5 (patch) | |
tree | 80a1b5a7ce16c7aec53d34c5349785b5e99b648b /sys | |
parent | 3f6dedb4491a725e1face028b6a4981d67e12595 (diff) | |
download | FreeBSD-src-708fc8a4b717807f121be897ed4b94b36291e0f5.zip FreeBSD-src-708fc8a4b717807f121be897ed4b94b36291e0f5.tar.gz |
Backout the code which tries to use undocumented way to determine if
fm801 has sound capabilities or not. Unfortunately this code doesn't
work as expected.
Submitted by: many
MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/pci/fm801.c | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/sys/dev/sound/pci/fm801.c b/sys/dev/sound/pci/fm801.c index 42e772a..8ff85c6 100644 --- a/sys/dev/sound/pci/fm801.c +++ b/sys/dev/sound/pci/fm801.c @@ -700,49 +700,11 @@ fm801_pci_detach(device_t dev) static int fm801_pci_probe( device_t dev ) { - u_int32_t data; - int id, regtype, regid, result; - struct resource *reg; - bus_space_tag_t st; - bus_space_handle_t sh; - - result = ENXIO; - - if ((id = pci_get_devid(dev)) == PCI_DEVICE_FORTEMEDIA1 ) { - data = pci_read_config(dev, PCIR_COMMAND, 2); - data |= (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN); - pci_write_config(dev, PCIR_COMMAND, data, 2); - data = pci_read_config(dev, PCIR_COMMAND, 2); - - regid = PCIR_BAR(0); - regtype = SYS_RES_IOPORT; - reg = bus_alloc_resource_any(dev, regtype, ®id, RF_ACTIVE); - - if (reg == NULL) - return ENXIO; - - st = rman_get_bustag(reg); - sh = rman_get_bushandle(reg); - /* - * 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. There - * is no "official" way to quickly check this, because all - * IDs are exactly the same. The only difference is 0x28 - * device control register, described in FM801 specification - * as "SRC/Mixer Test Control/DFC Status", but without - * any more detailed explanation. According to specs, and - * available sample cards (SF256-PCP-R and SF256-PCS-R) its - * power-on value should be `0', while on AC97-less tuner - * card (SF64-PCR) it was 0x80. - */ - if (bus_space_read_1(st, sh, 0x28) == 0) { - device_set_desc(dev, - "Forte Media FM801 Audio Controller"); - result = 0; - } + int id; - bus_release_resource(dev, regtype, regid, reg); + if ((id = pci_get_devid(dev)) == PCI_DEVICE_FORTEMEDIA1 ) { + device_set_desc(dev, "Forte Media FM801 Audio Controller"); + return 0; } /* if ((id = pci_get_devid(dev)) == PCI_DEVICE_FORTEMEDIA2 ) { @@ -750,7 +712,7 @@ fm801_pci_probe( device_t dev ) return ENXIO; } */ - return (result); + return ENXIO; } static struct resource * |