/* 2012-09-16: File added by Sony Corporation */
/*
 * icx_lcd.h
 *
 * Copyright 2011 Sony Corporation.
 *
 * 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
 * the Free Software Foundation; either version 2 of the 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 warranty 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 __ICX_LCD_H__
#define __ICX_LCD_H__


#ifndef mdelay
	#define mdelay(n) ({unsigned long msec=(n); while (msec--) udelay(1000);})
#endif /* mdelay */


/*******/
/* I/F */
/*******/

/* kind of image */
#define IMAGE_ID_BOOT   	 		NVP_ID_BOOT_IMAGE
#define IMAGE_ID_HOLD    			NVP_ID_HOLD_IMAGE
#define IMAGE_ID_LOWBATT 			NVP_ID_LOWBATT_IMAGE

/* brightness parameter */
#define LCD_BRIGHTNESS_MAX			100
#define LCD_BRIGHTNESS_MIN			0

/* fade parameter */
#define LCD_FADE_INTERVAL_OPENING	5000
#define LCD_FADE_INTERVAL_HOLD		1000
#define LCD_FADE_INTERVAL_LOWBATT	1000
#define LCD_FADE_INTERVAL_OFF		100


/*******************/
/* Type definition */
/*******************/

typedef struct {
	int  (*power_on)(const lcdc_config_t* config);
	void (*power_off)(void);
} lcd_ops_t;


/**************/
/* Prototypes */
/**************/

int  lcd_init(void);
void lcd_exit(void);
int  lcd_power_on(void);
void lcd_power_off(void);
int  lcd_draw_image(int id);
int  lcd_set_brightness(int brightness, int interval);


#endif /* __ICX_LCD_H__ */
