Chinaunix首页 | 论坛 | 博客

apt

  • 博客访问: 387871
  • 博文数量: 121
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 600
  • 用 户 组: 普通用户
  • 注册时间: 2015-04-10 15:52
文章分类

全部博文(121)

文章存档

2017年(2)

2016年(23)

2015年(96)

我的朋友

分类: LINUX

2015-09-17 17:21:45

【问题】 背光驱动初始化先于LCD驱动初始化,导致LCD驱动初始化时出现闪屏的现象。  
【解决过程】 1 mach-xxx.c中platform devices列表如下 
 /* platform devices */  
static struct platform_device *athena_evt_platform_devices[] __initdata = {
     //&xxx_led_device,      
        &xxx_rtc_device,      &xxx_uart0_device,      &xxx_uart1_device,      &xxx_uart2_device,      &xxx_uart3_device,       &xxx_nand_device,      &xxx_i2c_device,      
    &xxx_lcd_device,      
    &xxxpwm_backlight_device,     
     ... };  LCD(xxx_lcd_device)设备先于PWM(xxxpwm_backlight_device)设备。  可见驱动的初始化顺序并不是和这个表定义的顺序始终保持一致的。
(记得PM操作 - resume/suspend的顺序 是和这个表的顺序保持一致的) 2 怀疑和编译顺序有关      Z:\kernel\drivers\video\Makefile:    
    背光驱动(backlight/)的编译限于LCD驱动(xxxfb.o)的编译     obj-$(CONFIG_VT)		  += console/      obj-$(CONFIG_LOGO)		  += logo/     obj-y	                  += backlight/ display/ ...      obj-$(CONFIG_FB_xxx)	  += xxxfb.o ak_logo.o      obj-$(CONFIG_FB_AK88)	  += ak88-fb/      这样编译生成的System.map中的顺序为:      906 c001f540 t __initcall_pwm_backlight_init6     907 c001f544 t __initcall_display_class_init6     908 c001f548 t __initcall_xxxfb_init6     Makefile更改为:     obj-$(CONFIG_VT)		  += console/      obj-$(CONFIG_LOGO)		  += logo/      obj-y			  += display/ ...      obj-$(CONFIG_FB_xxx)	  += xxxfb.o ak_logo.o  obj-$(CONFIG_FB_AK88)	  += ak88-fb/      obj-y                	  += backlight/  这样编译生成的System.map中的顺序为:  905 c001f53c t __initcall_display_class_init6  906 c001f540 t __initcall_xxxfb_init6  907 c001f544 t __initcall_genericbl_init6 908 c001f548 t __initcall_pwm_backlight_init6  加载运行: xxxpwm_backlight_device的probe就会在xxx_lcd_device的probe之后执行,即LCD初始化先于PWM的初始化。  【结论】 同一级别的初始化是和编译顺序有关的,并不是和设备列表一致。 调整驱动加载顺序还可以通过使用不同级别的初始化,
例如: subsys_initcall()  module_init()  late_initcall() ...
阅读(1262) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~