Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc/dev Eject PCMCIA card on ohare based models ...



details:   https://anonhg.NetBSD.org/src/rev/4c77f1ac7fdf
branches:  trunk
changeset: 512810:4c77f1ac7fdf
user:      tsubai <tsubai%NetBSD.org@localhost>
date:      Tue Jul 17 12:33:45 2001 +0000

description:
Eject PCMCIA card on ohare based models only.

diffstat:

 sys/arch/macppc/dev/akbd.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (62 lines):

diff -r 48a158383e70 -r 4c77f1ac7fdf sys/arch/macppc/dev/akbd.c
--- a/sys/arch/macppc/dev/akbd.c        Tue Jul 17 12:16:43 2001 +0000
+++ b/sys/arch/macppc/dev/akbd.c        Tue Jul 17 12:33:45 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: akbd.c,v 1.15 2001/07/12 04:16:58 nathanw Exp $        */
+/*     $NetBSD: akbd.c,v 1.16 2001/07/17 12:33:45 tsubai Exp $ */
 
 /*
  * Copyright (C) 1998  Colin Wood
@@ -43,16 +43,17 @@
 #include <dev/wscons/wskbdvar.h>
 #include <dev/wscons/wsksymdef.h>
 #include <dev/wscons/wsksymvar.h>
+#include <dev/ofw/openfirm.h>
 
 #include <machine/autoconf.h>
 #define KEYBOARD_ARRAY
 #include <machine/keyboard.h>
 
 #include <macppc/dev/adbvar.h>
-#include <macppc/dev/pm_direct.h>
 #include <macppc/dev/aedvar.h>
 #include <macppc/dev/akbdmap.h>
 #include <macppc/dev/akbdvar.h>
+#include <macppc/dev/pm_direct.h>
 
 #include "aed.h"
 
@@ -104,6 +105,7 @@
 };
 
 static int akbd_is_console;
+static int pcmcia_soft_eject;
 
 static int
 akbdmatch(parent, cf, aux)
@@ -132,6 +134,10 @@
        u_char buffer[9];
        struct wskbddev_attach_args a;
 
+       /* ohare based models have soft ejectable card slot. */
+       if (OF_finddevice("/bandit/ohare") != -1)
+               pcmcia_soft_eject = 1;
+
        sc->origaddr = aa_args->origaddr;
        sc->adbaddr = aa_args->adbaddr;
        sc->handler_id = aa_args->handler_id;
@@ -482,10 +488,12 @@
                type = WSCONS_EVENT_KEY_UP;
                break;
        case 245:
-               pm_eject_pcmcia(0);
+               if (pcmcia_soft_eject)
+                       pm_eject_pcmcia(0);
                break;
        case 244:
-               pm_eject_pcmcia(1);
+               if (pcmcia_soft_eject)
+                       pm_eject_pcmcia(1);
                break;
        }
 



Home | Main Index | Thread Index | Old Index