patch-2.4.22 linux-2.4.22/drivers/pcmcia/au1000_pb1x00.c
Next file: linux-2.4.22/drivers/pcmcia/au1000_xxs1500.c
Previous file: linux-2.4.22/drivers/pcmcia/au1000_generic.c
Back to the patch index
Back to the overall index
- Lines: 113
- Date:
2003-08-25 04:44:42.000000000 -0700
- Orig file:
linux-2.4.21/drivers/pcmcia/au1000_pb1x00.c
- Orig date:
2002-11-28 15:53:14.000000000 -0800
diff -urN linux-2.4.21/drivers/pcmcia/au1000_pb1x00.c linux-2.4.22/drivers/pcmcia/au1000_pb1x00.c
@@ -54,7 +54,7 @@
#define PCMCIA_IRQ AU1000_GPIO_15
#elif defined (CONFIG_MIPS_PB1500)
#include <asm/pb1500.h>
-#define PCMCIA_IRQ AU1000_GPIO_11 /* fixme */
+#define PCMCIA_IRQ AU1500_GPIO_203
#elif defined (CONFIG_MIPS_PB1100)
#include <asm/pb1100.h>
#define PCMCIA_IRQ AU1000_GPIO_11
@@ -81,9 +81,9 @@
#else /* fixme -- take care of the Pb1500 at some point */
u16 pcr;
- pcr = au_readw(PB1100_MEM_PCMCIA) & ~0xf; /* turn off power */
- pcr &= ~(PB1100_PC_DEASSERT_RST | PB1100_PC_DRV_EN);
- au_writew(pcr, PB1100_MEM_PCMCIA);
+ pcr = au_readw(PCMCIA_BOARD_REG) & ~0xf; /* turn off power */
+ pcr &= ~(PC_DEASSERT_RST | PC_DRV_EN);
+ au_writew(pcr, PCMCIA_BOARD_REG);
au_sync_delay(500);
return PCMCIA_NUM_SOCKS;
#endif
@@ -101,9 +101,9 @@
return 0;
#else
u16 pcr;
- pcr = au_readw(PB1100_MEM_PCMCIA) & ~0xf; /* turn off power */
- pcr &= ~(PB1100_PC_DEASSERT_RST | PB1100_PC_DRV_EN);
- au_writew(pcr, PB1100_MEM_PCMCIA);
+ pcr = au_readw(PCMCIA_BOARD_REG) & ~0xf; /* turn off power */
+ pcr &= ~(PC_DEASSERT_RST | PC_DRV_EN);
+ au_writew(pcr, PCMCIA_BOARD_REG);
au_sync_delay(2);
return 0;
#endif
@@ -122,9 +122,14 @@
vs0 = (vs0 >> 4) & 0x3;
vs1 = (vs1 >> 12) & 0x3;
#else
- vs0 = (au_readw(PB1100_BOARD_STATUS) >> 4) & 0x3;
+ vs0 = (au_readw(BOARD_STATUS_REG) >> 4) & 0x3;
+#ifdef CONFIG_MIPS_PB1500
+ inserted0 = !((au_readl(GPIO2_PIN_STATE) >> 1) & 0x1); /* gpio 201 */
+#else /* Pb1100 */
inserted0 = !((au_readl(SYS_PINSTATERD) >> 9) & 0x1); /* gpio 9 */
#endif
+ inserted1 = 0;
+#endif
state->ready = 0;
state->vs_Xv = 0;
@@ -144,7 +149,7 @@
/* return without setting 'detect' */
printk(KERN_ERR "pb1x00 bad VS (%d)\n",
vs0);
- return;
+ return 0;
}
state->detect = 1;
}
@@ -162,7 +167,7 @@
/* return without setting 'detect' */
printk(KERN_ERR "pb1x00 bad VS (%d)\n",
vs1);
- return;
+ return 0;
}
state->detect = 1;
}
@@ -323,7 +328,7 @@
#else
- pcr = au_readw(PB1100_MEM_PCMCIA) & ~0xf;
+ pcr = au_readw(PCMCIA_BOARD_REG) & ~0xf;
DEBUG(KERN_INFO "Vcc %dV Vpp %dV, pcr %x, reset %d\n",
configure->vcc, configure->vpp, pcr, configure->reset);
@@ -382,26 +387,27 @@
break;
}
- au_writew(pcr, PB1100_MEM_PCMCIA);
+ au_writew(pcr, PCMCIA_BOARD_REG);
au_sync_delay(300);
if (!configure->reset) {
- pcr |= PB1100_PC_DRV_EN;
- au_writew(pcr, PB1100_MEM_PCMCIA);
+ pcr |= PC_DRV_EN;
+ au_writew(pcr, PCMCIA_BOARD_REG);
au_sync_delay(100);
- pcr |= PB1100_PC_DEASSERT_RST;
- au_writew(pcr, PB1100_MEM_PCMCIA);
+ pcr |= PC_DEASSERT_RST;
+ au_writew(pcr, PCMCIA_BOARD_REG);
au_sync_delay(100);
}
else {
- pcr &= ~(PB1100_PC_DEASSERT_RST | PB1100_PC_DRV_EN);
- au_writew(pcr, PB1100_MEM_PCMCIA);
+ pcr &= ~(PC_DEASSERT_RST | PC_DRV_EN);
+ au_writew(pcr, PCMCIA_BOARD_REG);
au_sync_delay(100);
}
#endif
return 0;
}
+
struct pcmcia_low_level pb1x00_pcmcia_ops = {
pb1x00_pcmcia_init,
pb1x00_pcmcia_shutdown,
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)