1255376Sdes/* 2255376Sdes * broadsheetfb.h - definitions for the broadsheet framebuffer driver 3271947Sdes * 491094Sdes * Copyright (C) 2008 by Jaya Kumar 591094Sdes * 691094Sdes * This file is subject to the terms and conditions of the GNU General Public 791094Sdes * License. See the file COPYING in the main directory of this archive for 891094Sdes * more details. 991094Sdes * 1091094Sdes */ 1191094Sdes 12108794Sdes#ifndef _LINUX_BROADSHEETFB_H_ 1391094Sdes#define _LINUX_BROADSHEETFB_H_ 14117610Sdes 1591094Sdes/* Broadsheet command defines */ 1691094Sdes#define BS_CMD_INIT_SYS_RUN 0x06 1791094Sdes#define BS_CMD_INIT_DSPE_CFG 0x09 18236109Sdes#define BS_CMD_INIT_DSPE_TMG 0x0A 1991100Sdes#define BS_CMD_INIT_ROTMODE 0x0B 2091100Sdes#define BS_CMD_RD_REG 0x10 2191100Sdes#define BS_CMD_WR_REG 0x11 2291100Sdes#define BS_CMD_LD_IMG 0x20 23141098Sdes#define BS_CMD_LD_IMG_AREA 0x22 2491100Sdes#define BS_CMD_LD_IMG_END 0x23 2591100Sdes#define BS_CMD_WAIT_DSPE_TRG 0x28 26236109Sdes#define BS_CMD_WAIT_DSPE_FREND 0x29 2791094Sdes#define BS_CMD_RD_WFM_INFO 0x30 2891094Sdes#define BS_CMD_UPD_INIT 0x32 29236109Sdes#define BS_CMD_UPD_FULL 0x33 3091094Sdes#define BS_CMD_UPD_GDRV_CLR 0x37 3191100Sdes 3291100Sdes/* Broadsheet register interface defines */ 3391100Sdes#define BS_REG_REV 0x00 3491094Sdes#define BS_REG_PRC 0x02 3591094Sdes 3691100Sdes/* Broadsheet pin interface specific defines */ 3791100Sdes#define BS_CS 0x01 3891094Sdes#define BS_DC 0x02 3991094Sdes#define BS_WR 0x03 4091094Sdes 4191094Sdes/* Broadsheet IO interface specific defines */ 4291094Sdes#define BS_MMIO_CMD 0x01 4391094Sdes#define BS_MMIO_DATA 0x02 4491094Sdes 45236109Sdes/* struct used by broadsheet. board specific stuff comes from *board */ 46236109Sdesstruct broadsheetfb_par { 47236109Sdes struct fb_info *info; 48117610Sdes struct broadsheet_board *board; 49236109Sdes void (*write_reg)(struct broadsheetfb_par *, u16 reg, u16 val); 50147466Sdes u16 (*read_reg)(struct broadsheetfb_par *, u16 reg); 51117610Sdes wait_queue_head_t waitq; 5291094Sdes int panel_index; 5391094Sdes struct mutex io_lock; 54255376Sdes}; 55255376Sdes 56255376Sdes/* board specific routines */ 57struct broadsheet_board { 58 struct module *owner; 59 int (*init)(struct broadsheetfb_par *); 60 int (*wait_for_rdy)(struct broadsheetfb_par *); 61 void (*cleanup)(struct broadsheetfb_par *); 62 int (*get_panel_type)(void); 63 int (*setup_irq)(struct fb_info *); 64 65 /* Functions for boards that use GPIO */ 66 void (*set_ctl)(struct broadsheetfb_par *, unsigned char, u8); 67 void (*set_hdb)(struct broadsheetfb_par *, u16); 68 u16 (*get_hdb)(struct broadsheetfb_par *); 69 70 /* Functions for boards that have specialized MMIO */ 71 void (*mmio_write)(struct broadsheetfb_par *, int type, u16); 72 u16 (*mmio_read)(struct broadsheetfb_par *); 73}; 74#endif 75