2005-04-17 00:20:36 +02:00
|
|
|
#ifndef __PXAFB_H__
|
|
|
|
#define __PXAFB_H__
|
|
|
|
|
|
|
|
/*
|
|
|
|
* linux/drivers/video/pxafb.h
|
|
|
|
* -- Intel PXA250/210 LCD Controller Frame Buffer Device
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 Eric A. Thomas.
|
|
|
|
* Copyright (C) 2004 Jean-Frederic Clere.
|
|
|
|
* Copyright (C) 2004 Ian Campbell.
|
|
|
|
* Copyright (C) 2004 Jeff Lackey.
|
|
|
|
* Based on sa1100fb.c Copyright (C) 1999 Eric A. Thomas
|
|
|
|
* which in turn is
|
|
|
|
* Based on acornfb.c Copyright (C) Russell King.
|
|
|
|
*
|
|
|
|
* 2001-08-03: Cliff Brake <cbrake@acclent.com>
|
|
|
|
* - ported SA1100 code to PXA
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file COPYING in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* PXA LCD DMA descriptor */
|
|
|
|
struct pxafb_dma_descriptor {
|
|
|
|
unsigned int fdadr;
|
|
|
|
unsigned int fsadr;
|
|
|
|
unsigned int fidr;
|
|
|
|
unsigned int ldcmd;
|
|
|
|
};
|
|
|
|
|
2008-04-30 09:52:21 +02:00
|
|
|
enum {
|
|
|
|
PAL_NONE = -1,
|
|
|
|
PAL_BASE = 0,
|
|
|
|
PAL_OV1 = 1,
|
|
|
|
PAL_OV2 = 2,
|
|
|
|
PAL_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
DMA_BASE = 0,
|
|
|
|
DMA_UPPER = 0,
|
|
|
|
DMA_LOWER = 1,
|
|
|
|
DMA_OV1 = 1,
|
|
|
|
DMA_OV2_Y = 2,
|
|
|
|
DMA_OV2_Cb = 3,
|
|
|
|
DMA_OV2_Cr = 4,
|
|
|
|
DMA_CURSOR = 5,
|
|
|
|
DMA_CMD = 6,
|
|
|
|
DMA_MAX,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* maximum palette size - 256 entries, each 4 bytes long */
|
|
|
|
#define PALETTE_SIZE (256 * 4)
|
2008-04-30 09:52:26 +02:00
|
|
|
#define CMD_BUFF_SIZE (1024 * 50)
|
2008-04-30 09:52:21 +02:00
|
|
|
|
|
|
|
struct pxafb_dma_buff {
|
|
|
|
unsigned char palette[PAL_MAX * PALETTE_SIZE];
|
2008-04-30 09:52:26 +02:00
|
|
|
uint16_t cmd_buff[CMD_BUFF_SIZE];
|
2008-04-30 09:52:21 +02:00
|
|
|
struct pxafb_dma_descriptor pal_desc[PAL_MAX];
|
|
|
|
struct pxafb_dma_descriptor dma_desc[DMA_MAX];
|
|
|
|
};
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
struct pxafb_info {
|
|
|
|
struct fb_info fb;
|
|
|
|
struct device *dev;
|
2007-08-20 11:18:42 +02:00
|
|
|
struct clk *clk;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2008-04-30 09:52:21 +02:00
|
|
|
void __iomem *mmio_base;
|
|
|
|
|
2008-04-30 09:52:21 +02:00
|
|
|
struct pxafb_dma_buff *dma_buff;
|
|
|
|
dma_addr_t dma_buff_phys;
|
|
|
|
dma_addr_t fdadr[DMA_MAX];
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
/*
|
|
|
|
* These are the addresses we mapped
|
|
|
|
* the framebuffer memory region to.
|
|
|
|
*/
|
|
|
|
/* raw memory addresses */
|
|
|
|
dma_addr_t map_dma; /* physical */
|
|
|
|
u_char * map_cpu; /* virtual */
|
|
|
|
u_int map_size;
|
|
|
|
|
|
|
|
/* addresses of pieces placed in raw buffer */
|
|
|
|
u_char * screen_cpu; /* virtual address of frame buffer */
|
|
|
|
dma_addr_t screen_dma; /* physical address of frame buffer */
|
|
|
|
u16 * palette_cpu; /* virtual address of palette memory */
|
|
|
|
u_int palette_size;
|
2008-04-30 09:52:26 +02:00
|
|
|
ssize_t video_offset;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
|
|
|
u_int lccr0;
|
|
|
|
u_int lccr3;
|
2007-10-16 10:28:41 +02:00
|
|
|
u_int lccr4;
|
2005-04-17 00:20:36 +02:00
|
|
|
u_int cmap_inverse:1,
|
|
|
|
cmap_static:1,
|
|
|
|
unused:30;
|
|
|
|
|
|
|
|
u_int reg_lccr0;
|
|
|
|
u_int reg_lccr1;
|
|
|
|
u_int reg_lccr2;
|
|
|
|
u_int reg_lccr3;
|
2007-10-16 10:28:41 +02:00
|
|
|
u_int reg_lccr4;
|
2008-04-30 09:52:26 +02:00
|
|
|
u_int reg_cmdcr;
|
2005-04-17 00:20:36 +02:00
|
|
|
|
2005-09-09 22:10:03 +02:00
|
|
|
unsigned long hsync_time;
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
volatile u_char state;
|
|
|
|
volatile u_char task_state;
|
2008-07-24 06:31:14 +02:00
|
|
|
struct mutex ctrlr_lock;
|
2005-04-17 00:20:36 +02:00
|
|
|
wait_queue_head_t ctrlr_wait;
|
|
|
|
struct work_struct task;
|
|
|
|
|
2008-04-30 09:52:24 +02:00
|
|
|
struct completion disable_done;
|
|
|
|
|
2008-04-30 09:52:26 +02:00
|
|
|
#ifdef CONFIG_FB_PXA_SMARTPANEL
|
|
|
|
uint16_t *smart_cmds;
|
|
|
|
size_t n_smart_cmds;
|
|
|
|
struct completion command_done;
|
|
|
|
struct completion refresh_done;
|
|
|
|
struct task_struct *smart_thread;
|
|
|
|
#endif
|
|
|
|
|
2005-04-17 00:20:36 +02:00
|
|
|
#ifdef CONFIG_CPU_FREQ
|
|
|
|
struct notifier_block freq_transition;
|
|
|
|
struct notifier_block freq_policy;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These are the actions for set_ctrlr_state
|
|
|
|
*/
|
|
|
|
#define C_DISABLE (0)
|
|
|
|
#define C_ENABLE (1)
|
|
|
|
#define C_DISABLE_CLKCHANGE (2)
|
|
|
|
#define C_ENABLE_CLKCHANGE (3)
|
|
|
|
#define C_REENABLE (4)
|
|
|
|
#define C_DISABLE_PM (5)
|
|
|
|
#define C_ENABLE_PM (6)
|
|
|
|
#define C_STARTUP (7)
|
|
|
|
|
|
|
|
#define PXA_NAME "PXA"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Minimum X and Y resolutions
|
|
|
|
*/
|
|
|
|
#define MIN_XRES 64
|
|
|
|
#define MIN_YRES 64
|
|
|
|
|
|
|
|
#endif /* __PXAFB_H__ */
|