主机:VM - RedHat 9.0
开发板:FL2440,linux-2.6.12
arm-linux-gcc:3.4.1
/*
* linux/drivers/video/s3c2410fb.c
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "s3c2410fb.h"
/*
* Complain if VAR is out of range.
*/
#define DEBUG_VAR 1
// 通过写入一个数据到此寄存器来清除SRCPND 寄存器的指定位。其只清除那些数据中被设置为1 的相应
// 位置的SRCPND 位。那些数据中被设置为0 的相应位置的位保持不变。
#define ClearPending(x) {
__raw_writel((1 << (x)), S3C2410_SRCPND);
__raw_writel((1 << (x)), S3C2410_INTPND);
}
struct gzliu_fb_mach_info fs2410_info = {
.pixclock = 270000,
.xres = 320,
.yres = 240,
.bpp = 16,
.hsync_len = 8,
.left_margin = 5,
.right_margin = 15,
.vsync_len = 15,
.upper_margin = 3,
.lower_margin = 5,
.sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
.cmap_greyscale = 0,
.cmap_inverse = 0,
.cmap_static = 0,
.reg = {
.lcdcon1 = (6<<8)|(0<<7)|(3<<5)|(12<<1),
.lcdcon2 = (3<<24) | (239<<14) | (5<<6) | (15),
.lcdcon3 = (58<<19) | (319<<8) | (15),
.lcdcon4 = (13<<8) | (8),
.lcdcon5 = (1<<11) | (0<<10) | (1<<9) | (1<<8) | (0<<7) | (0<<6) | (1<<3) |(0<<1) | (1),
}
};
static void (*gzliu_fb_backlight_power)(int);
static void (*gzliu_fb_lcd_power)(int);
static int gzliu_fb_activate_var(struct fb_var_screeninfo *var, struct gzliu_fb_info *);
static void set_ctrlr_state(struct gzliu_fb_info *fbi, u_int state);
static inline void gzliu_fb_schedule_work(struct gzliu_fb_info *fbi, u_int state)
{
printk("@@@@@@@@@@ gzliu_fb_schedule_work() @@@@@@@@@@@@n");
unsigned long flags;
local_irq_save(flags);
/*
* We need to handle two requests being made at the same time.
* There are two important cases:
* 1. When we are changing VT (C_REENABLE) while unblanking (C_ENABLE)
* We must perform the unblanking, which will do our REENABLE for us.
* 2. When we are blanking, but immediately unblank before we have
* blanked. We do the "REENABLE" thing here as well, just to be sure.
*/
if (fbi->task_state == C_ENABLE && state == C_REENABLE)
state = (u_int) -1;
if (fbi->task_state == C_DISABLE && state == C_ENABLE)
state = C_REENABLE;
if (state != (u_int)-1) {
fbi->task_state = state;
schedule_work(&fbi->task);
}
local_irq_restore(flags);
}
static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf)
{
printk("@@@@@@@@@@ chan_to_field() @@@@@@@@@@@@n");
chan &= 0xffff;
chan >>= 16 - bf->length;
return chan << bf->offset;
}
static int gzliu_fb_setpalettereg(u_int regno, u_int red, u_int green, u_int blue,
u_int trans, struct fb_info *info)
{
printk("@@@@@@@@@@ gzliu_fb_setpalettereg() @@@@@@@@@@@@n");
struct gzliu_fb_info *fbi = (struct gzliu_fb_info *)info;
u_int val, ret = 1;
if (regno < fbi->palette_size) {
if (fbi->fb.var.grayscale) {
val = ((blue >> 8) & 0x00ff);
} else {
val = ((red >> 0) & 0xf800);
val |= ((green >> 5) & 0x07e0);
val |= ((blue >> 11) & 0x001f);
}
fbi->palette_cpu[regno] = val;
ret = 0;
}
return ret;
}
static int gzliu_fb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
u_int trans, struct fb_info *info)
{
-
printk("@@@@@@@@@@ gzliu_fb_setcolreg() @@@@@@@@@@@@n");