Пример #1
0
int mipi_smd_oled_hd_read_dev_reg( struct msm_fb_data_type *mfd, struct msmfb_register_read *data)
{
    const int one_read_size = 4;
    const int loop_limit = 16;
    int read_pos = 0;
    int readed_size = 0;
    int data_cnt = 0;
    int i,j;


    read_target_reg[0] = (char)data->w_data[0];
    packet_size[0] = (char)data->len;


    mipi_dsi_cmds_tx(&smd_oled_hd_tx_buf, &(mipi_smd_oled_hd_packet_size_cmd), 1);

    for (j = 0; j < loop_limit; j++)
    {
        read_position[1] = read_pos;


        if ( mipi_dsi_cmds_tx(&smd_oled_hd_tx_buf, &(mipi_smd_oled_hd_read_pos_cmd), 1) < 1 )
        {
            printk(KERN_ERR "%s. mipi_dsi_cmds_tx FAILED.\n", __func__);
            return -1;
        }

        mipi_dsi_op_mode_config(DSI_CMD_MODE);
        mipi_dsi_sw_reset();

        mipi_dsi_buf_init(&smd_oled_hd_rx_buf);


        readed_size = mipi_dsi_cmds_rx(mfd, &smd_oled_hd_tx_buf, &smd_oled_hd_rx_buf, &mipi_smd_oled_hd_read_reg_cmd, one_read_size);


        for (i = 0; i < readed_size; i++, data_cnt++)
        {
            if( data_cnt < data->len )
                data->r_data[data_cnt] = smd_oled_hd_rx_buf.data[i];
        }

        mipi_dsi_sw_reset();
        mipi_dsi_op_mode_config(DSI_VIDEO_MODE);


        read_pos += readed_size;
        if( read_pos > data->len )
            break;
    }

    return 0;
}
Пример #2
0
static void mipi_orise_bkl_ctrl(bool on)
{
	mutex_lock(&cmdlock);
	if(on) {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
		mipi_dsi_cmds_tx(&orise_tx_buf, orise_bkl_enable_cmds,
			ARRAY_SIZE(orise_bkl_enable_cmds));
	} else {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
		mipi_dsi_cmds_tx(&orise_tx_buf, orise_bkl_disable_cmds,
			ARRAY_SIZE(orise_bkl_disable_cmds));
	}
	mutex_unlock(&cmdlock);
}
Пример #3
0
static void mipi_sony_bkl_ctrl(struct msm_fb_data_type *mfd, bool on)
{
	PR_DISP_INFO("mipi_novatek_bkl_ctrl > on = %x\n", on);
	htc_mdp_sem_down(current, &mfd->dma->mutex);
	if (on) {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
		mipi_dsi_cmds_tx(mfd, &sony_tx_buf, sony_bkl_enable_cmds,
			ARRAY_SIZE(sony_bkl_enable_cmds));
	} else {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
		mipi_dsi_cmds_tx(mfd, &sony_tx_buf, sony_bkl_disable_cmds,
			ARRAY_SIZE(sony_bkl_disable_cmds));
	}
	htc_mdp_sem_up(&mfd->dma->mutex);
}
Пример #4
0
static int mipi_nt35565_ic_on_disp_on(struct msm_fb_data_type *mfd)
{
	struct mipi_dsi_data *dsi_data;
	struct dsi_controller *pctrl;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);
	if (!dsi_data)
		return -ENODEV;
	pctrl = dsi_data->panel->pctrl;

	if (!dsi_data->panel_detecting) {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);

		if (dsi_data->eco_mode_on && pctrl->display_on_eco_cmds) {
			mipi_dsi_buf_init(&dsi_data->tx_buf);
			mipi_dsi_cmds_tx(mfd, &dsi_data->tx_buf,
				pctrl->display_on_eco_cmds,
				pctrl->display_on_eco_cmds_size);
			dev_info(&mfd->panel_pdev->dev, "ECO MODE ON\n");
		} else {
			mipi_dsi_buf_init(&dsi_data->tx_buf);
			mipi_dsi_cmds_tx(mfd, &dsi_data->tx_buf,
				pctrl->display_on_cmds,
				pctrl->display_on_cmds_size);
			dev_info(&mfd->panel_pdev->dev, "ECO MODE OFF\n");
		}
	}

	return 0;
}
static int prepare_for_reg_access(struct msm_fb_data_type *mfd)
{
	struct device *dev = &mfd->panel_pdev->dev;
	struct mipi_dsi_data *dsi_data;
	int ret = 0;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);

	if (mfd->panel_power_on) {
		dev_dbg(dev, "%s: panel is on, don't do anything\n", __func__);
		on_state = false;
	} else {
		dev_dbg(dev, "%s: panel is NOT on, power on stack\n", __func__);

		ret = panel_next_on(mfd->pdev); /* msm_fb_dev */
		if (ret)
			goto exit;
		on_state = true;
	}

	mutex_lock(&mfd->dma->ov_mutex);
	if (mfd->panel_info.mipi.mode == DSI_VIDEO_MODE) {
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
		MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 0);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
		msleep(ONE_FRAME_TRANSMIT_WAIT_MS);
		mipi_dsi_controller_cfg(0);
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
	}
exit:
	return ret;
}
static void mipi_himax_display_on(struct msm_fb_data_type *mfd)
{
	pr_debug("%s+\n", __func__);
	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(&himax_tx_buf, himax_display_on_cmds,
		ARRAY_SIZE(himax_display_on_cmds));
}
static int mipi_dsi_set_backlight(struct msm_fb_data_type *mfd)
{
	struct mipi_panel_info *mipi;
	static int bl_level_old;

	mipi  = &mfd->panel_info.mipi;
	pr_debug("%s+:bl=%d status=%d\n", __func__, mfd->bl_level, mipi_status);
	if (mipi_status == 0 || bl_level_old == mfd->bl_level)
		goto end;
	if (mipi_himax_pdata && mipi_himax_pdata->shrink_pwm)
		led_pwm1[1] = mipi_himax_pdata->shrink_pwm(mfd->bl_level);
	else
		led_pwm1[1] = (unsigned char)(mfd->bl_level);

	if (mipi->mode == DSI_VIDEO_MODE) {
		mipi_dsi_cmd_mode_ctrl(1);	/* enable cmd mode */
		mipi_dsi_cmds_tx(&himax_tx_buf, himax_cmd_backlight_cmds,
		ARRAY_SIZE(himax_cmd_backlight_cmds));
		mipi_dsi_cmd_mode_ctrl(0);	/* disable cmd mode */
	} else {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
		mipi_dsi_cmds_tx(&himax_tx_buf, himax_cmd_backlight_cmds,
		ARRAY_SIZE(himax_cmd_backlight_cmds));
	}
	bl_level_old = mfd->bl_level;
end:
	return 0;
}
Пример #8
0
static int mipi_dsi_set_backlight(struct msm_fb_data_type *mfd)
{
	struct mipi_panel_info *mipi;
	static int bl_level_old;

	mutex_lock(&cmdlock);
	mipi  = &mfd->panel_info.mipi;
	pr_debug("%s+:bl=%d status=%d\n", __func__, mfd->bl_level, mipi_status);

	if (mipi_status == 0)
		goto end;

	if (mipi_renesas_pdata && mipi_renesas_pdata->shrink_pwm && mfd->bl_level!=0)
		led_pwm[2] = mipi_renesas_pdata->shrink_pwm(mfd->bl_level);
	else
		led_pwm[2] = (unsigned char)(mfd->bl_level);

	if (mfd->bl_level == 0 || board_mfg_mode() == 4 || board_mfg_mode() == 5) {
		led_pwm[2] = 0;
	}

	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_cmd_backlight_cmds,
	ARRAY_SIZE(renesas_cmd_backlight_cmds));
	bl_level_prevset = bl_level_old = mfd->bl_level;
end:
	mutex_unlock(&cmdlock);
	return 0;
}
static int mipi_r63306_disp_off(struct msm_fb_data_type *mfd)
{
	int ret = 0;
	struct mipi_dsi_data *dsi_data;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);

	if (!dsi_data || !dsi_data->lcd_power)
		return -ENODEV;

	if (!dsi_data->panel_detecting) {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);

		mipi_dsi_buf_init(&dsi_data->tx_buf);
		mipi_dsi_cmds_tx(&dsi_data->tx_buf,
			dsi_data->panel->pctrl->display_off_cmds,
			dsi_data->panel->pctrl->display_off_cmds_size);
#ifdef CONFIG_FB_MSM_RECOVER_PANEL
		mipi_set_tx_power_mode(1);
#endif
		ret = dsi_data->lcd_power(FALSE);
	} else {
		dsi_data->panel_detecting = false;
		ret = 0;
	}

	return ret;
}
int prepare_for_reg_access(struct msm_fb_data_type *mfd)
{
	struct device *dev = &mfd->panel_pdev->dev;
	struct mipi_dsi_data *dsi_data;
	int ret = 0;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);
#ifdef CONFIG_FB_MSM_RECOVER_PANEL
	mutex_lock(&mfd->nvrw_prohibit_draw);
#endif
	/* Needed to make sure the display stack isn't powered on/off while */
	/* we are executing. Also locks in msm_fb.c */
	mutex_lock(&mfd->power_lock);
	if (mdp_fb_is_power_off(mfd)) {
		dev_err(dev, "%s: panel is OFF, not supported\n", __func__);
		mutex_unlock(&mfd->power_lock);
#ifdef CONFIG_FB_MSM_RECOVER_PANEL
		mutex_unlock(&mfd->nvrw_prohibit_draw);
#endif
		ret = -EINVAL;
		goto exit;
	}

	mutex_lock(&mfd->dma->ov_mutex);
	if (mfd->panel_info.mipi.mode == DSI_VIDEO_MODE) {
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
		MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 0);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
		msleep(ONE_FRAME_TRANSMIT_WAIT_MS);
		mipi_dsi_controller_cfg_toggle(0);
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
	}
exit:
	return ret;
}
Пример #11
0
static void post_reg_access(struct msm_fb_data_type *mfd,
			    enum power_state old_state)
{
	struct mipi_dsi_data *dsi_data;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);

	/* This should not be needed, but without this we sometimes don't get an
	 * interrupt when transmitting the command */
	if (mfd->panel_info.mipi.mode == DSI_VIDEO_MODE) {
		mipi_dsi_op_mode_config(DSI_VIDEO_MODE);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
		mipi_dsi_sw_reset();
		mipi_dsi_controller_cfg(1);
		MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 1);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
	}
	mutex_unlock(&mfd->dma->ov_mutex);

	if (dsi_data->panel_state == DEBUGFS_POWER_ON) {
		(void)panel_next_off(mfd->pdev);
		mutex_lock(&dsi_data->lock);
		dsi_data->panel_state = old_state;
		mutex_unlock(&dsi_data->lock);
	}
	mutex_unlock(&mfd->power_lock);
}
static int mipi_dsi_set_backlight(struct msm_fb_data_type *mfd)
{
	struct mipi_panel_info *mipi;
	mutex_lock(&cmdlock);
	mipi  = &mfd->panel_info.mipi;
	PR_DISP_INFO("%s+:bl=%d status=%d\n", __func__, mfd->bl_level, mipi_status);
	if (mipi_status == 0)
		goto end;
	if (mipi_himax_pdata && mipi_himax_pdata->shrink_pwm)
		led_pwm1[1] = mipi_himax_pdata->shrink_pwm(mfd->bl_level);
	else
		led_pwm1[1] = (unsigned char)(mfd->bl_level);

	if(mfd->bl_level == 0 || board_mfg_mode() == 4 || board_mfg_mode() == 5)
		led_pwm1[1] = 0;

	if (mipi->mode == DSI_VIDEO_MODE) {
		mipi_dsi_cmds_tx(&himax_tx_buf, himax_cmd_backlight_cmds,
			ARRAY_SIZE(himax_cmd_backlight_cmds));
	} else {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
		mipi_dsi_cmds_tx(&himax_tx_buf, himax_cmd_backlight_cmds,
			ARRAY_SIZE(himax_cmd_backlight_cmds));
	}
	bl_level_prevset = mfd->bl_level;
end:
	mutex_unlock(&cmdlock);
	return 0;
}
static int mipi_lgit_lcd_on(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;
	mfd = platform_get_drvdata(pdev);
	if (!mfd)
		return -ENODEV;
	if (mfd->key != MFD_KEY)
		return -EINVAL;

	printk(KERN_INFO"%s: mipi lgit lcd on started, lge_bd_rev = %d \n", __func__, lge_bd_rev);
	mipi_lgit_lcd_reset();
	mipi_dsi_op_mode_config(DSI_CMD_MODE);

	//display on each panel
	//This is seperated by HW rev.
	if(lge_bd_rev < LGE_REV_E)
		mipi_dsi_cmds_tx(mfd, &lgit_tx_buf, lgit_power_on_set, ARRAY_SIZE(lgit_power_on_set));
	else {
		if(lge_bd_rev == LGE_REV_E)
			mipi_dsi_cmds_tx(mfd, &lgit_tx_buf, lgit_power_on_set_2P3, ARRAY_SIZE(lgit_power_on_set_2P3));
		else
			mipi_dsi_cmds_tx(mfd, &lgit_tx_buf, lgit_power_on_set_2P5, ARRAY_SIZE(lgit_power_on_set_2P5));
	}		
	

	return 0;
}
Пример #14
0
/* EMC workaround for LCM hang after ESD test */
void mipi_novatek_set_prevent_esd(struct msm_fb_data_type *mfd)
{
	htc_mdp_sem_down(current, &mfd->dma->mutex);
	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(&novatek_tx_buf, prevent_esd_cmds,
		ARRAY_SIZE(prevent_esd_cmds));
	htc_mdp_sem_up(&mfd->dma->mutex);
}
Пример #15
0
static void mipi_renesas_display_on(struct msm_fb_data_type *mfd)
{
	pr_info("%s+\n", __func__);
	mutex_lock(&cmdlock);
	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(&renesas_tx_buf, renesas_cmd_display_on_cmds,
	ARRAY_SIZE(renesas_cmd_display_on_cmds));
	mutex_unlock(&cmdlock);
}
Пример #16
0
static void mipi_orise_display_on(struct msm_fb_data_type *mfd)
{
	pr_debug("%s+\n", __func__);
	mutex_lock(&cmdlock);
	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(&orise_tx_buf, orise_display_on_cmds,
		ARRAY_SIZE(orise_display_on_cmds));
	mutex_unlock(&cmdlock);
}
Пример #17
0
static void mipi_sony_display_on(struct msm_fb_data_type *mfd)
{
	PR_DISP_DEBUG("%s+\n", __func__);
	htc_mdp_sem_down(current, &mfd->dma->mutex);
	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(mfd, &sony_tx_buf, sony_display_on_cmds,
		ARRAY_SIZE(sony_display_on_cmds));
	htc_mdp_sem_up(&mfd->dma->mutex);
}
/********************************************************************
Function Name  :-  drive_pwm_pin_to_low
Arguments 	   :-  None
Return Value   :-  int / Always Success.
Functionality  :-  to drive PWM pin of lcd panel to LOW.  
dependencies   :-  Panel Should be already ON.
 Others        :-  By writing 1 to pwm_pin parameter (module/mipi_lg4573/)
 					we can simulate low on pwm pin.
			For Software ESD simulation Testing.		
*********************************************************************/
static int drive_pwm_pin_to_low()
{
	struct msm_fb_data_type *mfd;
	int ret = 0;
	printk("%s Enter \n",__func__);
	mfd = platform_get_drvdata(local_pdev_for_pwm);
	if (!mfd)
		return -ENODEV;
	if (mfd->key != MFD_KEY)
		return -EINVAL;
	
	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(mfd, &lg4573b_tx_buf, lg4573b_pwm_pin_low_cmds,
			ARRAY_SIZE(lg4573b_pwm_pin_low_cmds));
	mipi_dsi_op_mode_config(DSI_VIDEO_MODE);

	printk("%s Exit \n",__func__);
	return ret;
}
Пример #19
0
static void mipi_himax_set_backlight(struct msm_fb_data_type *mfd)
{
	struct mipi_panel_info *mipi;

	
	if (bl_off) {
		mfd->bl_level = 0;
		bl_off = 0;
	}
	
	if (mipi_himax_pdata && mipi_himax_pdata->shrink_pwm)
		led_pwm1[1] = mipi_himax_pdata->shrink_pwm(mfd->bl_level);
	else
		led_pwm1[1] = (unsigned char)(mfd->bl_level);

	if (mipi_himax_pdata && (mipi_himax_pdata->enable_wled_bl_ctrl)
	    && (wled_trigger_initialized)) {
		led_trigger_event(bkl_led_trigger, led_pwm1[1]);
		return;
	}
	mipi  = &mfd->panel_info.mipi;
	pr_debug("%s+:bl=%d \n", __func__, mfd->bl_level);

	
	if (atomic_read(&lcd_power_state) == 0) {
		PR_DISP_DEBUG("%s: LCD is off. Skip backlight setting\n", __func__);
		return;
	}

	if (mipi->mode == DSI_VIDEO_MODE && mdp4_overlay_dsi_state_get() <= ST_DSI_SUSPEND) {
		return;
	}
	

	if (mipi->mode == DSI_CMD_MODE) {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
	}

	cmdreq_himax.cmds = himax_cmd_backlight_cmds;
	cmdreq_himax.cmds_cnt = ARRAY_SIZE(himax_cmd_backlight_cmds);
	cmdreq_himax.flags = CMD_REQ_COMMIT;
	cmdreq_himax.rlen = 0;
	cmdreq_himax.cb = NULL;
	mipi_dsi_cmdlist_put(&cmdreq_himax);

#ifdef CONFIG_BACKLIGHT_WLED_CABC
	
	if (wled_trigger_initialized) {
		led_trigger_event(bkl_led_trigger, mfd->bl_level);
	}
#endif
	return;
}
Пример #20
0
static void mipi_dsi_clk_toggle(struct msm_fb_data_type *mfd)
{
	mutex_lock(&mfd->dma->ov_mutex);

	if (mfd->panel_info.mipi.mode == DSI_VIDEO_MODE) {
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
		MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 0);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
		mipi_dsi_controller_cfg(0);
		mipi_dsi_op_mode_config(DSI_CMD_MODE);

		mipi_dsi_op_mode_config(DSI_VIDEO_MODE);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
		mipi_dsi_sw_reset();
		mipi_dsi_controller_cfg(1);
		MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 1);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
	}

	mutex_unlock(&mfd->dma->ov_mutex);
}
static int mipi_dsi_set_backlight(struct msm_fb_data_type *mfd)
{
	struct mipi_panel_info *mipi;

	mipi  = &mfd->panel_info.mipi;
	if (mipi_status == 0 || bl_level_prevset == mfd->bl_level) {
		PR_DISP_DEBUG("Skip the backlight setting > mipi_status : %d, bl_level_prevset : %d, bl_level : %d\n",
			mipi_status, bl_level_prevset, mfd->bl_level);
		goto end;
	}

	led_pwm1[1] = protou_shrink_pwm(mfd->bl_level);

	if (mfd->bl_level == 0 || board_mfg_mode() == 4 ||
	    (board_mfg_mode() == 5 && !(htc_battery_get_zcharge_mode() % 2))) {
		led_pwm1[1] = 0;
	}

	htc_mdp_sem_down(current, &mfd->dma->mutex);
	if (mipi->mode == DSI_VIDEO_MODE) {
		if (panel_type == PANEL_ID_PROTOU_LG) {
			/* This is added for LG panel which is needed to use BTA to clear the error happened in driverIC */
			MIPI_OUTP(MIPI_DSI_BASE + 0xA8, 0x10000000);
			mipi_dsi_cmd_bta_sw_trigger();

			/* Need to send blk disable cmd to turn off backlight, or it will change to dim brightness even sending 0 brightness */
			if (led_pwm1[1] == 0)
				mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, lg_bkl_disable_cmds,
					ARRAY_SIZE(lg_bkl_disable_cmds));
			else if (bl_level_prevset == 0)
				mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, lg_bkl_enable_cmds,
					ARRAY_SIZE(lg_bkl_enable_cmds));
		}
		mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, backlight_cmds,
			ARRAY_SIZE(backlight_cmds));
	} else {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
		mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, backlight_cmds,
			ARRAY_SIZE(backlight_cmds));
	}
	htc_mdp_sem_up(&mfd->dma->mutex);

	bl_level_prevset = mfd->bl_level;

	/* Record the last value which was not zero for resume use */
	if (mfd->bl_level >= BRI_SETTING_MIN)
		last_brightness = mfd->bl_level;

	PR_DISP_INFO("mipi_dsi_set_backlight > set brightness to %d(%d)\n", led_pwm1[1], mfd->bl_level);
end:
	return 0;
}
static void protou_display_on(struct msm_fb_data_type *mfd)
{
	PR_DISP_INFO("%s+\n", __func__);
#if 0 /* Skip the display_on cmd transfer for LG panel only */
	htc_mdp_sem_down(current, &mfd->dma->mutex);
	if (mfd->panel_info.type == MIPI_CMD_PANEL) {
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
	}
	mipi_dsi_cmds_tx(mfd, &protou_panel_tx_buf, lg_display_on_cmds,
		ARRAY_SIZE(lg_display_on_cmds));
	htc_mdp_sem_up(&mfd->dma->mutex);
#endif
}
/********************************************************************
Function Name  :-  drive_pwm_pin_to_high
Arguments 	   :-  None
Return Value   :-  int / Always Success.
Functionality  :-  Power off / reset / power on / lcd panel init.
dependencies   :-  Panel Should be already ON.
 Others        :-  By writing 0 to pwm_pin parameter (module/mipi_lg4573/)
 					we can re-initialize panel.
 			For Software ESD simulation Testing.
*********************************************************************/
static int drive_pwm_pin_to_high()
{
	struct msm_fb_data_type *mfd;
	int ret = 0;
	printk("%s Enter \n",__func__);
	mfd = platform_get_drvdata(local_pdev_for_pwm);
	if (!mfd)
		return -ENODEV;
	if (mfd->key != MFD_KEY)
		return -EINVAL;
	
	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(mfd, &lg4573b_tx_buf, lg4573b_disp_off_cmds,
			ARRAY_SIZE(lg4573b_disp_off_cmds));

	mipi_ldp_lcd_panel_poweroff();//reset pin
	esd_sw_test_lcd_panel_power_off(); //power
	
	mdelay(500);

	esd_sw_test_lcd_panel_power_on(); //panel power on
	
	mipi_set_tx_power_mode(1);
	mipi_dsi_cmds_tx(mfd, &lg4573b_tx_buf, lg4573b_init_on_cmds,
			ARRAY_SIZE(lg4573b_init_on_cmds));
	mdelay(10);
	mipi_dsi_cmds_tx(mfd, &lg4573b_tx_buf, lg4573b_sleep_out_cmds,
			ARRAY_SIZE(lg4573b_sleep_out_cmds));
	mdelay(120);
	mipi_dsi_cmds_tx(mfd, &lg4573b_tx_buf, lg4573b_disp_on_cmds,
			ARRAY_SIZE(lg4573b_disp_on_cmds));
	mipi_set_tx_power_mode(0);
	
	mipi_dsi_op_mode_config(DSI_VIDEO_MODE); //back to video mode.

	printk("%s Exit \n",__func__);

	return ret;
}
Пример #24
0
static void mipi_orise_display_on(struct msm_fb_data_type *mfd)
{

    
    PR_DISP_DEBUG("%s\n",  __FUNCTION__);

	mipi_dsi_op_mode_config(DSI_CMD_MODE);

	cmdreq_orise.cmds = orise_display_on_cmds;
	cmdreq_orise.cmds_cnt = ARRAY_SIZE(orise_display_on_cmds);
	cmdreq_orise.flags = 0;
	cmdreq_orise.rlen = 0;
	cmdreq_orise.cb = NULL;
	mipi_dsi_cmdlist_put(&cmdreq_orise);
}
Пример #25
0
static void mipi_himax_display_on(struct msm_fb_data_type *mfd)
{

    
    PR_DISP_DEBUG("%s\n",  __FUNCTION__);

	mipi_dsi_op_mode_config(DSI_CMD_MODE);

	cmdreq_himax.cmds = himax_display_on_cmds;
	cmdreq_himax.cmds_cnt = ARRAY_SIZE(himax_display_on_cmds);
	cmdreq_himax.flags = CMD_REQ_COMMIT;
	cmdreq_himax.rlen = 0;
	cmdreq_himax.cb = NULL;
	mipi_dsi_cmdlist_put(&cmdreq_himax);
}
Пример #26
0
static int prepare_for_reg_access(struct msm_fb_data_type *mfd,
				  enum power_state *old_state)
{
	struct device *dev = &mfd->panel_pdev->dev;
	struct mipi_dsi_data *dsi_data;
	int ret = 0;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);

	/* Needed to make sure the display stack isn't powered on/off while */
	/* we are executing. The best solution would be a read/write function */
	/* that handles the current power state */
	mutex_lock(&mfd->power_lock);

	if (mfd->panel_power_on) {
		dev_dbg(dev, "%s: panel is on, don't do anything\n", __func__);
	} else {
		dev_dbg(dev, "%s: panel is NOT on, power on stack\n", __func__);

		mutex_lock(&dsi_data->lock);
		*old_state = dsi_data->panel_state;
		dsi_data->panel_state = DEBUGFS_POWER_OFF;
		mutex_unlock(&dsi_data->lock);

		ret = panel_next_on(mfd->pdev); /* msm_fb_dev */
		if (ret) {
			mutex_unlock(&mfd->power_lock);
			goto exit;
		}
	}

	mutex_lock(&mfd->dma->ov_mutex);
	/* This should not be needed, but without this we sometimes don't get an
	 * interrupt when transmitting the command */
	if (mfd->panel_info.mipi.mode == DSI_VIDEO_MODE) {
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
		MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 0);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
		msleep(20);
		mipi_dsi_controller_cfg(0);
		mipi_dsi_op_mode_config(DSI_CMD_MODE);
	}
exit:
	return ret;
}
static int mipi_r63306_disp_on(struct msm_fb_data_type *mfd)
{
	int ret = 0;
	struct mipi_dsi_data *dsi_data;
	struct dsi_controller *pctrl;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);
	if (!dsi_data || !dsi_data->lcd_power) {
		ret = -ENODEV;
		goto disp_on_fail;
	}
	pctrl = dsi_data->panel->pctrl;

	if (!dsi_data->panel_detecting) {
		ret = dsi_data->lcd_power(TRUE);

		if (ret)
			goto disp_on_fail;

		mipi_dsi_op_mode_config(DSI_CMD_MODE);

		if (pctrl->display_init_cmds) {
			mipi_dsi_buf_init(&dsi_data->tx_buf);
			mipi_dsi_cmds_tx(mfd, &dsi_data->tx_buf,
				pctrl->display_init_cmds,
				pctrl->display_init_cmds_size);
		}
		if (dsi_data->eco_mode_on && pctrl->display_on_eco_cmds) {
			mipi_dsi_buf_init(&dsi_data->tx_buf);
			mipi_dsi_cmds_tx(mfd, &dsi_data->tx_buf,
				pctrl->display_on_eco_cmds,
				pctrl->display_on_eco_cmds_size);
			dev_info(&mfd->panel_pdev->dev, "ECO MODE ON\n");
		} else {
			mipi_dsi_buf_init(&dsi_data->tx_buf);
			mipi_dsi_cmds_tx(mfd, &dsi_data->tx_buf,
				pctrl->display_on_cmds,
				pctrl->display_on_cmds_size);
			dev_info(&mfd->panel_pdev->dev, "ECO MODE OFF\n");
		}
	}

disp_on_fail:
	return ret;
}
static void post_reg_access(struct msm_fb_data_type *mfd)
{
	struct mipi_dsi_data *dsi_data;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);

	if (mfd->panel_info.mipi.mode == DSI_VIDEO_MODE) {
		mipi_dsi_op_mode_config(DSI_VIDEO_MODE);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
		mipi_dsi_sw_reset();
		mipi_dsi_controller_cfg(1);
		MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 1);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
	}
	mutex_unlock(&mfd->dma->ov_mutex);

	if (on_state)
		(void)panel_next_off(mfd->pdev);
}
static int mipi_lgit_lcd_off(struct platform_device *pdev)
{
	struct msm_fb_data_type *mfd;
	mfd = platform_get_drvdata(pdev);
	if (!mfd)
		return -ENODEV;
	if (mfd->key != MFD_KEY)
		return -EINVAL;

	printk(KERN_INFO"%s: mipi lgit lcd off started \n", __func__);

	mipi_dsi_op_mode_config(DSI_CMD_MODE);
	mipi_dsi_cmds_tx(mfd, &lgit_tx_buf, lgit_power_off_set, ARRAY_SIZE(lgit_power_off_set));

	gpio_tlmm_config(GPIO_CFG(LCD_RESET_N, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA),GPIO_CFG_ENABLE);
	gpio_set_value(LCD_RESET_N,0);

	return 0;
}
void post_reg_access(struct msm_fb_data_type *mfd)
{
	struct mipi_dsi_data *dsi_data;

	dsi_data = platform_get_drvdata(mfd->panel_pdev);
	if (mfd->panel_info.mipi.mode == DSI_VIDEO_MODE) {
		mipi_dsi_op_mode_config(DSI_VIDEO_MODE);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
		mipi_dsi_sw_reset();
		mipi_dsi_controller_cfg_toggle(1);
		MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 1);
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
	}
	mutex_unlock(&mfd->dma->ov_mutex);
	mutex_unlock(&mfd->power_lock);
#ifdef CONFIG_FB_MSM_RECOVER_PANEL
	mutex_unlock(&mfd->nvrw_prohibit_draw);
#endif
}