加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Linux驱动之mipi接口的LCD设备添加过程

(2013-09-26 16:12:30)
标签:

it

http://blog.csdn.net/hengkong_horse/article/details/9151859

记录供以后参考用

void __init msm_fb_add_devices(void)

{

       int rc 0;

        msm7x27a_set_display_params(prim_panel_name);

        if (machine_is_msm8225_xxx()){

           if (cpu_is_msm8625q())

                        mipi_dsi_pdata.dlane_swap 0;

       platform_add_devices(xxx_fb_devices,

       ARRAY_SIZE(xxx_fb_devices));

}

****************************************

****************************************

msm_fb_register_device("mdp", &mdp_pdata);

***************************************

***************************************

#ifdef CONFIG_FB_MSM_MIPI_DSI

msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);

#endif

***************************************

***************************************

}

 

 

(一)platform_add_devices(xxx_fb_devices,ARRAY_SIZE(xxx_fb_devices));

  ----->

     static struct platform_device *xxx_fb_devices[] __initdata {

              &msm_fb_device,

     };

 

------>

   

   static struct platform_device msm_fb_device {

.name   "msm_fb",

.id     0,

.num_resources  ARRAY_SIZE(msm_fb_resources),

.resource       msm_fb_resources,

.dev    {

.platform_data &msm_fb_pdata,

}

};

 

    ----->

      static struct msm_fb_platform_data msm_fb_pdata {

      .detect_client msm_fb_detect_panel,

      };

 

       ----->

         static int msm_fb_detect_panel(const char *name)

{

int ret -ENODEV;

printk("%s: %s\n", __func__, name);

if (machine_is_msm8225_xxx()) {

ret xxx_auto_match_lcd_panel(name);

else if  {

    **************************************

    **************************************

    }

return ret;

}

 

 

 

----->

static int xxx_auto_match_lcd_panel(const char *name)

{

int ret -ENODEV;

#if defined(CONFIG_xxx)

     ******************************

     ******************************

#elif defined(CONFIG_xxxxxx)

if(lcd_id1 == ){

if (!strcmp(name, "mipi_video_xxxx_qhd"))

                // id1=1, id2=0,id3=1

ret 0;

}else{

if (!strcmp(name, "mipi_video_xxxxxxx_qhd"))

                // id1=0, id2=0,id3=1

ret 0;

}

#endif

return ret;

}

 

 

(二)msm_fb_register_device("mdp", &mdp_pdata);

----->

   static struct msm_panel_common_pdata mdp_pdata {

.gpio 97,

.mdp_rev MDP_REV_303,

.cont_splash_enabled 0x1,

};

 

 

void __init msm_fb_register_device(char *name, void *data)

{

if (!strncmp(name, "mdp", 3)) {

if (cpu_is_msm8625() || cpu_is_msm8625q())

      msm_register_device(&msm8625_mdp_devicedata);

else

     msm_register_device(&msm_mdp_device, data);

else if (!strncmp(name, "mipi_dsi", 8)) {

       if (cpu_is_msm8625() || cpu_is_msm8625q()) {

       msm_register_device(&msm8625_mipi_dsi_devicedata);

       mipi_dsi_device msm8625_mipi_dsi_device;

        }

    else *****************

     

}

      

--------->

  static struct resource msm8625_mdp_resources[] {

{

.name   "mdp",

.start  MDP_BASE,

.end    MDP_BASE 0x000F1008 1,

.flags  IORESOURCE_MEM,

},

{

.start  MSM8625_INT_MDP,

.end    MSM8625_INT_MDP,

.flags  IORESOURCE_IRQ,

},

};

 

static struct platform_device msm8625_mdp_device {

.name   "mdp",

.id     0,

.num_resources  ARRAY_SIZE(msm8625_mdp_resources),

.resource       msm8625_mdp_resources,

};

static void __init msm_register_device(struct platform_device *pdev, void *data)

{

int ret;

pdev->dev.platform_data data;

ret platform_device_register(pdev);

if (ret)

dev_err(&pdev->dev,

"%s: platform_device_register() failed %d\n",

__func__, ret);

}

 

 

()msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);

------->

  static struct mipi_dsi_platform_data mipi_dsi_pdata {

.vsync_gpio = MDP_303_VSYNC_GPIO,

.dsi_power_save= mipi_dsi_panel_power,

                        

.dsi_client_reset       msm_fb_dsi_client_reset,

                  

.get_lane_config= msm_fb_get_lane_config,

.splash_is_enabled= mipi_dsi_splash_is_enabled,

.dlane_swap = 0x1,

};


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有