Linux驱动之mipi接口的LCD设备添加过程
记录供以后参考用
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】嵌入式Linux驱动开发基础知识之总线设备驱动模型
文章目录 前言 1.驱动编写的三种方法 1.1.传统写法 1.2.总线驱动模型 1.3.设备树驱动模型 2.Linux实现分离:Bus/Dev/Drv模型 2.1.Bus/Dev/Drv模型 2.2. ...
- linux 驱动基础知识(2)---设备树
转载自 http://huaqianlee.me/2015/08/19/Android/高通平台Android源码分析之Linux内核设备树-DT-Device-Tree-dts文件/ 刚开始接触An ...
- Linux驱动学习--USB接口wifi/BT芯片开发之BT开发(BlueDroid框架)
目录 一.引言 二.整体框架分析(结合实际芯片分析) 三.内核中的相关配置 四.厂家驱动分析 五.蓝牙BlueDroid协议 一.引言 之前我们简单分析过BlueDroid框架,今天来结合源码,挑重点 ...
- Linux驱动开发中的中间件:设备树
Linux设备树 设备树的产生是为了解决内核源码的arch/arm目录下代码混乱和臃肿的问题(过去每个厂商出个板子就要提供外设硬件和平台硬件信息,这些信息以.c和.h文件的形式呈现).在使用设备树之后 ...
- Linux 驱动开发 四十三:platform 设备驱动实验(一)
一.platform 基本概念整理 Linux 系统要考虑到驱动的可重用性,因此提出了驱动的分离与分层这样的软件思路.因此提出驱动.总线和设备的驱动架构,总线负责管理驱动和设备.系统中有很多的物理总线 ...
- linux complete函数,Linux驱动中completion接口浅析(wait_for_complete例子,很好)
completion是一种轻量级的机制,它容许一个线程告诉另外一个线程工做已经完成.能够利用下面的宏静态建立completion: DECLARE_C ...
- linux 背光驱动程序,Linux驱动工程师成长之路 LCD背光控制RT9379B
老大说了,下周新的手机要回来了,用的是400*800的屏,到时候就由我来调这个屏了.把屏的spec和背光的spec都给了我让我先看看. 以前分析了LCD(framebuffer)的驱动框架,但是对于背 ...
- linux驱动的中断函数,嵌入式Linux驱动开发(四)——字符设备驱动之中断方式以及中断方式获取按键值...
之前我们完成了关于通过查询的方式获取按键键值的驱动程序,可以参考:嵌入式Linux开发--裸板程序之中断控制器. 虽然读取键值没有什么问题,但是测试程序占用CPU过高,一直在不断的查询,资源消耗过大, ...
- Linux源码阅读——PCI总线驱动代码(三)PCI设备枚举过程
目录 前言 1.枚举过程 1.1 acpi_pci_root_add 1.2 pci_acpi_scan_root(枚举开始) 1.3 acpi_pci_root_create 1.4 pci_sca ...
最新文章
- 光伏产业链遭致命伤:补贴下调或结束暴利
- [转自脚本之家] Javascript cookie 详解
- centos 6.5 关闭防火墙
- Python--yield关键字的使用
- MT6580热设计要求
- 从拉格朗日乘子法到SVM
- Java的文件流操作
- 记录平时发现的一些小知识点
- 《重构》-重新组织函数
- 2021-2025年中国宠物美容台行业市场供需与战略研究报告
- VS2010测试方面的文章
- 欢迎加入我们的架构师社群
- 程序员锁死服务器导致公司倒闭,案件终于开庭了
- 判断文件中字符是否存在_使用Python库判断字符是否在字体里
- 10gR2--用asmcmd对ASM进行管理
- c语言函数fac,将一个求阶乘的函数fac专门写在一个文件file1.cpp中,定义为外部函数。然后在另一文件file2.cpp中...
- 口碑、银盒子相关功能是否支持问题
- 烤仔TVのCCW丨密码学通识(一)密码学基础及常见误区
- FLStudio21中文版本全部新功能讲解
- Python公历转换农历及简易万年历