diff -ruP -X ../ignorediff linux-2.4.2-pre2-bk20010209.pre/drivers/pcmcia/cs.c linux-2.4.2-pre2-bk20010209-JPG02/drivers/pcmcia/cs.c
--- linux-2.4.2-pre2-bk20010209.pre/drivers/pcmcia/cs.c	Wed Feb  7 02:27:29 2001
+++ linux-2.4.2-pre2-bk20010209-JPG02/drivers/pcmcia/cs.c	Fri Feb  9 15:12:48 2001
@@ -464,6 +464,10 @@
     /* Blank out the socket state */
     s->state &= SOCKET_PRESENT|SOCKET_SETUP_PENDING;
     init_socket(s);
+#ifdef __powerpc__
+    s->socket.flags |= SS_EJECTION;
+    set_socket(s, &s->socket);
+#endif
     s->irq.AssignedIRQ = s->irq.Config = 0;
     s->lock_count = 0;
     s->cis_used = 0;
diff -ruP -X ../ignorediff linux-2.4.2-pre2-bk20010209.pre/drivers/pcmcia/i82365.c linux-2.4.2-pre2-bk20010209-JPG02/drivers/pcmcia/i82365.c
--- linux-2.4.2-pre2-bk20010209.pre/drivers/pcmcia/i82365.c	Fri Jan 12 15:58:23 2001
+++ linux-2.4.2-pre2-bk20010209-JPG02/drivers/pcmcia/i82365.c	Fri Feb  9 15:12:48 2001
@@ -209,14 +209,14 @@
 #define CMD_DFLT (PCI_COMMAND_IO|PCI_COMMAND_MEMORY| \
 		  PCI_COMMAND_MASTER|PCI_COMMAND_WAIT)
 
+#ifdef CONFIG_ISA
 /* These definitions must match the pcic table! */
 typedef enum pcic_id {
-#ifdef CONFIG_ISA
     IS_I82365A, IS_I82365B, IS_I82365DF,
     IS_IBM, IS_RF5Cx96, IS_VLSI, IS_VG468, IS_VG469,
     IS_PD6710, IS_PD672X, IS_VT83C469,
-#endif
 } pcic_id;
+#endif
 
 /* Flags for classifying groups of controllers */
 #define IS_VADEM	0x0001
diff -ruP -X ../ignorediff linux-2.4.2-pre2-bk20010209.pre/drivers/pcmcia/pci_socket.h linux-2.4.2-pre2-bk20010209-JPG02/drivers/pcmcia/pci_socket.h
--- linux-2.4.2-pre2-bk20010209.pre/drivers/pcmcia/pci_socket.h	Thu Jan 25 01:58:35 2001
+++ linux-2.4.2-pre2-bk20010209-JPG02/drivers/pcmcia/pci_socket.h	Fri Feb  9 15:37:40 2001
@@ -6,6 +6,11 @@
 
 #ifndef __PCI_SOCKET_H
 #define __PCI_SOCKET_H
+#ifdef __powerpc__
+#include <asm/prom.h>
+#include <linux/adb.h>
+#include <linux/pmu.h>
+#endif
 
 struct pci_socket_ops;
 struct socket_info_t;
@@ -23,6 +28,10 @@
 	struct socket_info_t *pcmcia_socket;
 	struct tq_struct tq_task;
 	struct timer_list poll_timer;
+#ifdef __powerpc__
+    int	pmu_socket;
+    struct adb_request	pmu_req;
+#endif
 
 	/* A few words of private data for the low-level driver.. */
 	unsigned int private[8];
diff -ruP -X ../ignorediff linux-2.4.2-pre2-bk20010209.pre/drivers/pcmcia/yenta.c linux-2.4.2-pre2-bk20010209-JPG02/drivers/pcmcia/yenta.c
--- linux-2.4.2-pre2-bk20010209.pre/drivers/pcmcia/yenta.c	Fri Jan 12 15:58:23 2001
+++ linux-2.4.2-pre2-bk20010209-JPG02/drivers/pcmcia/yenta.c	Fri Feb  9 15:12:48 2001
@@ -291,6 +291,13 @@
 	/* Socket event mask: get card insert/remove events.. */
 	cb_writel(socket, CB_SOCKET_EVENT, -1);
 	cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK);
+#ifdef __powerpc__
+	if (state->flags & SS_EJECTION) {
+		if (socket->pmu_socket != 0 && socket->pmu_req.complete)
+			pmu_request(&socket->pmu_req, NULL, 2, PMU_PCEJECT, socket->pmu_socket);
+		state->flags &= ~SS_EJECTION;
+	}
+#endif
 	return 0;
 }
 
@@ -665,6 +672,28 @@
 
 	/* Redo card voltage interrogation */
 	cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
+#ifdef __powerpc__
+    /* work out the mapping to PMU socket number */
+    {
+	struct device_node *np;
+	socket->pmu_socket = 0;
+	socket->pmu_req.complete = 1;
+	for (np = find_type_devices("pccard"); np != NULL; np = np->next) {
+	    int *reg = (int *) get_property(np, "reg", NULL);
+	    int *ps = (int *) get_property(np, "AAPL,pmu-socket-number", NULL);
+	    int bus, devfn;
+	    if (reg == NULL || ps == NULL)
+		continue;
+	    bus = (reg[0] >> 16) & 0xff;
+	    devfn = (reg[0] >> 8) & 0xff;
+		if (dev->bus->number == bus && dev->devfn == devfn) {
+		    socket->pmu_socket = *ps;
+		    DEBUG(2, ("socket is pmu socket %d\n", *ps));
+		    break;
+	    }
+	}
+    }
+#endif
 }
 
 /* Called at resume and initialization events */
