/* ctrl: NAND_NCE: bit 0 -> bit 2 NAND_CLE: bit 1 -> bit 7 NAND_ALE: bit 2 -> bit 6  */
static void ams_delta_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
/* ctrl: NAND_NCE: bit 0 -> bit 2 NAND_CLE: bit 1 -> bit 7 NAND_ALE: bit 2 -> bit 6  */
static void ams_delta_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
{
	if (ctrl & NAND_CTRL_CHANGE) {
		unsigned long bits;
		bits = (~ctrl & NAND_NCE) ? AMS_DELTA_LATCH2_NAND_NCE : 0;
		bits |= (ctrl & NAND_CLE) ? AMS_DELTA_LATCH2_NAND_CLE : 0;
		bits |= (ctrl & NAND_ALE) ? AMS_DELTA_LATCH2_NAND_ALE : 0;
		ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_CLE |
				AMS_DELTA_LATCH2_NAND_ALE |
				AMS_DELTA_LATCH2_NAND_NCE, bits);
	}
	if (cmd != NAND_CMD_NONE)
		ams_delta_write_byte(mtd, cmd);
}