summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authororion <orion@FreeBSD.org>2001-04-19 13:23:50 +0000
committerorion <orion@FreeBSD.org>2001-04-19 13:23:50 +0000
commit783e5f7b883448f537fc71e22084117348742447 (patch)
treef6864606d929633d597e89a4438247c8efd5f69c
parent13de23fccf604aef9f894aa7f884dbf5e741e205 (diff)
downloadFreeBSD-src-783e5f7b883448f537fc71e22084117348742447.zip
FreeBSD-src-783e5f7b883448f537fc71e22084117348742447.tar.gz
Add power on to start sequence for 4.x kernels.
PR: kern/26255 Submitted by: WATANABE Kiyoshi <aab10490@pop16.odn.ne.jp>
-rw-r--r--sys/dev/sound/pci/cs4281.c13
-rw-r--r--sys/dev/sound/pci/cs4281.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c
index 506a58a..9465975 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 09802ac..68a71e7 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
OpenPOWER on IntegriCloud