18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * broadsheetfb.h - definitions for the broadsheet framebuffer driver
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (C) 2008 by Jaya Kumar
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
78c2ecf20Sopenharmony_ci * License. See the file COPYING in the main directory of this archive for
88c2ecf20Sopenharmony_ci * more details.
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef _LINUX_BROADSHEETFB_H_
138c2ecf20Sopenharmony_ci#define _LINUX_BROADSHEETFB_H_
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/* Broadsheet command defines */
168c2ecf20Sopenharmony_ci#define BS_CMD_INIT_SYS_RUN	0x06
178c2ecf20Sopenharmony_ci#define BS_CMD_INIT_DSPE_CFG	0x09
188c2ecf20Sopenharmony_ci#define BS_CMD_INIT_DSPE_TMG	0x0A
198c2ecf20Sopenharmony_ci#define BS_CMD_INIT_ROTMODE	0x0B
208c2ecf20Sopenharmony_ci#define BS_CMD_RD_REG		0x10
218c2ecf20Sopenharmony_ci#define BS_CMD_WR_REG		0x11
228c2ecf20Sopenharmony_ci#define BS_CMD_LD_IMG		0x20
238c2ecf20Sopenharmony_ci#define BS_CMD_LD_IMG_AREA	0x22
248c2ecf20Sopenharmony_ci#define BS_CMD_LD_IMG_END	0x23
258c2ecf20Sopenharmony_ci#define BS_CMD_WAIT_DSPE_TRG	0x28
268c2ecf20Sopenharmony_ci#define BS_CMD_WAIT_DSPE_FREND	0x29
278c2ecf20Sopenharmony_ci#define BS_CMD_RD_WFM_INFO	0x30
288c2ecf20Sopenharmony_ci#define BS_CMD_UPD_INIT		0x32
298c2ecf20Sopenharmony_ci#define BS_CMD_UPD_FULL		0x33
308c2ecf20Sopenharmony_ci#define BS_CMD_UPD_GDRV_CLR	0x37
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci/* Broadsheet register interface defines */
338c2ecf20Sopenharmony_ci#define BS_REG_REV		0x00
348c2ecf20Sopenharmony_ci#define BS_REG_PRC		0x02
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/* Broadsheet pin interface specific defines */
378c2ecf20Sopenharmony_ci#define BS_CS	0x01
388c2ecf20Sopenharmony_ci#define BS_DC 	0x02
398c2ecf20Sopenharmony_ci#define BS_WR 	0x03
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci/* Broadsheet IO interface specific defines */
428c2ecf20Sopenharmony_ci#define BS_MMIO_CMD	0x01
438c2ecf20Sopenharmony_ci#define BS_MMIO_DATA	0x02
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci/* struct used by broadsheet. board specific stuff comes from *board */
468c2ecf20Sopenharmony_cistruct broadsheetfb_par {
478c2ecf20Sopenharmony_ci	struct fb_info *info;
488c2ecf20Sopenharmony_ci	struct broadsheet_board *board;
498c2ecf20Sopenharmony_ci	void (*write_reg)(struct broadsheetfb_par *, u16 reg, u16 val);
508c2ecf20Sopenharmony_ci	u16 (*read_reg)(struct broadsheetfb_par *, u16 reg);
518c2ecf20Sopenharmony_ci	wait_queue_head_t waitq;
528c2ecf20Sopenharmony_ci	int panel_index;
538c2ecf20Sopenharmony_ci	struct mutex io_lock;
548c2ecf20Sopenharmony_ci};
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/* board specific routines */
578c2ecf20Sopenharmony_cistruct broadsheet_board {
588c2ecf20Sopenharmony_ci	struct module *owner;
598c2ecf20Sopenharmony_ci	int (*init)(struct broadsheetfb_par *);
608c2ecf20Sopenharmony_ci	int (*wait_for_rdy)(struct broadsheetfb_par *);
618c2ecf20Sopenharmony_ci	void (*cleanup)(struct broadsheetfb_par *);
628c2ecf20Sopenharmony_ci	int (*get_panel_type)(void);
638c2ecf20Sopenharmony_ci	int (*setup_irq)(struct fb_info *);
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	/* Functions for boards that use GPIO */
668c2ecf20Sopenharmony_ci	void (*set_ctl)(struct broadsheetfb_par *, unsigned char, u8);
678c2ecf20Sopenharmony_ci	void (*set_hdb)(struct broadsheetfb_par *, u16);
688c2ecf20Sopenharmony_ci	u16 (*get_hdb)(struct broadsheetfb_par *);
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci	/* Functions for boards that have specialized MMIO */
718c2ecf20Sopenharmony_ci	void (*mmio_write)(struct broadsheetfb_par *, int type, u16);
728c2ecf20Sopenharmony_ci	u16 (*mmio_read)(struct broadsheetfb_par *);
738c2ecf20Sopenharmony_ci};
748c2ecf20Sopenharmony_ci#endif
75