Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * broadsheetfb.h - definitions for the broadsheet framebuffer driver
0003  *
0004  * Copyright (C) 2008 by Jaya Kumar
0005  *
0006  * This file is subject to the terms and conditions of the GNU General Public
0007  * License. See the file COPYING in the main directory of this archive for
0008  * more details.
0009  *
0010  */
0011 
0012 #ifndef _LINUX_BROADSHEETFB_H_
0013 #define _LINUX_BROADSHEETFB_H_
0014 
0015 /* Broadsheet command defines */
0016 #define BS_CMD_INIT_SYS_RUN 0x06
0017 #define BS_CMD_INIT_DSPE_CFG    0x09
0018 #define BS_CMD_INIT_DSPE_TMG    0x0A
0019 #define BS_CMD_INIT_ROTMODE 0x0B
0020 #define BS_CMD_RD_REG       0x10
0021 #define BS_CMD_WR_REG       0x11
0022 #define BS_CMD_LD_IMG       0x20
0023 #define BS_CMD_LD_IMG_AREA  0x22
0024 #define BS_CMD_LD_IMG_END   0x23
0025 #define BS_CMD_WAIT_DSPE_TRG    0x28
0026 #define BS_CMD_WAIT_DSPE_FREND  0x29
0027 #define BS_CMD_RD_WFM_INFO  0x30
0028 #define BS_CMD_UPD_INIT     0x32
0029 #define BS_CMD_UPD_FULL     0x33
0030 #define BS_CMD_UPD_GDRV_CLR 0x37
0031 
0032 /* Broadsheet register interface defines */
0033 #define BS_REG_REV      0x00
0034 #define BS_REG_PRC      0x02
0035 
0036 /* Broadsheet pin interface specific defines */
0037 #define BS_CS   0x01
0038 #define BS_DC   0x02
0039 #define BS_WR   0x03
0040 
0041 /* Broadsheet IO interface specific defines */
0042 #define BS_MMIO_CMD 0x01
0043 #define BS_MMIO_DATA    0x02
0044 
0045 /* struct used by broadsheet. board specific stuff comes from *board */
0046 struct broadsheetfb_par {
0047     struct fb_info *info;
0048     struct broadsheet_board *board;
0049     void (*write_reg)(struct broadsheetfb_par *, u16 reg, u16 val);
0050     u16 (*read_reg)(struct broadsheetfb_par *, u16 reg);
0051     wait_queue_head_t waitq;
0052     int panel_index;
0053     struct mutex io_lock;
0054 };
0055 
0056 /* board specific routines */
0057 struct broadsheet_board {
0058     struct module *owner;
0059     int (*init)(struct broadsheetfb_par *);
0060     int (*wait_for_rdy)(struct broadsheetfb_par *);
0061     void (*cleanup)(struct broadsheetfb_par *);
0062     int (*get_panel_type)(void);
0063     int (*setup_irq)(struct fb_info *);
0064 
0065     /* Functions for boards that use GPIO */
0066     void (*set_ctl)(struct broadsheetfb_par *, unsigned char, u8);
0067     void (*set_hdb)(struct broadsheetfb_par *, u16);
0068     u16 (*get_hdb)(struct broadsheetfb_par *);
0069 
0070     /* Functions for boards that have specialized MMIO */
0071     void (*mmio_write)(struct broadsheetfb_par *, int type, u16);
0072     u16 (*mmio_read)(struct broadsheetfb_par *);
0073 };
0074 #endif