summaryrefslogtreecommitdiffstats
path: root/sys/pccard
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-11-27 06:04:49 +0000
committerimp <imp@FreeBSD.org>2002-11-27 06:04:49 +0000
commitfbbf5407e10e167fe117a161ab5a9762a053774e (patch)
treee4c1abf7cab0af6e5f28e4a8e1a459013f7edcfc /sys/pccard
parent857f556917861ac978f071faa1af8aa6e5b2918a (diff)
downloadFreeBSD-src-fbbf5407e10e167fe117a161ab5a9762a053774e.zip
FreeBSD-src-fbbf5407e10e167fe117a161ab5a9762a053774e.tar.gz
MFp4:
Fix a bug with the 3.3V code for the ricoh bridges. I got the bit detect backwards. Also, we can only detect 3.3V cards when the GPI interrupt is disabled. So when it is enabled assume 5.0V card. Obtained from: NetBSD (takemura-san from patches by ngc@ff.iij4u.or.jp) Approved by: re (blanket)
Diffstat (limited to 'sys/pccard')
-rw-r--r--sys/pccard/pcic.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c
index 122bc24..7c549c0 100644
--- a/sys/pccard/pcic.c
+++ b/sys/pccard/pcic.c
@@ -664,7 +664,7 @@ pcic_cardbus_power(struct pcic_slot *sp, struct slot *slt)
static int
pcic_power(struct slot *slt)
{
- unsigned char c;
+ unsigned char c, c2;
unsigned char reg = PCIC_DISRST | PCIC_PCPWRE;
struct pcic_slot *sp = slt->cdata;
struct pcic_slot *sp2;
@@ -760,22 +760,20 @@ pcic_power(struct slot *slt)
reg |= PCIC_APSENA;
}
if (sc->flags & PCIC_RICOH_POWER) {
- switch (sp->controller) {
- case PCIC_RF5C396:
- case PCIC_RF5C296:
- /*
- * The ISA bridge have the 5V/3.3V in register
- * 1, bit 7.
- */
- c = sp->getb(sp, PCIC_STATUS);
- if ((c & PCIC_RICOH_5VCARD) == 0)
- slt->pwr.vcc = 33;
- else
- slt->pwr.vcc = 50;
- break;
- }
+ /*
+ * The ISA bridge have the 5V/3.3V in register
+ * 1, bit 7. However, 3.3V cards can only be
+ * detected if GPI_EN is disabled.
+ */
+ c = sp->getb(sp, PCIC_STATUS);
+ c2 = sp->getb(sp, PCIC_CDGC);
+ if ((c & PCIC_RICOH_5VCARD) && (c2 & PCIC_GPI_EN) == 0)
+ slt->pwr.vcc = 33;
+ else
+ slt->pwr.vcc = 50;
}
- /* Other bridges here */
+ /* Other power schemes here */
+
if (bootverbose && slt->pwr.vcc != -1)
device_printf(sc->dev, "Autodetected %d.%dV card\n",
slt->pwr.vcc / 10, slt->pwr.vcc %10);
OpenPOWER on IntegriCloud