summaryrefslogtreecommitdiff
path: root/sys/dev/pci/cs4281.c
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2007-10-22 03:16:36 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2007-10-22 03:16:36 +0000
commitd4c68f93dc3b59f50991aad50fc6d1175f988124 (patch)
tree28aef8afa5df31eb49206fc5747c4a1bb9d600df /sys/dev/pci/cs4281.c
parentd69e7e7d6e618c28d4b1141d46816e29b42e3cfd (diff)
Use pci_set_powerstate(), shrinking the code and unifying the different
versions. ok by many.
Diffstat (limited to 'sys/dev/pci/cs4281.c')
-rw-r--r--sys/dev/pci/cs4281.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c
index 84b236ddd95..8e6cc2cd47c 100644
--- a/sys/dev/pci/cs4281.c
+++ b/sys/dev/pci/cs4281.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cs4281.c,v 1.19 2005/11/29 05:42:17 tedu Exp $ */
+/* $OpenBSD: cs4281.c,v 1.20 2007/10/22 03:16:35 fgsch Exp $ */
/* $Tera: cs4281.c,v 1.18 2000/12/27 14:24:45 tacha Exp $ */
/*
@@ -295,7 +295,6 @@ cs4281_attach(parent, self, aux)
pci_chipset_tag_t pc = pa->pa_pc;
char const *intrstr;
pci_intr_handle_t ih;
- int pci_pwrmgmt_cap_reg, pci_pwrmgmt_csr_reg;
/* Map I/O register */
if (pci_mapreg_map(pa, CSCC_PCI_BA0,
@@ -319,18 +318,7 @@ cs4281_attach(parent, self, aux)
* using Windows and rebooting into OpenBSD.
* On my IBM ThinkPad X20, it is set to D3 after using Windows2000.
*/
- if (pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_PWRMGMT,
- &pci_pwrmgmt_cap_reg, 0)) {
- pcireg_t reg;
-
- pci_pwrmgmt_csr_reg = pci_pwrmgmt_cap_reg + PCI_PMCSR;
- reg = pci_conf_read(pa->pa_pc, pa->pa_tag, pci_pwrmgmt_csr_reg);
- if ((reg & PCI_PMCSR_STATE_MASK) != PCI_PMCSR_STATE_D0) {
- pci_conf_write(pc, pa->pa_tag, pci_pwrmgmt_csr_reg,
- (reg & ~PCI_PMCSR_STATE_MASK) |
- PCI_PMCSR_STATE_D0);
- }
- }
+ pci_set_powerstate(pc, pa->pa_tag, PCI_PMCSR_STATE_D0);
/* Map and establish the interrupt. */
if (pci_intr_map(pa, &ih)) {