- struct nand_chip *chip = mtd->priv;
-
- if (ctrl & NAND_CTRL_CHANGE) {
- unsigned char bits;
-
- bits = (ctrl & (NAND_CLE | NAND_ALE)) << 3;
- bits = (ctrl & NAND_NCE) << 7;
-
- clps_writeb((clps_readb(ep7312_pxdr) & 0xB0) | 0x10,
- ep7312_pxdr);
+ switch(cmd) {
+
+ case NAND_CTL_SETCLE:
+ clps_writeb(clps_readb(ep7312_pxdr) | 0x10, ep7312_pxdr);
+ break;
+ case NAND_CTL_CLRCLE:
+ clps_writeb(clps_readb(ep7312_pxdr) & ~0x10, ep7312_pxdr);
+ break;
+
+ case NAND_CTL_SETALE:
+ clps_writeb(clps_readb(ep7312_pxdr) | 0x20, ep7312_pxdr);
+ break;
+ case NAND_CTL_CLRALE:
+ clps_writeb(clps_readb(ep7312_pxdr) & ~0x20, ep7312_pxdr);
+ break;
+
+ case NAND_CTL_SETNCE:
+ clps_writeb((clps_readb(ep7312_pxdr) | 0x80) & ~0x40, ep7312_pxdr);
+ break;
+ case NAND_CTL_CLRNCE:
+ clps_writeb((clps_readb(ep7312_pxdr) | 0x80) | 0x40, ep7312_pxdr);
+ break;