/*
 *  File Name       : linux/include/asm-arm/arch-mp200/lcdc_intr.h
 *  Function        : LCDC Interrupt (VSYNC)
 *  Release Version : Ver 1.00
 *  Release Date    : 2005/05/16
 *
 *  Copyright (C) NEC Electronics Corporation 2005
 *
 *
 *  This program is free software;you can redistribute it and/or modify it under the terms of
 *  the GNU General Public License as published by Free Softwere Foundation; either version 2
 *  of License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *  without even the implied warrnty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with this program;
 *  If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 *  MA 02111-1307, USA.
 *
 */

#ifndef ASM_ARM_ARCH_MP200_LCDC_INTR_H
#define ASM_ARM_ARCH_MP200_LCDC_INTR_H

#include <linux/list.h>

/* LCDC_INTSTATUS, LCDC_INTENSET, LCDC_INTENCLR, and LCDC_INTFFCLR bits */
#define LCDC_LCDVS		(1U<<0)
#define LCDC_DMAERR		(1U<<1)
#define LCDC_DMASTOP		(1U<<2)
#define LCDC_UNDERRUN		(1U<<3)
#define LCDC_LCDSTOP		(1U<<4)

#define LCDC_INT_MASK		0x1f

#define ACT_SIZE		16	/* receive callback entry */

typedef struct lcdc_vsync_action {
	unsigned long count;	/* expire count, 0 is same as 1 */
	int reschedule;		/* reschedule flag */
	int immediately;	/* immediately execution in VSYNC */
	int high_priority;	/* high priority flag */
	void (*function) (unsigned long data);	/* callback */
	unsigned long data;	/* any data */
} lcdc_vsync_action_t;

extern void (*set_lcdc_intr_handler(unsigned int bit,
				    void (*func) (unsigned long))) (unsigned
								    long);
extern int add_vsync_action(lcdc_vsync_action_t * act);
extern int del_vsync_action(lcdc_vsync_action_t * act);
extern int mod_vsync_action(lcdc_vsync_action_t * act);
extern int enable_vsync_interrupt(void);
extern int disable_vsync_interrupt(void);
extern int enable_vsync_action(lcdc_vsync_action_t * act);
extern int disable_vsync_action(lcdc_vsync_action_t * act);

#endif
