diff options
| author | Orion Hodson <orion@FreeBSD.org> | 2001-04-19 13:23:50 +0000 |
|---|---|---|
| committer | Orion Hodson <orion@FreeBSD.org> | 2001-04-19 13:23:50 +0000 |
| commit | 5090c9953cc68cfb6e1de71a207b069c3b30fab1 (patch) | |
| tree | 70cf97f403bc596a8d7efb92e62a328cb1d1f2e8 /sys/dev/sound | |
| parent | 2322ee63c2432a84597baaaee29c1d958700d4b5 (diff) | |
Notes
Diffstat (limited to 'sys/dev/sound')
| -rw-r--r-- | sys/dev/sound/pci/cs4281.c | 13 | ||||
| -rw-r--r-- | sys/dev/sound/pci/cs4281.h | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c index 506a58a18e9b..9465975c8c6e 100644 --- a/sys/dev/sound/pci/cs4281.c +++ b/sys/dev/sound/pci/cs4281.c @@ -767,8 +767,6 @@ cs4281_pci_attach(device_t dev) data |= (PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); pci_write_config(dev, PCIR_COMMAND, data, 2); - data = pci_read_config(dev, PCIR_COMMAND, 2); - #if __FreeBSD_version > 500000 if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { /* Reset the power state. */ @@ -777,7 +775,18 @@ cs4281_pci_attach(device_t dev) pci_set_powerstate(dev, PCI_POWERSTATE_D0); } +#else + data = pci_read_config(dev, CS4281PCI_PMCS_OFFSET, 4); + if (data & CS4281PCI_PMCS_PS_MASK) { + /* Reset the power state. */ + device_printf(dev, "chip is in D%d power mode " + "-- setting to D0\n", + data & CS4281PCI_PMCS_PS_MASK); + pci_write_config(dev, CS4281PCI_PMCS_OFFSET, + data & ~CS4281PCI_PMCS_PS_MASK, 4); + } #endif + sc->regid = PCIR_MAPS; sc->regtype = SYS_RES_MEMORY; sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, diff --git a/sys/dev/sound/pci/cs4281.h b/sys/dev/sound/pci/cs4281.h index 09802ac316c7..68a71e7b7f0a 100644 --- a/sys/dev/sound/pci/cs4281.h +++ b/sys/dev/sound/pci/cs4281.h @@ -103,6 +103,7 @@ #define CS4281PCI_PMCS 0x344 # define CS4281PCI_PMCS_PS_MASK 0x00000003 +#define CS4281PCI_PMCS_OFFSET (CS4281PCI_PMCS - 0x300) #define CS4281PCI_CWPR 0x3e0 # define CS4281PCI_CWPR_MAGIC 0x00004281 |
