int mdss_dsi_ioctl_handler(struct mdss_panel_data *pdata, u32 cmd, void *arg)
{
	int rc = -ENOSYS;
	struct msmfb_reg_access reg_access;
	int old_tx_mode;
	int mode = DSI_MODE_BIT_LP;

	if (!pdata->panel_info.panel_power_on) {
		pr_err("%s: Panel is off\n", __func__);
		return -EPERM;
	}

	if (copy_from_user(&reg_access, arg, sizeof(reg_access)))
		return -EFAULT;

	if (reg_access.use_hs_mode)
		mode = DSI_MODE_BIT_HS;

	old_tx_mode = mdss_get_tx_power_mode(pdata);
	if (mode != old_tx_mode)
		mdss_set_tx_power_mode(mode, pdata);

	rc = mdss_dsi_panel_ioctl_handler(pdata, cmd, arg);

	if (mode != old_tx_mode)
		mdss_set_tx_power_mode(old_tx_mode, pdata);

	return rc;
}
Beispiel #2
0
int mdss_dsi_ioctl_handler(struct mdss_panel_data *pdata, u32 cmd, void *arg)
{
	int rc = -ENOSYS;
	struct msmfb_reg_access reg_access;
	int old_tx_mode;
	int mode = DSI_MODE_BIT_LP;

	if (!pdata->panel_info.panel_power_on) {
		pr_err("%s: Panel is off\n", __func__);
		return -EPERM;
	}

	switch (cmd) {
	case MSMFB_REG_WRITE:
	case MSMFB_REG_READ:
		if (copy_from_user(&reg_access, arg, sizeof(reg_access)))
			return -EFAULT;

		if (reg_access.use_hs_mode)
			mode = DSI_MODE_BIT_HS;

		old_tx_mode = mdss_get_tx_power_mode(pdata);
		if (mode != old_tx_mode)
			mdss_set_tx_power_mode(mode, pdata);

		rc = mdss_dsi_panel_ioctl_handler(pdata, cmd, arg);

		if (mode != old_tx_mode)
			mdss_set_tx_power_mode(old_tx_mode, pdata);
		break;
	default:
		pr_err("%s: unsupport ioctl =0x%x\n", __func__, cmd);
		rc = -EFAULT;
		break;
	}

	return rc;
}