编写安卓下的LCD驱动参考了一些网上的资料。
在 /kernel/drivers/video/msm
static int msm_fb_probe(struct platform_device *pdev)
{
..........
}
static int msm_fb_remove(struct platform_device *pdev)
{
............
}
static struct fb_ops msm_fb_ops = {
.owner = THIS_MODULE,
.fb_open = msm_fb_open,
.fb_release = msm_fb_release,
.fb_read = NULL,
.fb_write = NULL,
.fb_cursor = NULL,
.fb_check_var = msm_fb_check_var, /* vinfo check */
.fb_set_par = msm_fb_set_par, /* set the video mode according to info->var */
.fb_setcolreg = NULL, /* set color register */
.fb_blank = msm_fb_blank, /* blank display */
.fb_pan_display = msm_fb_pan_display, /* pan display */
.fb_fillrect = msm_fb_fillrect, /* Draws a rectangle */
.fb_copyarea = msm_fb_copyarea, /* Copy data from area to another */
.fb_imageblit = msm_fb_imageblit, /* Draws a image to the display */
.fb_rotate = NULL,
.fb_sync = NULL, /* wait for blit idle, optional */
.fb_ioctl = msm_fb_ioctl, /* perform fb specific ioctl (optional) */
.fb_mmap = msm_fb_mmap,
};
..................
static struct platform_driver msm_fb_driver = {
.probe = msm_fb_probe,
.remove = msm_fb_remove,
#ifndef CONFIG_HAS_EARLYSUSPEND
.suspend = msm_fb_suspend,
.resume = msm_fb_resume,
#endif
.shutdown = NULL,
.driver = {
/* Driver name must match the device name added in platform.c. */
.name = "msm_fb",
.pm = &msm_fb_dev_pm_ops,
},
};
static int msm_fb_ioctl(struct fb_info *info, unsigned int cmd,
unsigned long arg)
{..............}
struct platform_device *msm_fb_add_device(struct platform_device *pdev)
{.....
}
int __init msm_fb_init(void)
{
int rc = -ENODEV;
if (msm_fb_register_driver())
return rc;
#ifdef MSM_FB_ENABLE_DBGFS
{
struct dentry *root;
if ((root = msm_fb_get_debugfs_root()) != NULL) {
msm_fb_debugfs_file_create(root,
"msm_fb_msg_printing_level",
(u32 *) &msm_fb_msg_level);
msm_fb_debugfs_file_create(root,
"mddi_msg_printing_level",
(u32 *) &mddi_msg_level);
msm_fb_debugfs_file_create(root, "msm_fb_debug_enabled",
(u32 *) &msm_fb_debug_enabled);
}
}
#endif
return 0;
}
2014年1月23日
拿到8x12的板子,用QPST下载好,进入shell模式:
上面是adb remount ,提示没有权限时的操作。
之后在linux虚拟机上执行以下操作:
#source build/envsetup.sh
#lunch
选择要编译的项目
#make bootimage j4 **************发现增加线程编译这个选项不可用啊
编译开始
2014年1月24日
2014年2月11日1.建立好branch分支,开始编译,编译通过,生成boot.img
生成的boot.img下载到板子上,屏好像没有点亮起来
linux主机登陆共享文件:
添加的屏编译没有通过,通过后来的分析,命令值设置的过大,而且格式有问题:
将修改的驱动文件包含进去:
在下载boot.img 的时候,导致板子死机,然后不得不用QPST重新下载系统文件,下载之前需要将COM口禁掉,才能下载成功:
下面这种现象是下载过bootimage,fastboot reboot 之后机子居然找不到端口,提示进入emmc下载,没办法之后重新下载一遍,具体的原因还不清楚: