接着上文讲到的结构体struct s3cfb_fimd_info_t s3cfb_fimd(见drivers/video/samsung/s3cfb_fimd5x.c)
由结构命名FIMD: Fully Interactive Mobile Display (完全交互式移动显示设备)以及结构体原形,猜测与硬件配置有关。
1,struct s3cfb_info_t 结构体原形
typedef struct {
/* Screen size */
int width;
int height;
/* Screen info */
int xres;
int yres;
/* Virtual Screen info */
int xres_virtual;
int yres_virtual;
int xoffset;
int yoffset;
/* OSD Screen size */
int osd_width;
int osd_height;
/* OSD Screen info */
int osd_xres;
int osd_yres;
/* OSD Screen info */
int osd_xres_virtual;
int osd_yres_virtual;
int bpp;
int bytes_per_pixel;
unsigned long pixclock;
int hsync_len;
int left_margin;
int right_margin;
int vsync_len;
int upper_margin;
int lower_margin;
int sync;
int cmap_grayscale:1;
int cmap_inverse:1;
int cmap_static:1;
int unused:29;
/* backlight info */
int backlight_min;
int backlight_max;
int backlight_default;
int vs_offset;
int brightness;
int palette_win;
int backlight_level;
int backlight_power;
int lcd_power;
s3cfb_vsync_info_t vsync_info;
s3cfb_vs_info_t vs_info;
/* lcd configuration registers */
unsigned long lcdcon1;
unsigned long lcdcon2;
unsigned long lcdcon3;
unsigned long lcdcon4;
unsigned long lcdcon5;
/* GPIOs */
unsigned long gpcup;
unsigned long gpcup_mask;
unsigned long gpccon;
unsigned long gpccon_mask;
unsigned long gpdup;
unsigned long gpdup_mask;
unsigned long gpdcon;
unsigned long gpdcon_mask;
/* lpc3600 control register */
.....
/* utility functions */
void (*set_backlight_power)(int);
void (*set_lcd_power)(int);
void (*set_brightness)(int);
int (*map_video_memory)(s3cfb_info_t *);
int (*unmap_video_memory)(s3cfb_info_t *);
}s3cfb_fimd_info_t;
s3cfb_fimd_info_t s3cfb_fimd = {
.vidcon0 = S3C_VIDCON0_INTERLACE_F_PROGRESSIVE | S3C_VIDCON0_VIDOUT_RGB_IF | S3C_VIDCON0_L1_DATA16_SUB_16_MODE | S3C_VIDCON0_L0_DATA16_MAIN_16_MODE | S3C_VIDCON0_PNRMODE_RGB_P | S3C_VIDCON0_CLKVALUP_ALWAYS | S3C_VIDCON0_CLKDIR_DIVIDED | S3C_VIDCON0_CLKSEL_F_HCLK | S3C_VIDCON0_ENVID_DISABLE | S3C_VIDCON0_ENVID_F_DISABLE,
.dithmode = (S3C_DITHMODE_RDITHPOS_5BIT | S3C_DITHMODE_GDITHPOS_6BIT | S3C_DITHMODE_BDITHPOS_5BIT ) & S3C_DITHMODE_DITHERING_DISABLE,
#if defined (CONFIG_FB_S3C_EXT_BPP_8)
......
#elif defined (CONFIG_FB_S3C_EXT_BPP_16)
.wincon0 = S3C_WINCONx_ENLOCAL_DMA | S3C_WINCONx_BUFSEL_1 | S3C_WINCONx_BUFAUTOEN_DISABLE | S3C_WINCONx_BITSWP_DISABLE | S3C_WINCONx_BYTSWP_DISABLE | S3C_WINCONx_HAWSWP_ENABLE | S3C_WINCONx_BURSTLEN_16WORD | S3C_WINCONx_BPPMODE_F_16BPP_565 | S3C_WINCONx_ENWIN_F_DISABLE,
.wincon1 = S3C_WINCONx_ENLOCAL_DMA | S3C_WINCONx_BUFSEL_0 | S3C_WINCONx_BUFAUTOEN_DISABLE | S3C_WINCONx_BITSWP_DISABLE | S3C_WINCONx_BYTSWP_DISABLE | S3C_WINCONx_HAWSWP_ENABLE | S3C_WINCONx_BURSTLEN_16WORD | S3C_WINCONx_BLD_PIX_PLANE | S3C_WINCONx_BPPMODE_F_16BPP_565 | S3C_WINCONx_ALPHA_SEL_1 | S3C_WINCONx_ENWIN_F_DISABLE,
.wincon2 = S3C_WINCONx_ENLOCAL_DMA | S3C_WINCONx_BITSWP_DISABLE | S3C_WINCONx_BYTSWP_DISABLE | S3C_WINCONx_HAWSWP_ENABLE | S3C_WINCONx_BURSTLEN_4WORD | S3C_WINCONx_BURSTLEN_16WORD | S3C_WINCONx_BLD_PIX_PLANE | S3C_WINCONx_BPPMODE_F_16BPP_565 | S3C_WINCONx_ALPHA_SEL_1 | S3C_WINCONx_ENWIN_F_DISABLE,
.wincon3 = S3C_WINCONx_BITSWP_DISABLE | S3C_WINCONx_BYTSWP_DISABLE | S3C_WINCONx_HAWSWP_ENABLE | S3C_WINCONx_BURSTLEN_4WORD | S3C_WINCONx_BURSTLEN_16WORD | S3C_WINCONx_BLD_PIX_PLANE | S3C_WINCONx_BPPMODE_F_16BPP_565 | S3C_WINCONx_ALPHA_SEL_1 | S3C_WINCONx_ENWIN_F_DISABLE,
.wincon4 = S3C_WINCONx_BITSWP_DISABLE | S3C_WINCONx_BYTSWP_DISABLE | S3C_WINCONx_HAWSWP_ENABLE | S3C_WINCONx_BURSTLEN_4WORD | S3C_WINCONx_BURSTLEN_16WORD | S3C_WINCONx_BLD_PIX_PLANE | S3C_WINCONx_BPPMODE_F_16BPP_565 | S3C_WINCONx_ALPHA_SEL_1 | S3C_WINCONx_ENWIN_F_DISABLE,
.bpp = S3CFB_PIXEL_BPP_16,
.bytes_per_pixel = 2,
.wpalcon = S3C_WPALCON_W0PAL_16BIT,
#elif defined (CONFIG_FB_S3C_EXT_BPP_24)
......
#endif
.vidosd1c = S3C_VIDOSDxC_ALPHA1_B(S3CFB_MAX_ALPHA_LEVEL) | S3C_VIDOSDxC_ALPHA1_G(S3CFB_MAX_ALPHA_LEVEL) | S3C_VIDOSDxC_ALPHA1_R(S3CFB_MAX_ALPHA_LEVEL),
.vidosd2c = S3C_VIDOSDxC_ALPHA1_B(S3CFB_MAX_ALPHA_LEVEL) | S3C_VIDOSDxC_ALPHA1_G(S3CFB_MAX_ALPHA_LEVEL) | S3C_VIDOSDxC_ALPHA1_R(S3CFB_MAX_ALPHA_LEVEL),
.vidosd3c = S3C_VIDOSDxC_ALPHA1_B(S3CFB_MAX_ALPHA_LEVEL) | S3C_VIDOSDxC_ALPHA1_G(S3CFB_MAX_ALPHA_LEVEL) | S3C_VIDOSDxC_ALPHA1_R(S3CFB_MAX_ALPHA_LEVEL),
.vidosd4c = S3C_VIDOSDxC_ALPHA1_B(S3CFB_MAX_ALPHA_LEVEL) | S3C_VIDOSDxC_ALPHA1_G(S3CFB_MAX_ALPHA_LEVEL) | S3C_VIDOSDxC_ALPHA1_R(S3CFB_MAX_ALPHA_LEVEL),
.vidintcon0 = S3C_VIDINTCON0_FRAMESEL0_VSYNC | S3C_VIDINTCON0_FRAMESEL1_NONE | S3C_VIDINTCON0_INTFRMEN_DISABLE | S3C_VIDINTCON0_FIFOSEL_WIN0 | S3C_VIDINTCON0_FIFOLEVEL_25 | S3C_VIDINTCON0_INTFIFOEN_DISABLE | S3C_VIDINTCON0_INTEN_ENABLE,
.vidintcon1 = 0,
.xoffset = 0,
.yoffset = 0,
.w1keycon0 = S3C_WxKEYCON0_KEYBLEN_DISABLE | S3C_WxKEYCON0_KEYEN_F_DISABLE | S3C_WxKEYCON0_DIRCON_MATCH_FG_IMAGE | S3C_WxKEYCON0_COMPKEY(0x0),
.w1keycon1 = S3C_WxKEYCON1_COLVAL(0xffffff),
.w2keycon0 = S3C_WxKEYCON0_KEYBLEN_DISABLE | S3C_WxKEYCON0_KEYEN_F_DISABLE | S3C_WxKEYCON0_DIRCON_MATCH_FG_IMAGE | S3C_WxKEYCON0_COMPKEY(0x0),
.w2keycon1 = S3C_WxKEYCON1_COLVAL(0xffffff),
.w3keycon0 = S3C_WxKEYCON0_KEYBLEN_DISABLE | S3C_WxKEYCON0_KEYEN_F_DISABLE | S3C_WxKEYCON0_DIRCON_MATCH_FG_IMAGE | S3C_WxKEYCON0_COMPKEY(0x0),
.w3keycon1 = S3C_WxKEYCON1_COLVAL(0xffffff),
.w4keycon0 = S3C_WxKEYCON0_KEYBLEN_DISABLE | S3C_WxKEYCON0_KEYEN_F_DISABLE | S3C_WxKEYCON0_DIRCON_MATCH_FG_IMAGE | S3C_WxKEYCON0_COMPKEY(0x0),
.w4keycon1 = S3C_WxKEYCON1_COLVAL(0xffffff),
.sync = 0,
.cmap_static = 1,
.vs_offset = S3CFB_DEFAULT_DISPLAY_OFFSET,
.brightness = S3CFB_DEFAULT_BRIGHTNESS,
.backlight_level = S3CFB_DEFAULT_BACKLIGHT_LEVEL,
.backlight_power = 1,
.lcd_power = 1,
};
对比函数static void s3cfb_init_fbinfo(s3cfb_info_t *finfo, char *drv_name, int index),对缺少的成员赋值s3cfb_fimd.width做全内核搜索。
drivers/video/samsung/s3cfb_lts222qv.c s3cfb_fimd.width=240
drivers/video/samsung/s3cfb_ltv350qv.c s3cfb_fimd.width=320
drivers/video/samsung/s3c_mini6410.c #if defined(CONFIG_FB_S3C_EXT_TFT480272) ....
推断前3个文件是linux自带的,第4个文件是友善之臂自己写的文件,查看video/samsung/Makefile
obj-$(CONFIG_FB_S3C_EXT_TFT480272) += s3c_mini6410.o
。。。。。。
果然如此,前3个文件都没编译进内核,只有第4个文件。
那么fbinfo的其他成员都在s3c_mini6410.c获取。
至此,就剩下硬件寄存器的配置分析了。