Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54790415 authored by jialongjhan's avatar jialongjhan Committed by jialongjhan(169283)
Browse files

Expose display revision

According to customer requirements.

Display Driver needs to read IC's RDDID registers to expose LCM revision.

To avoid PCBA's file node get influences,

I create another file node to expose LCM revision.

User can type "cat /proc/lcm_revision" to exposes LCM revision.

Change-Id: I64d7ea1a03ddf371a5468962fe0e5c3d9caa3fc7
parent cfddcffd
Loading
Loading
Loading
Loading
+45 −6
Original line number Diff line number Diff line
@@ -3292,13 +3292,12 @@ extern int single_release(struct inode *, struct file *);
static int proc_lcm_vendor_show(struct seq_file *m, void *v)
{
    int lcm_id;

    lcm_id = gpio_request(59, "lcm_id");

    if(lcm_id == 1)
    {
        //For another's LCM module
    	seq_printf(m, "XXX , XXX\n");         
        seq_printf(m, "2nd LCM\n");         
    }
    else
    {   //DJN's LCM module id is 0.
@@ -3321,6 +3320,42 @@ static const struct file_operations proc_lcm_vendor_fops = {
};
/*[Arima_8901][Jialongjhan] Add LCM_vendor file node for PCBA function test 20181114 End*/

/*[Arima_8901][Jialongjhan] Expose display revision 20190326 begin*/

static int proc_lcm_revision_show(struct seq_file *m, void *v)
{
    int lcm_id;
    extern int RDDID_HWINFO[3];

    lcm_id = gpio_request(59, "lcm_id");

    if(lcm_id == 1)
    {
        //For another's LCM module
        seq_printf(m, "2nd Source not ready.\n");         
    }
    else
    {   //DJN's LCM module id is 0.
        seq_printf(m, "DJN , HX%x%x%x\n", RDDID_HWINFO[0],RDDID_HWINFO[1],RDDID_HWINFO[2]);
    }

    return 0;
}

static int proc_lcm_revision_fops_open(struct inode *inode, struct file *file)
{
    return single_open(file, proc_lcm_revision_show, NULL);
}

static const struct file_operations proc_lcm_revision_fops = { 
    .open  = proc_lcm_revision_fops_open, 
    .read = seq_read,
    .llseek = seq_lseek,
    .release = single_release,
};

/*[Arima_8901][Jialongjhan] Expose display revision 20190326 end*/

static int mdss_dsi_ctrl_probe(struct platform_device *pdev)
{
	int rc = 0;
@@ -3516,6 +3551,10 @@ static int mdss_dsi_ctrl_probe(struct platform_device *pdev)
    proc_create("lcm_vendor", 0, NULL, &proc_lcm_vendor_fops);
    //[Arima_8901][LCM][Jialongjhan] Add LCM_vendor file node for PCBA function test end	

    //[Arima_8901][Jialongjhan] Expose display revision 20190326 begin
    proc_create("lcm_revision", 0666, NULL, &proc_lcm_revision_fops);
    //[Arima_8901][Jialongjhan] Expose display revision 20190326 end
	
	return 0;

error_shadow_clk_deinit:
+33 −0
Original line number Diff line number Diff line
@@ -817,11 +817,22 @@ static void mdss_dsi_panel_switch_mode(struct mdss_panel_data *pdata,
		mdss_dsi_panel_dsc_pps_send(ctrl_pdata, &pdata->panel_info);
}

/*[Arima_8901][Jialongjhan] Expose display revision 20190326 begin*/
static char RDDID[4] = {0x04, 0x00, 0x00, 0x00};
static struct dsi_cmd_desc cmd_RDDID = {
    {DTYPE_DCS_READ, 1, 0, 1, 5, sizeof(RDDID)}, RDDID};
int RDDID_HWINFO[3];
int RDDID_read_count =0;
/*[Arima_8901][Jialongjhan] Expose display revision 20190326 end*/

static void mdss_dsi_panel_bl_ctrl(struct mdss_panel_data *pdata,
							u32 bl_level)
{
	struct mdss_dsi_ctrl_pdata *ctrl_pdata = NULL;
	struct mdss_dsi_ctrl_pdata *sctrl = NULL;
    /*[Arima_8901][Jialongjhan] Expose display revision 20190326 begin*/
    struct dcs_cmd_req cmdreq2;
    /*[Arima_8901][Jialongjhan] Expose display revision 20190326 end*/

	if (pdata == NULL) {
		pr_err("%s: Invalid input data\n", __func__);
@@ -831,6 +842,28 @@ static void mdss_dsi_panel_bl_ctrl(struct mdss_panel_data *pdata,
	ctrl_pdata = container_of(pdata, struct mdss_dsi_ctrl_pdata,
				panel_data);

    /*[Arima_8901][Jialongjhan] Expose display revision 20190326 begin*/
    if(RDDID_read_count==0){
        memset(&cmdreq2, 0, sizeof(cmdreq2));
        cmdreq2.cmds = &cmd_RDDID;
        cmdreq2.cmds_cnt = 1;
        cmdreq2.flags = CMD_REQ_COMMIT | CMD_REQ_RX;;
        cmdreq2.rlen = 3;//return 3 values
        cmdreq2.cb = NULL; /* call back */
        cmdreq2.rbuf = ctrl_pdata->rx_buf.data;
    
        mdss_dsi_cmdlist_put(ctrl_pdata, &cmdreq2);

        if(ctrl_pdata->rx_buf.len>0){
            RDDID_HWINFO[0]=(int)*(ctrl_pdata->rx_buf.data);
            RDDID_HWINFO[1]=(int)*(ctrl_pdata->rx_buf.data+1);
            RDDID_HWINFO[2]=(int)*(ctrl_pdata->rx_buf.data+2);
            //pr_err("[Jialong] ctrl->rx_buf.data data =0x%x\n",*(ctrl_pdata->rx_buf.data));
            RDDID_read_count++;
        }
    }
    /*[Arima_8901][Jialongjhan] Expose display revision 20190326 end*/

	/*
	 * Some backlight controllers specify a minimum duty cycle
	 * for the backlight brightness. If the brightness is less