Example #1
0
int disp_aal_set_param(DISP_AAL_PARAM __user *param, void *cmdq)
{
	int ret = -EFAULT;
	int backlight_value = 0;

	/* Not need to protect g_aal_param, since only AALService
	   can set AAL parameters. */
	if (copy_from_user(&g_aal_param, param, sizeof(DISP_AAL_PARAM)) == 0) {
		ret = disp_aal_write_param_to_reg(cmdq, &g_aal_param);
		backlight_value = g_aal_param.FinalBacklight;
	}

	if (g_aal_backlight_notified == 0)
		backlight_value = 0;

	if (ret == 0) {
		ret |= disp_pwm_set_backlight_cmdq(DISP_PWM0, backlight_value, cmdq);
	}

	AAL_DBG("disp_aal_set_param(CABC = %d, DRE[0,8] = %d,%d): ret = %d",
		g_aal_param.cabc_fltgain_force, g_aal_param.DREGainFltStatus[0],
		g_aal_param.DREGainFltStatus[8], ret);

	backlight_brightness_set(backlight_value);

	disp_aal_trigger_refresh();

	return ret;
}
Example #2
0
int disp_pwm_set_backlight(disp_pwm_id_t id, int level_1024)
{
    int ret;

    /* Always write registers by CPU */
    ret = disp_pwm_set_backlight_cmdq(id, level_1024, NULL);

    if (ret >= 0)
        disp_pwm_trigger_refresh(id);

    return 0;
}