/* Update interrupt register. The status depends on command.  */
static void onenand_update_interrupt(struct onenand_chip *this, int cmd)
/* Update interrupt register. The status depends on command.  */
static void onenand_update_interrupt(struct onenand_chip *this, int cmd)
{
	int interrupt = ONENAND_INT_MASTER;
	switch (cmd) {
	case ONENAND_CMD_READ:
	case ONENAND_CMD_READOOB:
		interrupt |= ONENAND_INT_READ;
		break;
	case ONENAND_CMD_PROG:
	case ONENAND_CMD_PROGOOB:
		interrupt |= ONENAND_INT_WRITE;
		break;
	case ONENAND_CMD_ERASE:
		interrupt |= ONENAND_INT_ERASE;
		break;
	case ONENAND_CMD_RESET:
		interrupt |= ONENAND_INT_RESET;
		break;
	default:
		break;
	}
	writew(interrupt, this->base + ONENAND_REG_INTERRUPT);
}