^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * broadsheetfb.h - definitions for the broadsheet framebuffer driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2008 by Jaya Kumar
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * License. See the file COPYING in the main directory of this archive for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #ifndef _LINUX_BROADSHEETFB_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define _LINUX_BROADSHEETFB_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) /* Broadsheet command defines */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define BS_CMD_INIT_SYS_RUN 0x06
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define BS_CMD_INIT_DSPE_CFG 0x09
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define BS_CMD_INIT_DSPE_TMG 0x0A
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define BS_CMD_INIT_ROTMODE 0x0B
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define BS_CMD_RD_REG 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define BS_CMD_WR_REG 0x11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define BS_CMD_LD_IMG 0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define BS_CMD_LD_IMG_AREA 0x22
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define BS_CMD_LD_IMG_END 0x23
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define BS_CMD_WAIT_DSPE_TRG 0x28
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define BS_CMD_WAIT_DSPE_FREND 0x29
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define BS_CMD_RD_WFM_INFO 0x30
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define BS_CMD_UPD_INIT 0x32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define BS_CMD_UPD_FULL 0x33
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define BS_CMD_UPD_GDRV_CLR 0x37
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) /* Broadsheet register interface defines */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define BS_REG_REV 0x00
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define BS_REG_PRC 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /* Broadsheet pin interface specific defines */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define BS_CS 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #define BS_DC 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define BS_WR 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) /* Broadsheet IO interface specific defines */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define BS_MMIO_CMD 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define BS_MMIO_DATA 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) /* struct used by broadsheet. board specific stuff comes from *board */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) struct broadsheetfb_par {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct fb_info *info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) struct broadsheet_board *board;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) void (*write_reg)(struct broadsheetfb_par *, u16 reg, u16 val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) u16 (*read_reg)(struct broadsheetfb_par *, u16 reg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) wait_queue_head_t waitq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) int panel_index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) struct mutex io_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) /* board specific routines */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) struct broadsheet_board {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) struct module *owner;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) int (*init)(struct broadsheetfb_par *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) int (*wait_for_rdy)(struct broadsheetfb_par *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) void (*cleanup)(struct broadsheetfb_par *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) int (*get_panel_type)(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) int (*setup_irq)(struct fb_info *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) /* Functions for boards that use GPIO */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) void (*set_ctl)(struct broadsheetfb_par *, unsigned char, u8);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) void (*set_hdb)(struct broadsheetfb_par *, u16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) u16 (*get_hdb)(struct broadsheetfb_par *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) /* Functions for boards that have specialized MMIO */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) void (*mmio_write)(struct broadsheetfb_par *, int type, u16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) u16 (*mmio_read)(struct broadsheetfb_par *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #endif