Linux驱动之mipi接口的LCD设备添加过程
来源:互联网 发布:php模块开发教程 编辑:程序博客网 时间:2024/05/22 01:32
记录供以后参考用
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,
};
------>
/*该设备在sysfs中显示为msm_fb.0*/
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 == 1 ){
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_device, data);
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_device, data);
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,
},
};
/*platform device : mdp.0 in sysfs*/
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,
/*configure the lcd_reset pin*/
.dsi_client_reset = msm_fb_dsi_client_reset,
/*getting lcd id and enabling backlight*/
.get_lane_config= msm_fb_get_lane_config,
.splash_is_enabled= mipi_dsi_splash_is_enabled,
.dlane_swap = 0x1,
};
至于msm_fb_register_device()参照(二)的实现
- Linux驱动之mipi接口的LCD设备添加过程
- Linux设备驱动之s3c2440添加LCD驱动
- Linux字符设备驱动之LCD驱动
- 65 linux spi设备驱动之spi LCD屏驱动
- 68 linux framebuffer设备驱动之spi lcd屏驱动
- LCD驱动的添加
- linux s3c2440 LCD 设备驱动
- LINUX之LCD驱动
- linux驱动之LCD
- linux驱动之--lcd
- uclinux添加设备驱动的完整过程
- LCD设备驱动的体系结构
- Linux的LCD驱动
- Linux的LCD驱动
- Linux的LCD驱动
- Linux之设备驱动学习简过程<三>(不断添加中)
- linux-2.6.35内核移植—LCD驱动的添加
- linux lcd设备驱动剖析一
- Struts2多文件上传
- Python lambda 浅析
- 03-同一页面中的多表单提交(jsp基本应用)
- C语言运算中类型转换
- Boost库编译指南
- Linux驱动之mipi接口的LCD设备添加过程
- 杭电1713
- C语言中的字符串截取函数及应用
- 04-在jsp脚本中插入javaScript代码(jsp基础应用)
- gets() fgets()
- QML性能优化
- fedora安装gcc编译器
- C++Primer笔记 第七章 函数
- 深入探讨:LBS是一种工具而非一种模式