RockChip 平台LCD初始化代码转化工具 — python版


工作中为了调试客户给的lcd,通常需要写入初始化参数,但客户提供的初始化代码,通常是各种测试夹具的单片机代码,和rockchip平台的lcd初始化代码的格式差异非常大,若是手动修改,几百行的代码,修改的起来非常的枯燥,而且比较容易出错,于是,我抽空写了一个简单的工具,做自动转化,这里做个记录:

首先是我们需要的初始化代码,范例如下:

/*
 * Copyright (C) 2017 xxxx, Inc.
 * Licensed under GPLv2 or later.
 * fileName     : 9365.dtsi
 * author       : whonee
 * create date  : Wed Jan  3 10:41:52 2018
 * lcd model    : 请手动填入Model型号
 * resolution   : 请手动填入分辨率
 * mipi channel : 请手动填入mipi通道数
 */

/ {

    /* mipi 相关配置 
     * compatible            -- 用户内核代码寻找对应dts配置的匹配字符串
     * rockchip,screen_init  -- 配置是否需要初始化代码,为1时,disp_mipi_init_cmds 才有效果
     * rockchip,dsi_lane     -- 配置MIPI的通道数
     * rockchip,dsi_hs_clk   -- MIPI时钟
     * rockchip,mipi_dsi_num -- 配置MIPI的组数
     */

    disp_mipi_init: mipi_dsi_init{
                compatible = "rockchip,mipi_dsi_init";
                rockchip,screen_init    = <1>;
                rockchip,dsi_lane       = <4>;
                rockchip,dsi_hs_clk     = <500>;
                rockchip,mipi_dsi_num   = <1>;
    };

    /* mipi lcd 的电源配置( 说明:默认不需要开启脚位控制 )
     * compatible            -- 用户内核代码寻找对应dts配置的匹配字符串
     * mipi_lcd_rst          -- 配置复位脚
     * mipi_lcd_en           -- 配置电源脚
     */

    disp_mipi_power_ctr: mipi_power_ctr {
        compatible = "rockchip,mipi_power_ctr";
        /*
        mipi_lcd_rst:mipi_lcd_rst{
                compatible = "rockchip,lcd_rst";
                rockchip,gpios = <&gpio2 GPIO_C2 GPIO_ACTIVE_HIGH>;
                rockchip,delay = <20>;
        };               
        mipi_lcd_en:mipi_lcd_en {
                compatible = "rockchip,lcd_en";
                rockchip,gpios = <&gpio0 GPIO_C1 GPIO_ACTIVE_HIGH>;
                rockchip,delay = <100>;
        };
        */

    };
    
    /* mipi lcd 初始化代码
     * compatible            -- 用户内核代码寻找对应dts配置的匹配字符串
     * rockchip,cmd_debug    -- 配置是否启用debug模式
     * str_init_cmds         -- 配置具体初始化值
     */
     
    disp_mipi_init_cmds: screen-on-cmds {        
        compatible = "rockchip,screen-on-cmds";
        rockchip,cmd_debug = <0>;

        rockchip,on-cmds2{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE0 0x00>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds3{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE1 0x93>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds4{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE2 0x65>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds5{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE3 0xF8>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds6{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x39 0xE3 0xF8 0x11 0x99>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds7{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE0 0x04>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds8{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2D 0x03>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds9{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE0 0x00>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds10{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x80 0x03>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds11{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x70 0x02>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds12{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x71 0x23>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds13{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x72 0x06>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds14{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE0 0x01>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds15{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x00 0x00>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds16{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x01 0x66>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds17{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x03 0x00>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds18{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x04 0x6D>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds19{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x17 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds20{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x18 0xBF>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds21{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x19 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds22{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1A 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds23{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1B 0xBF>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds24{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1C 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds25{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1F 0x3E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds26{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x20 0x28>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds27{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x21 0x28>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds28{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x22 0x0E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds29{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x37 0x09>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds30{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x38 0x04>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds31{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x39 0x08>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds32{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3A 0x12>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds33{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3C 0x78>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds34{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3D 0xFF>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds35{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3E 0xFF>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds36{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3F 0x7F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds37{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x40 0x06>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds38{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x41 0xA0>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds39{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x55 0x01>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds40{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x56 0x01>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds41{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x57 0x69>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds42{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x58 0x0A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds43{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x59 0x0A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds44{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5A 0x29>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds45{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5B 0x15>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds46{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5D 0x7C>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds47{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5E 0x65>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds48{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5F 0x55>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds49{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x60 0x49>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds50{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x61 0x44>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds51{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x62 0x35>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds52{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x63 0x3A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds53{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x64 0x23>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds54{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x65 0x3D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds55{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x66 0x3C>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds56{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x67 0x3D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds57{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x68 0x5D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds58{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x69 0x4D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds59{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6A 0x56>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds60{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6B 0x48>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds61{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6C 0x45>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds62{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6D 0x38>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds63{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6E 0x25>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds64{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6F 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds65{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x70 0x7C>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds66{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x71 0x65>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds67{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x72 0x55>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds68{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x73 0x49>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds69{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x74 0x44>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds70{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x75 0x35>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds71{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x76 0x3A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds72{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x77 0x23>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds73{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x78 0x3D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds74{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x79 0x3C>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds75{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7A 0x3D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds76{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7B 0x5D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds77{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7C 0x4D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds78{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7D 0x56>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds79{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7E 0x48>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds80{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7F 0x45>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds81{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x80 0x38>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds82{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x81 0x25>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds83{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x82 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds84{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE0 0x02>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds85{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x00 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds86{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x01 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds87{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x02 0x41>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds88{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x03 0x41>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds89{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x04 0x43>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds90{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x05 0x43>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds91{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x06 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds92{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x07 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds93{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x08 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds94{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x09 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds95{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x0A 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds96{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x0B 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds97{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x0C 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds98{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x0D 0x47>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds99{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x0E 0x47>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds100{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x0F 0x45>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds101{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x10 0x45>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds102{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x11 0x4B>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds103{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x12 0x4B>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds104{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x13 0x49>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds105{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x14 0x49>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds106{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x15 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds107{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x16 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds108{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x17 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds109{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x18 0x40>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds110{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x19 0x40>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds111{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1A 0x42>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds112{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1B 0x42>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds113{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1C 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds114{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1D 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds115{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1E 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds116{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x1F 0x1f>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds117{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x20 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds118{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x21 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds119{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x22 0x1f>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds120{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x23 0x46>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds121{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x24 0x46>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds122{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x25 0x44>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds123{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x26 0x44>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds124{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x27 0x4A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds125{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x28 0x4A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds126{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x29 0x48>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds127{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2A 0x48>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds128{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2B 0x1f>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds129{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2C 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds130{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2D 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds131{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2E 0x42>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds132{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2F 0x42>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds133{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x30 0x40>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds134{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x31 0x40>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds135{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x32 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds136{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x33 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds137{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x34 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds138{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x35 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds139{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x36 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds140{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x37 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds141{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x38 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds142{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x39 0x48>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds143{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3A 0x48>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds144{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3B 0x4A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds145{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3C 0x4A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds146{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3D 0x44>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds147{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3E 0x44>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds148{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x3F 0x46>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds149{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x40 0x46>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds150{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x41 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds151{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x42 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds152{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x43 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds153{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x44 0x43>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds154{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x45 0x43>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds155{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x46 0x41>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds156{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x47 0x41>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds157{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x48 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds158{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x49 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds159{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x4A 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds160{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x4B 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds161{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x4C 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds162{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x4D 0x1E>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds163{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x4E 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds164{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x4F 0x49>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds165{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x50 0x49>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds166{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x51 0x4B>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds167{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x52 0x4B>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds168{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x53 0x45>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds169{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x54 0x45>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds170{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x55 0x47>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds171{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x56 0x47>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds172{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x57 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds173{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x58 0x10>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds174{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x59 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds175{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5A 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds176{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5B 0x30>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds177{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5C 0x02>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds178{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5D 0x40>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds179{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5E 0x01>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds180{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x5F 0x02>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds181{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x60 0x30>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds182{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x61 0x01>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds183{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x62 0x02>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds184{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x63 0x6A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds185{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x64 0x6A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds186{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x65 0x05>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds187{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x66 0x12>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds188{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x67 0x74>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds189{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x68 0x04>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds190{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x69 0x6A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds191{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6A 0x6A>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds192{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6B 0x08>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds193{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6C 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds194{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6D 0x04>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds195{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6E 0x04>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds196{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x6F 0x88>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds197{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x70 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds198{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x71 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds199{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x72 0x06>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds200{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x73 0x7B>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds201{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x74 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds202{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x75 0x07>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds203{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x76 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds204{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x77 0x5D>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds205{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x78 0x17>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds206{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x79 0x1F>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds207{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7A 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds208{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7B 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds209{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7C 0x00>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds210{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7D 0x03>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds211{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x7E 0x7B>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds212{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE0 0x04>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds213{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x09 0x10>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds214{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2B 0x2B>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds215{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x2E 0x44>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds216{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE0 0x01>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds217{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x0E 0x01>;
            rockchip,cmd_delay = <1>;
        };


        rockchip,on-cmds218{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE0 0x00>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds219{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE6 0x02>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds220{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0xE7 0x02>;
            rockchip,cmd_delay = <1>;
        };
        rockchip,on-cmds221{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x05 dcs_set_display_on>;
            rockchip,cmd_delay = <120>;
        };
        rockchip,on-cmds222{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x05 dcs_exit_sleep_mode>;
            rockchip,cmd_delay = <90>;
        };
        rockchip,on-cmds223{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <0x15 0x35 0x00>;
            rockchip,cmd_delay = <1>;
        };
    };
    
    /* 
     * mipi lcd 时序配置,此部分需要手动修改细节。
     *
     */

    disp_timings: display-timings {
        native-mode = <&timing0>;
        compatible = "rockchip,display-timings";
        timing0: timing0 {
            screen-type = <SCREEN_MIPI>;
            lvds-format = <LVDS_8BIT_2>;
            out-face    = <OUT_P888>;
            clock-frequency = <72000000>;
            hactive = <800>;
            vactive = <1280>;
            hback-porch = <18>; // 120
            hfront-porch = <18>;
            vback-porch = <8>;  // 14
            vfront-porch = <24>; // 116
            hsync-len = <18>;
            vsync-len = <4>;
            hsync-active = <0>;
            vsync-active = <0>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
    };
};

然后是客户提供的初始化代码,如下:

Resolution:800x1280
External system porch setting: VS=4 ,VBP=8 ,VFP=24 ,HS=18 ,HBP=18 ,HFP=18
Frame rate:60HZ
MIPI CLK:405Mbps
Power:VCI=3.3, IOVCC=1.8
 
LCD_nReset=1;
Delayms(5);
LCD_nReset=0;
Delayms(10);
LCD_nReset=1;
Delayms(120);

//========== JD9365 B0E10.1 initial setting ==========//

//Page0
SSD_Single(0xE0,0x00);
//--- PASSWORD  ----//
SSD_Single(0xE1,0x93);
SSD_Single(0xE2,0x65);
SSD_Single(0xE3,0xF8);
SSD_Single(0xE3,0xF8,0x11,0x99);

//Lane select by internal reg  4 lanes
SSD_Single(0xE0,0x04);
SSD_Single(0x2D,0x03);//defult 0x01

SSD_Single(0xE0,0x00);
SSD_Single(0x80,0x03);

//--- Sequence Ctrl  ----//
SSD_Single(0x70,0x02);	//DC0,DC1
SSD_Single(0x71,0x23);	//DC2,DC3
SSD_Single(0x72,0x06);	//DC7

//--- Page1  ----//
SSD_Single(0xE0,0x01);
//Set VCOM
SSD_Single(0x00,0x00);
SSD_Single(0x01,0x66);
//Set VCOM_Reverse
SSD_Single(0x03,0x00);
SSD_Single(0x04,0x6D);
//Set Gamma Power, VGMP,VGMN,VGSP,VGSN
SSD_Single(0x17,0x00);
SSD_Single(0x18,0xBF);//4.5V
SSD_Single(0x19,0x00);
SSD_Single(0x1A,0x00);
SSD_Single(0x1B,0xBF);  //VGMN=-4.5V
SSD_Single(0x1C,0x00);
               
//Set Gate Power
SSD_Single(0x1F,0x3E);     //VGH_R  = 15V                       
SSD_Single(0x20,0x28);     //VGL_R  = -11V                      
SSD_Single(0x21,0x28);     //VGL_R2 = -11V                      
SSD_Single(0x22,0x0E);     //PA[6]=0, PA[5]=0, PA[4]=0, PA[0]=0 

//SETPANEL
SSD_Single(0x37,0x09);	//SS=1,BGR=1
//SET RGBCYC
SSD_Single(0x38,0x04);	//JDT=100 column inversion
SSD_Single(0x39,0x08);	//RGB_N_EQ1, modify 20140806
SSD_Single(0x3A,0x12);	//RGB_N_EQ2, modify 20140806
SSD_Single(0x3C,0x78);	//SET EQ3 for TE_H
SSD_Single(0x3D,0xFF);	//SET CHGEN_ON, modify 20140806 
SSD_Single(0x3E,0xFF);	//SET CHGEN_OFF, modify 20140806 
SSD_Single(0x3F,0x7F);	//SET CHGEN_OFF2, modify 20140806

//Set TCON
SSD_Single(0x40,0x06);	//RSO=800 RGB
SSD_Single(0x41,0xA0);	//LN=640->1280 line
//--- power voltage  ----//
SSD_Single(0x55,0x01);	//DCDCM=0001, JD PWR_IC
SSD_Single(0x56,0x01);
SSD_Single(0x57,0x69);
SSD_Single(0x58,0x0A);
SSD_Single(0x59,0x0A);	//VCL = -2.5V
SSD_Single(0x5A,0x29);	//VGH = 15.2V
SSD_Single(0x5B,0x15);	//VGL = -11.2V

//--- Gamma  ----//
SSD_Single(0x5D,0x7C);              
SSD_Single(0x5E,0x65);      
SSD_Single(0x5F,0x55);    
SSD_Single(0x60,0x49);    
SSD_Single(0x61,0x44);    
SSD_Single(0x62,0x35);    
SSD_Single(0x63,0x3A);    
SSD_Single(0x64,0x23);    
SSD_Single(0x65,0x3D);    
SSD_Single(0x66,0x3C);    
SSD_Single(0x67,0x3D);    
SSD_Single(0x68,0x5D);    
SSD_Single(0x69,0x4D);    
SSD_Single(0x6A,0x56);    
SSD_Single(0x6B,0x48);    
SSD_Single(0x6C,0x45);    
SSD_Single(0x6D,0x38);    
SSD_Single(0x6E,0x25);    
SSD_Single(0x6F,0x00);    
SSD_Single(0x70,0x7C);    
SSD_Single(0x71,0x65);    
SSD_Single(0x72,0x55);    
SSD_Single(0x73,0x49);    
SSD_Single(0x74,0x44);    
SSD_Single(0x75,0x35);    
SSD_Single(0x76,0x3A);    
SSD_Single(0x77,0x23);    
SSD_Single(0x78,0x3D);    
SSD_Single(0x79,0x3C);    
SSD_Single(0x7A,0x3D);    
SSD_Single(0x7B,0x5D);    
SSD_Single(0x7C,0x4D);    
SSD_Single(0x7D,0x56);    
SSD_Single(0x7E,0x48);    
SSD_Single(0x7F,0x45);    
SSD_Single(0x80,0x38);    
SSD_Single(0x81,0x25);    
SSD_Single(0x82,0x00);    
                                 
//Page2, for GIP                                      
SSD_Single(0xE0,0x02);                                
//GIP_L Pin mapping                                   
SSD_Single(0x00,0x1E);//1  VDS                        
SSD_Single(0x01,0x1E);//2  VDS                        
SSD_Single(0x02,0x41);//3  STV2                       
SSD_Single(0x03,0x41);//4  STV2                       
SSD_Single(0x04,0x43);//5  STV4                       
SSD_Single(0x05,0x43);//6  STV4                       
SSD_Single(0x06,0x1F);//7  VSD                        
SSD_Single(0x07,0x1F);//8  VSD                        
SSD_Single(0x08,0x1F);//9  GCL                        
SSD_Single(0x09,0x1F);//10                            
SSD_Single(0x0A,0x1E);//11 GCH                        
SSD_Single(0x0B,0x1E);//12 GCH                        
SSD_Single(0x0C,0x1F);//13                            
SSD_Single(0x0D,0x47);//14 CLK8                       
SSD_Single(0x0E,0x47);//15 CLK8                       
SSD_Single(0x0F,0x45);//16 CLK6                       
SSD_Single(0x10,0x45);//17 CLK6                       
SSD_Single(0x11,0x4B);//18 CLK4                       
SSD_Single(0x12,0x4B);//19 CLK4                       
SSD_Single(0x13,0x49);//20 CLK2                       
SSD_Single(0x14,0x49);//21 CLK2                       
SSD_Single(0x15,0x1F);//22 VGL                        
                                                      
                                                      
//GIP_R Pin mapping                                   
SSD_Single(0x16,0x1E);//1  VDS                 
SSD_Single(0x17,0x1E);//2  VDS                
SSD_Single(0x18,0x40);//3  STV1               
SSD_Single(0x19,0x40);//4  STV1               
SSD_Single(0x1A,0x42);//5  STV3               
SSD_Single(0x1B,0x42);//6  STV3               
SSD_Single(0x1C,0x1F);//7  VSD                
SSD_Single(0x1D,0x1F);//8  VSD                
SSD_Single(0x1E,0x1F);//9  GCL                
SSD_Single(0x1F,0x1f);//10                    
SSD_Single(0x20,0x1E);//11 GCH                
SSD_Single(0x21,0x1E);//12 GCH                
SSD_Single(0x22,0x1f);//13                    
SSD_Single(0x23,0x46);//14 CLK7               
SSD_Single(0x24,0x46);//15 CLK7               
SSD_Single(0x25,0x44);//16 CLK5               
SSD_Single(0x26,0x44);//17 CLK5               
SSD_Single(0x27,0x4A);//18 CLK3               
SSD_Single(0x28,0x4A);//19 CLK3               
SSD_Single(0x29,0x48);//20 CLK1               
SSD_Single(0x2A,0x48);//21 CLK1               
SSD_Single(0x2B,0x1f);//22 VGL                                 
     
//GIP_L_GS Pin mapping
SSD_Single(0x2C,0x1F);//1  VDS 		0x1E
SSD_Single(0x2D,0x1F);//2  VDS          0x1E
SSD_Single(0x2E,0x42);//3  STV2         0x41
SSD_Single(0x2F,0x42);//4  STV2         0x41
SSD_Single(0x30,0x40);//5  STV4         0x43
SSD_Single(0x31,0x40);//6  STV4         0x43
SSD_Single(0x32,0x1E);//7  VSD          0x1F
SSD_Single(0x33,0x1E);//8  VSD          0x1F
SSD_Single(0x34,0x1F);//9  GCL          0x1F
SSD_Single(0x35,0x1F);//10              0x1F
SSD_Single(0x36,0x1E);//11 GCH          0x1E
SSD_Single(0x37,0x1E);//12 GCH          0x1E
SSD_Single(0x38,0x1F);//13              0x1F
SSD_Single(0x39,0x48);//14 CLK8         0x47
SSD_Single(0x3A,0x48);//15 CLK8         0x47
SSD_Single(0x3B,0x4A);//16 CLK6         0x45
SSD_Single(0x3C,0x4A);//17 CLK6         0x45
SSD_Single(0x3D,0x44);//18 CLK4         0x4B
SSD_Single(0x3E,0x44);//19 CLK4         0x4B
SSD_Single(0x3F,0x46);//20 CLK2         0x49
SSD_Single(0x40,0x46);//21 CLK2         0x49
SSD_Single(0x41,0x1F);//22 VGL          0x1F

//GIP_R_GS Pin mapping
SSD_Single(0x42,0x1F);//1  VDS 		0x1E
SSD_Single(0x43,0x1F);//2  VDS          0x1E
SSD_Single(0x44,0x43);//3  STV1         0x40
SSD_Single(0x45,0x43);//4  STV1         0x40
SSD_Single(0x46,0x41);//5  STV3         0x42
SSD_Single(0x47,0x41);//6  STV3         0x42
SSD_Single(0x48,0x1E);//7  VSD          0x1F
SSD_Single(0x49,0x1E);//8  VSD          0x1F
SSD_Single(0x4A,0x1E);//9  GCL          0x1F
SSD_Single(0x4B,0x1F);//10              0x1f
SSD_Single(0x4C,0x1E);//11 GCH          0x1E
SSD_Single(0x4D,0x1E);//12 GCH          0x1E
SSD_Single(0x4E,0x1F);//13              0x1f
SSD_Single(0x4F,0x49);//14 CLK7         0x46
SSD_Single(0x50,0x49);//15 CLK7         0x46
SSD_Single(0x51,0x4B);//16 CLK5         0x44
SSD_Single(0x52,0x4B);//17 CLK5         0x44
SSD_Single(0x53,0x45);//18 CLK3         0x4A
SSD_Single(0x54,0x45);//19 CLK3         0x4A
SSD_Single(0x55,0x47);//20 CLK1         0x48
SSD_Single(0x56,0x47);//21 CLK1         0x48
SSD_Single(0x57,0x1F);//22 VGL          0x1f

//GIP Timing  
SSD_Single(0x58,0x10); 
SSD_Single(0x59,0x00); 
SSD_Single(0x5A,0x00); 
SSD_Single(0x5B,0x30); //STV_S0
SSD_Single(0x5C,0x02); //STV_S0
SSD_Single(0x5D,0x40); //STV_W / S1
SSD_Single(0x5E,0x01); //STV_S2
SSD_Single(0x5F,0x02); //STV_S3
SSD_Single(0x60,0x30); //ETV_W / S1
SSD_Single(0x61,0x01); //ETV_S2
SSD_Single(0x62,0x02); //ETV_S3
SSD_Single(0x63,0x6A); //SETV_ON  
SSD_Single(0x64,0x6A); //SETV_OFF 
SSD_Single(0x65,0x05); //ETV
SSD_Single(0x66,0x12); 
SSD_Single(0x67,0x74); 
SSD_Single(0x68,0x04); 
SSD_Single(0x69,0x6A); 
SSD_Single(0x6A,0x6A); 
SSD_Single(0x6B,0x08); 

SSD_Single(0x6C,0x00); 
SSD_Single(0x6D,0x04); 
SSD_Single(0x6E,0x04); 
SSD_Single(0x6F,0x88); 
SSD_Single(0x70,0x00); 
SSD_Single(0x71,0x00); 
SSD_Single(0x72,0x06); 
SSD_Single(0x73,0x7B); 
SSD_Single(0x74,0x00); 
SSD_Single(0x75,0x07); 
SSD_Single(0x76,0x00); 
SSD_Single(0x77,0x5D); 
SSD_Single(0x78,0x17); 
SSD_Single(0x79,0x1F); 
SSD_Single(0x7A,0x00); 
SSD_Single(0x7B,0x00); 
SSD_Single(0x7C,0x00); 
SSD_Single(0x7D,0x03); 
SSD_Single(0x7E,0x7B); 

//Page4
SSD_Single(0xE0,0x04);
SSD_Single(0x09,0x10);
SSD_Single(0x2B,0x2B);
SSD_Single(0x2E,0x44);

//Page1
SSD_Single(0xE0,0x01);
SSD_Single(0x0E,0x01);	//LEDON output VCSW2

//Page3
//SSD_Single(0xE0,0x03);
//SSD_Single(0x98,0x2F);	//From 2E to 2F, LED_VOL

//Page0
SSD_Single(0xE0,0x00);
SSD_Single(0xE6,0x02);
SSD_Single(0xE7,0x02);
//SLP OUT
SSD_Number(0x01);
SSD_CMD(0x11);  	// SLPOUT
Delayms(120);


//DISP ON
SSD_Number(0x01);
SSD_CMD(0x29);  	// DSPON
Delayms(5);

//--- TE----//
SSD_Single(0x35,0x00);

最后,是我这边制作的工具:

#!/usr/bin/python
#-*- coding: utf-8 -*-

'''
NAME   : 转化屏初始化代码为Rockchip芯片的dts格式
AUTOR  : whonee
DATE   : 20180102
VERSION: V0.1
'''
import re
import os
import sys
import time
import getpass

"""
    常量数据
"""
DEFAULT_MIPI_CLK = 500

DEFAULT_CMD_DELAY = 0

DEFAULT_RESUME_DELAY = 120

DEFAULT_EXIT_DELAY = 90

'''
    常量字符串定义
'''

FILE_HEAD = """
/*
 * Copyright (C) 2018 xxxx, Inc.
 * Licensed under GPLv2 or later.
 * fileName     : %str_fileName%
 * author       : %str_author%
 * create date  : %str_date%
 * lcd model    : 请手动填入Model型号
 * resolution   : 请手动填入分辨率
 * mipi channel : 请手动填入mipi通道数
 */

"""

FILE_BODY_HEAD = """

/ {

    /* mipi 相关配置 
     * compatible            -- 用户内核代码寻找对应dts配置的匹配字符串
     * rockchip,screen_init  -- 配置是否需要初始化代码,为1时,disp_mipi_init_cmds 才有效果
     * rockchip,dsi_lane     -- 配置MIPI的通道数
     * rockchip,dsi_hs_clk   -- MIPI时钟
     * rockchip,mipi_dsi_num -- 配置MIPI的组数
     */

    disp_mipi_init: mipi_dsi_init{
        compatible = "rockchip,mipi_dsi_init";
        rockchip,screen_init    = <1>;
        rockchip,dsi_lane       = <4>;
        rockchip,dsi_hs_clk     = <%str_hs_clk%>;
        rockchip,mipi_dsi_num   = <1>;
    };

    /* mipi lcd 的电源配置( 说明:默认不需要开启脚位控制 )
     * compatible            -- 用户内核代码寻找对应dts配置的匹配字符串
     * mipi_lcd_rst          -- 配置复位脚
     * mipi_lcd_en           -- 配置电源脚
     */
    
    disp_mipi_power_ctr: mipi_power_ctr {
        compatible = "rockchip,mipi_power_ctr";
        /*
        mipi_lcd_rst:mipi_lcd_rst{
                compatible = "rockchip,lcd_rst";
                rockchip,gpios = <&gpio2 GPIO_C2 GPIO_ACTIVE_HIGH>;
                rockchip,delay = <20>;
        };               
        mipi_lcd_en:mipi_lcd_en {
                compatible = "rockchip,lcd_en";
                rockchip,gpios = <&gpio0 GPIO_C1 GPIO_ACTIVE_HIGH>;
                rockchip,delay = <100>;
        };  
        */
    
    };
    
    /* mipi lcd 初始化代码
     * compatible            -- 用户内核代码寻找对应dts配置的匹配字符串
     * rockchip,cmd_debug    -- 配置是否启用debug模式
     * str_init_cmds         -- 配置具体初始化值
     */
     
    disp_mipi_init_cmds: screen-on-cmds {        
        compatible = "rockchip,screen-on-cmds";
        rockchip,cmd_debug = <0>;
"""

ROCKCHIP_INIT_CMD = """
        rockchip,on-cmds%str_count%{
            compatible = "rockchip,on-cmds";
            rockchip,cmd_type = <LPDT>;
            rockchip,dsi_id = <0>;
            rockchip,cmd = <%str_cmds%>;
            rockchip,cmd_delay = <%str_delay%>;
        };

"""


FILE_BODY_TAIL = """
    
    };
    
    /* 
     * mipi lcd 时序配置,此部分需要手动修改细节。
     *
     */
     
    disp_timings: display-timings {
        native-mode = <&timing0>;
        compatible = "rockchip,display-timings";
        timing0: timing0 {
            screen-type = <SCREEN_MIPI>;
            lvds-format = <LVDS_8BIT_2>;
            out-face    = <OUT_P888>;
            clock-frequency = <72000000>;
            hactive = <800>;
            vactive = <1280>;
            hback-porch = <18>; // 120
            hfront-porch = <18>;
            vback-porch = <8>;  // 14
            vfront-porch = <24>; // 116
            hsync-len = <18>;
            vsync-len = <4>;
            hsync-active = <0>;
            vsync-active = <0>;
            de-active = <0>;
            pixelclk-active = <0>;
            swap-rb = <0>;
            swap-rg = <0>;
            swap-gb = <0>;
        };
    
    };
};
"""

BASEDIR = os.path.abspath(os.path.dirname(__file__))

'''
    定义各种函数
'''

def parse_init_files():
    '''
        解析并写入文件
    '''
    fileHead = re.sub('%str_fileName%',sys.argv[1].split('.')[0]+'.dtsi',FILE_HEAD)
    fileHead = re.sub('%str_author%',getpass.getuser(),fileHead)
    fileHead = re.sub('%str_date%',time.asctime( time.localtime(time.time()) ),fileHead)
    fileHead = re.sub('%str_model_name%',"",fileHead)
    with open(sys.argv[1].split('.')[0]+'.dtsi', 'w') as f:
        f.write(fileHead)
    f.close()
    count=0
    with open(sys.argv[1], 'rb') as fi:
        with open(sys.argv[1].split('.')[0]+'.dtsi', 'aw') as fo:
            fo.write(re.sub('%str_hs_clk%',str(DEFAULT_MIPI_CLK),FILE_BODY_HEAD))
            for line in fi:
                if line.startswith("//"):
                    #print " -- 注释行直接保留 -- " + ENTER
                    #fo.write(line)
                    continue
                elif line.startswith('SSD_Single'):
                    count = count + 1 
                    params = line[11:].split(';')[0].split(')')[0].split(',')
                    data = re.sub('%str_count%',str(count),ROCKCHIP_INIT_CMD)
                    # 0x15 2段的数据
                    if len(params) == 2:
                        temp = "0x15 " + params[0] + " " + params[1]
                    # 0x39 多段的数据
                    elif len(params) > 2:
                        temp = '0x39'
                        for param in params:
                            temp = temp + " " + param
                    data = re.sub('%str_cmds%',temp,data)
                    data = re.sub('%str_delay%',str(DEFAULT_CMD_DELAY),data)
                    fo.write(data)
                elif line.startswith('SSD_CMD'):
                    count = count + 1
                    params = line[8:12]
                    data = re.sub('%str_count%',str(count),ROCKCHIP_INIT_CMD)
                    if params == '0x11':
                        temp = "0x05 dcs_set_display_on"
                        data = re.sub('%str_cmds%',temp,data)
                        data = re.sub('%str_delay%',str(DEFAULT_RESUME_DELAY),data)
                    elif params == '0x29':
                        temp = "0x05 dcs_exit_sleep_mode"
                        data = re.sub('%str_cmds%',temp,data)
                        data = re.sub('%str_delay%',str(DEFAULT_EXIT_DELAY),data)
                    fo.write(data)
                else:
                    continue
                    #print "---不需要处理,舍弃的数据----" + ENTER
                    #print line
            fo.write(FILE_BODY_TAIL)
    fo.close()
    fi.close()

def main( ):

    '''
        入口函数
    '''
    parse_init_files( )


 
if __name__ == '__main__':
    
    ''' 工具被调用的,入口按照main函数 '''
    if len(sys.argv) < 2:
        print "输出参数错误,请输入有效的文件名!" 
        sys.exit()
    elif len(sys.argv) == 2:
        if not os.path.isfile(sys.argv[1]):
            print "原始驱动文件不存在,请确认文件名是否输入错误!"
            sys.exit()
        print "开始转换格式,请稍后 ..." 
    main( )
    print '文件转换完毕!'
    exit( )

工具比较简单,我这里就不解释其中的细节了。

版权所有丨如未注明,均为原创,转载请注明转自:https://whonee.net/rockchip-lcd-init-code-tools-python.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注