首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

高通平台mipi panel kernel读包步骤

2012-09-09 
高通平台mipi panel kernel读包方法在mipi_xxx.c中加入下面函数即可,很好用的!关键时候起作用。static u32

高通平台mipi panel kernel读包方法



在mipi_xxx.c中加入下面函数即可,很好用的!关键时候起作用。

static u32 mipi_truely_read_reg(struct msm_fb_data_type *mfd, u16 reg)

{
        u32 data;
        int len = 4;
        struct dsi_cmd_desc cmd_read_reg = {
                DTYPE_GEN_READ2, 1, 0, 1, 0, /* cmd 0x24 */
                        sizeof(reg), (char *) &reg};

        mipi_dsi_buf_init(&truly_tx_buf);
        mipi_dsi_buf_init(&truly_rx_buf);

        /* mutex had been acquried at dsi_on */
        len = mipi_dsi_cmds_rx(mfd, &truly_tx_buf, &truly_rx_buf,
                               &cmd_read_reg, len);

        data = *(u32 *)truly_rx_buf.data;

        if (len != 4)
        printk("%s: invalid rlen=%d, expecting 4.\n", __func__, len);

        printk("%s: reg=0x%x.data=0x%08x.\n", __func__, reg, data);


        return data;
}


static int mipi_truly_lcd_on(struct platform_device *pdev)
{
        struct msm_fb_data_type *mfd;
       u32 data;

        mfd = platform_get_drvdata(pdev);

        if (!mfd)
                return -ENODEV;
        if (mfd->key != MFD_KEY)
                return -EINVAL;
        if (display_n) {        
                if (mipi_truly_lcd_reset() < 0) {
                        pr_err("mipi_truly_lcd_reset error\n");
                        return -EINVAL;
                }

                msleep(20);
                mipi_dsi_cmds_tx(mfd, &truly_tx_buf,
truly_video_display_on_cmds,ARRAY_SIZE(truly_video_display_on_cmds));
                printk("mipi_dsi_cmds_tx called here");
               mdelay(20);

              //add for testdata=mipi_truely_read_reg(mfd,0xE1);


        printk("data =0x%x",data);
        }
                
        display_n = TRUE;

        
        return 0;
}

热点排行