本文出自:http://www.cnblogs.com/lexuele/p/4688581.html
主要代码:
LINUX\android\kernel\arch\arm\boot\dts\qcom\dsi-panel-trust-hx8379c-fwvga-video.dtsi
LINUX\android\kernel\arch\arm\boot\dts\qcom\msm8916-qrd-skum.dtsi
LINUX/android/bootable/bootloader/lk/dev/pmic/pm8x41/pm8x41_adc.c
LINUX/android/bootable/bootloader/lk/dev/pmic/pm8x41/include/pm8x41_adc.h
LINUX/android/bootable/bootloader/lk/target/msm8916/include/target/display.h
LINUX/android/bootable/bootloader/lk/target/msm8916/init.c
LINUX\android\bootable\bootloader\lk\dev\gcdb\display\include\panel_trust_hx8379c_fwvga_video.h
\\192.168.142.144\chenhaibing\MSM8916_R113502NEW\LINUX\android\bootable\bootloader\lk\target\msm8916\oem_panel.c
1.Lk :
Adc 兼容
android/bootable/bootloader/lk/dev/pmic/pm8x41/include/pm8x41_adc.h
#defineMPP_2_CHAN_ID 33//chenhaibing 20140925 定义相应的adc通道
voidpm8x41_enable_mpp_as_adc_for_mpp2(uint16_tmpp_num);//chenhaibing 20140925 add for lcm adc
android/bootable/bootloader/lk/dev/pmic/pm8x41/pm8x41_adc.c
Static struct adc_conf adc_data[]={ CHAN_INIT(VADC_USR1_BASE,VADC_BAT_CHAN_ID,VADC_MODE_NORMAL,VADC_DECIM_RATIO_VAL,HW_SET_DELAY_100US,FAST_AVG_SAMP_1,CALIB_RATIO),CHAN_INIT(VADC_USR1_BASE,VADC_BAT_VOL_CHAN_ID,VADC_MODE_NORMAL,VADC_DECIM_RATIO_VAL,HW_SET_DELAY_100US,FAST_AVG_SAMP_1,CALIB_ABS),CHAN_INIT(VADC_USR1_BASE, MPP_2_CHAN_ID,VADC_MODE_NORMAL,VADC_DECIM_RATIO_VAL,HW_SET_DELA
Y_100US,FAST_AVG_SAMP_1,CALIB_ABS),
添加到adc_data初始化数组
读adc数据前,需要使能此接口
/*begin:add by chenhaibing for pm8x41 mpp2 adc enable 20140925*/
voidpm8x41_enable_mpp_as_adc_for_mpp2(uint16_tmpp_num)
{ uint32_tval;
if(mpp_num >MPP_MAX_NUM)
{dprintf(CRITICAL,"Error: The MPP pin number is unavailable\n");
return;}
/* set the MPP mode as AIN */
val =(MPP_MODE_AIN <
/* Enable the MPP */
val =(MPP_MASTER_ENABLE <
/* AIN route to AMUX8 */
val =(0x1<
}
android/bootable/bootloader/lk/target/msm8916/oem_panel.c
#include"include/panel_trust_hx8379c_fwvga_video.h"//chenhaibing add 0923
主要接口:
oem_panel_select: 主要是根据adc判断lcd兼容
pm8x41_enable_mpp_as_adc_for_mpp2(0x01);
lcm_type =get_vendor_from_adc(MPP_2_CHAN_ID);
if(LCM_TYPE_HS==lcm_type)
{
panel_id =ILI9806E_FWVGA_VIDEO_PANEL;//chenhaibing add
}
elseif(LCM_TYPE_TS==lcm_type)
{
panel_id =HX8379C_FWVGA_VIDEO_PANEL;
}
Else
{
panel_id =UNKNOWN_PANEL;
ret =false;
Return ret;
}
oem_panel_on负责把.h相关宏和指令,时序设置等,根据oem_panel_select:指定的panel_id给屏驱动所使用的结构体。
kernel篇.
Panel id 会通过command line的方式传递到kernel层, kernel video mdss驱动会通过调用dtsi相关节点信息进行访问,使得lcm被正常驱动。
dtsi相关节点信息:
时序设置:
qcom,mdss-dsi-panel-timings = [4D 1A 12 00 40 42 16 1E 14 03 04 00];
80-NH713-1_DSI_TIMING_PARAMETERS_USER_INTERACTIVE_SPREADSHEET.xlsm
DSI and MDP registers sheet 页写入下面信息:
frame rate ,lane config,pixel format BPP,Active Width,Active Height
Hsync Pulse Width,Hori. Back Porch,Hori. Front Porch,Vsync Pulse Width,Vert. Back Porch,Vert. Front Porch
拷贝下面的值填入上面数组。
2. DSI PHY registers
PHY Registers value in hex
DSIPHY_TIMING_CTRL_0 #VALUE!
DSIPHY_TIMING_CTRL_1 1A
DSIPHY_TIMING_CTRL_2 12
DSIPHY_TIMING_CTRL_3 0
DSIPHY_TIMING_CTRL_4 40
DSIPHY_TIMING_CTRL_5 42
DSIPHY_TIMING_CTRL_6 16
DSIPHY_TIMING_CTRL_7 1E
DSIPHY_TIMING_CTRL_8 14
DSIPHY_TIMING_CTRL_9 3
DSIPHY_TIMING_CTRL_10 4
ESD:
qcom,mdss-dsi-panel-status-command = [06 01 00 01 05 00 02 09 08];
qcom,mdss-dsi-panel-status-command-state = "dsi_lp_mode";
qcom,mdss-dsi-panel-status-check-mode = "reg_read";
qcom,mdss-dsi-panel-status-value = <0x90>;
qcom,esd-check-enabled;
比如:
若需要返回多个参数,需要改写代码:
Mdss_dsi_host.c
static int mdss_dsi_read_status(struct mdss_dsi_ctrl_pdata *ctrl)
{
struct dcs_cmd_req cmdreq;
memset(&cmdreq, 0, sizeof(cmdreq));
cmdreq.cmds = ctrl->status_cmds.cmds;
cmdreq.cmds_cnt = ctrl->status_cmds.cmd_cnt;
cmdreq.flags = CMD_REQ_COMMIT | CMD_CLK_CTRL | CMD_REQ_RX;
cmdreq.rlen =0;
cmdreq.cb = NULL;
cmdreq.rbuf = ctrl->status_buf.data;
return mdss_dsi_cmdlist_put(ctrl, &cmdreq);
}
/*begin: add by chenhaibing for hx8379c read status 20141021*/
static int mdss_dsi_read_status_for_trust(struct mdss_dsi_ctrl_pdata *ctrl)
{
struct dcs_cmd_req cmdreq;
memset(&cmdreq, 0, sizeof(cmdreq));
cmdreq.cmds = ctrl->status_cmds.cmds;
cmdreq.cmds_cnt = ctrl->status_cmds.cmd_cnt;
cmdreq.flags = CMD_REQ_COMMIT | CMD_CLK_CTRL | CMD_REQ_RX;
cmdreq.rlen = 4; //modified 4 这个会发送37指令,指定返回4个参数.
cmdreq.cb = NULL;
cmdreq.rbuf = ctrl->status_buf.data;
return mdss_dsi_cmdlist_put(ctrl, &cmdreq);
}
/*end: add by chenhaibing for hx8379c read status 20141021*/
mdss_dsi_reg_status_check添加相关军客制化判断逻辑.
在msm8916调试 Himax 8379C 时遇到功耗问题:
原因分析:
量测试开机或唤醒的波形图,是因为此IC不能自己进入ulps模式,msm8916默认的source code 也没有开启ulps.导致上面实测试波满足与IC spec不符。
引起屏漏电.
解决方案在dtsi配置下面节点.
qcom,mdss-dsi-lp11-init; //确保reset 信号拉低时,clock和data都要及时被拉高,某些IC时序有此要求.
qcom,suspend-ulps-enabled;
上面节点打开后,还需要高通释放相关patch合入才能最终解决此问题。
客制化启动logo方法
How to customize splash image
ntroduction and Background:
For LK display (boot loader) logo, there are two methods:
a) Read the splash image data from splash.h file.
b) Get the splash image data from Splash Partition.
Solution Statement:
For a), please see the below source codes:
bootable/bootloader/lk/platform/msm_shared/include/splash.h
bootable/bootloader/lk/dev/fbcon/fbcon.c
When fbimg is NULL, LK display data gets from imageBuffer_rgb888 arrays. Please see the below snippet codes.
void display_image_on_screen()
{
struct fbimage default_fbimg, *fbimg;
bool flag = true;
fbcon_clear();
fbimg = fetch_image_from_partition(); // Splash image from partition
if(!fbimg) {
flag = false;
fbimg = &default_fbimg;
fbimg->header.width = SPLASH_IMAGE_HEIGHT;
fbimg->header.height = SPLASH_IMAGE_WIDTH;
#if DISPLAY_TYPE_MIPI
fbimg->image = (unsigned char *)imageBuffer_rgb888;
#else
fbimg->image = (unsigned char *)imageBuffer;
#endif
}
fbcon_putImage(fbimg, flag);
}
For b), the steps to generate the splash.img:
1). Install the python on Linux desktop OS.
sudo apt-get install python-imaging
2). Prepare the logo picture with the PNG format in "device/qcom/common/display/logo" folder, such as "test.png".
python ./logo_gen.py test.png
3). Add splash partition on your partition.xml, such as
4). Check if have "splash.img", and then flash splash image to your device.
fastboot flash splash splash.img
第二种:python ./logo_gen.py test.png (MSM8916平台没有看到logo_gen.py) ,flash.img4).
Check if have "splash.img", and then flash splash image to your device.