summaryrefslogtreecommitdiff
path: root/sys/dev/pci/pccbb.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2012-10-18 21:40:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2012-10-18 21:40:50 +0000
commit3009bb760d67d343c20274e3b032edd5b53e2ea3 (patch)
tree0d4d4ccf04f9b3b2294f6f5adcf787c0c7abb203 /sys/dev/pci/pccbb.c
parent1211b87f8dddc631841df5d98575d01a2a8f5e48 (diff)
Use pci_set_powerstate() unconditionally for all chip variants, rather
than a kludged together chunk of code for just one chip, which happens to be entirely wrong. We need to watch for regressions on cardbus, though. ok kettenis
Diffstat (limited to 'sys/dev/pci/pccbb.c')
-rw-r--r--sys/dev/pci/pccbb.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c
index e2d233d766e..6136d2ed2c1 100644
--- a/sys/dev/pci/pccbb.c
+++ b/sys/dev/pci/pccbb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccbb.c,v 1.88 2012/10/08 21:47:50 deraadt Exp $ */
+/* $OpenBSD: pccbb.c,v 1.89 2012/10/18 21:40:49 deraadt Exp $ */
/* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */
/*
@@ -606,6 +606,9 @@ pccbb_chipinit(struct pccbb_softc *sc)
pcitag_t tag = sc->sc_tag;
pcireg_t reg;
+ /* Power on the controller if the BIOS didn't */
+ pci_set_powerstate(pc, tag, PCI_PMCSR_STATE_D0);
+
/*
* Set PCI command reg.
* Some laptop's BIOSes (i.e. TICO) do not enable CardBus chip.
@@ -730,12 +733,6 @@ pccbb_chipinit(struct pccbb_softc *sc)
bus_space_write_1(sc->sc_base_memt, sc->sc_base_memh,
0x800 + 0x3e, bus_space_read_1(sc->sc_base_memt,
sc->sc_base_memh, 0x800 + 0x3e) | 0x03);
-
- /* Power on the controller if the BIOS didn't */
- reg = pci_conf_read(pc, tag, TOPIC100_PMCSR);
- if ((reg & TOPIC100_PMCSR_MASK) != TOPIC100_PMCSR_D0)
- pci_conf_write(pc, tag, TOPIC100_PMCSR,
- (reg & ~TOPIC100_PMCSR_MASK) | TOPIC100_PMCSR_D0);
break;
case CB_OLDO2MICRO: