/* ctrl: NAND_NCE: bit 0 -> bit 2 NAND_CLE: bit 1 -> bit 1 NAND_ALE: bit 2 -> bit 0  */
static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
/* ctrl: NAND_NCE: bit 0 -> bit 2 NAND_CLE: bit 1 -> bit 1 NAND_ALE: bit 2 -> bit 0  */
static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{
	struct nand_chip *this = mtd->priv;
	if (ctrl & NAND_CTRL_CHANGE) {
		unsigned char bits;
		bits = (ctrl & NAND_NCE) << 2;
		bits |= ctrl & NAND_CLE;
		bits |= (ctrl & NAND_ALE) >> 2;
		writeb((readb(TS_NAND_CTRL) & ~0x7) | bits, TS_NAND_CTRL);
	}
	if (cmd != NAND_CMD_NONE)
		writeb(cmd, this->IO_ADDR_W);
}