欢迎来到天天文库
浏览记录
ID:12086308
大小:27.50 KB
页数:3页
时间:2018-07-15
《s3c6410_lcd&framebuffer驱动分析(二)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、ints3cfb_init_registers(s3cfb_info_t*fbi){ structclk*lcd_clock;//LCD时钟来源 structfb_var_screeninfo*var=&fbi->fb.var;//可变参数 unsignedlongflags=0,page_width=0,offset=0; unsignedlongvideo_phy_temp_f1=fbi->screen_dma_f1;/**缓存物理地址*/ unsignedlongvideo_phy_temp_f2=fbi->screen_dma_f2; in
2、twin_num= fbi->win_id; /*InitialiseLCDwithvaluesfromhare*/ local_irq_save(flags); page_width=var->xres*s3cfb_fimd.bytes_per_pixel; offset=(var->xres_virtual-var->xres)*s3cfb_fimd.bytes_per_pixel;/**偏移量,应该就是左边界距离吧 if(win_num==0){ s3cfb_fimd.vidcon0=s3cfb_fimd.vidcon0&~(S3C_V
3、IDCON0_ENVID_ENABLE
4、S3C_VIDCON0_ENVID_F_ENABLE); writel(s3cfb_fimd.vidcon0,S3C_VIDCON0);//视频输出及显示控制信号使能 lcd_clock=clk_get(NULL,"lcd");//获取视频时钟源 s3cfb_fimd.vidcon0
5、=S3C_VIDCON0_CLKVAL_F((int)((clk_get_rate(lcd_clock)/s3cfb_fimd.pixclock)-1));#ifdefined(CONFIG_FB_S3C_EXT_VIRT
6、UAL_SCREEN) offset=0; s3cfb_fimd.vidw00add0b0=video_phy_temp_f1; s3cfb_fimd.vidw00add0b1=video_phy_temp_f2; s3cfb_fimd.vidw00add1b0=S3C_VIDWxxADD1_VBASEL_F((unsignedlong)video_phy_temp_f1+(page_width+offset)*(var->yres)); s3cfb_fimd.vidw00add1b1=S3C_VIDWxxADD1_VBA
7、SEL_F((unsignedlong)video_phy_temp_f2+(page_width+offset)*(var->yres));#endif } writel(video_phy_temp_f1,S3C_VIDW00ADD0B0+(0x08*win_num)); writel(S3C_VIDWxxADD1_VBASEL_F((unsignedlong)video_phy_temp_f1+(page_width+offset)*(var->yres)),S3C_VIDW00ADD1B0+(0x08*win_num)); writel(S3C_
8、VIDWxxADD2_OFFSIZE_F(offset)
9、(S3C_VIDWxxADD2_PAGEWIDTH_F(page_width)),S3C_VIDW00ADD2+(0x04*win_num)); if(win_num<2){ writel(video_phy_temp_f2,S3C_VIDW00ADD0B1+(0x08*win_num)); writel(S3C_VIDWxxADD1_VBASEL_F((unsignedlong)video_phy_temp_f2+(page_width+offset)*(var->yres)),S3C_V
10、IDW00ADD1B1+(0x08*win_num)); }/*********下面就是往各种寄存器里面写东西,初始化各个窗口所对应的寄存器等**/ switch(win_num){ case0: writel(s3cfb_fimd.wincon0,S3C_WINCON0); writel(s3cfb_fimd.vidcon0,S3C_VIDCON0); writel(s3cfb_fimd.vidcon1,S3C_VIDCON1); writel(s3cfb_fimd.vid
此文档下载收益归作者所有