Esempio n. 1
0
static ssize_t mipi_novatek_auto_brightness_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t size)
{
	struct msm_fb_data_type *mfd;
	mfd = platform_get_drvdata(msd.msm_pdev);

	if (sysfs_streq(buf, "0"))
		msd.dstat.auto_brightness = 0;
	else if (sysfs_streq(buf, "1"))
		msd.dstat.auto_brightness = 1;
	else if (sysfs_streq(buf, "2"))
		msd.dstat.auto_brightness = 2;
	else if (sysfs_streq(buf, "3"))
		msd.dstat.auto_brightness = 3;
	else if (sysfs_streq(buf, "4"))
		msd.dstat.auto_brightness = 4;
	else if (sysfs_streq(buf, "5"))
		msd.dstat.auto_brightness = 5;
	else if (sysfs_streq(buf, "6"))
		msd.dstat.auto_brightness = 6;
	else
		pr_info("%s: Invalid argument!!", __func__);

	pr_info("%s : level (%d), bl_level (%d) \n", 
		__func__, msd.dstat.auto_brightness, mfd->bl_level);

#ifdef CONFIG_SAMSUNG_CMC624
	if (samsung_has_cmc624()) {
		cabc_onoff_ctrl(msd.dstat.auto_brightness);
	}
#endif
	return size;
}
Esempio n. 2
0
static ssize_t siop_enable_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t size)
{
/* Disable siop for eur model */
#if 1/*common for melius*/
	return size;
#else
	int value;
	sscanf(buf, "%2d", &value);

	if (value < CABC_OFF_MODE || value >= MAX_CABC_MODE) {
		pr_debug("[CMC624:ERROR] : wrong cabc mode value : %d\n",
			value);
		return size;
	}

	if (cmc624_state.suspended == TRUE) {
		cmc624_state.cabc_mode = value;
		return size;
	}

	if (msd.dstat.auto_brightness == 0) {
		cabc_onoff_ctrl(value);
		pr_debug("[CMC624:INFO] set cabc by siop : %d\n", value);
	} else {
		pr_debug("[CMC624:INFO] cabc already set by settings : %d\n", msd.dstat.auto_brightness);
	}

	return size;
#endif
}
Esempio n. 3
0
static ssize_t mdnie_cabc_store(struct device *dev,
				struct device_attribute *attr, const char *buf, size_t size)
{
	int value;

#ifdef ENABLE_CMC623_TUNING
    if(tuning_enable) {
        printk("[CMC623:INFO]:%s:Tuning Mode Enabled\n",__func__);
        return size;
    }
#endif

	sscanf(buf, "%d", &value);

	printk("[CMC623:INFO]:set cabc on/off mode : %d\n",value);
    
    if (value < CABC_OFF_MODE || value >= MAX_CABC_MODE) {
        printk("[CMC623:ERROR] : wrong cabc mode value : %d\n",value);
        return size;
    }

    if (cmc623_state.suspended == TRUE) {
        pr_err("[CMC623:%s:ERROR] : Can't writing value while cmc623 suspend \n",__func__);
        cmc623_state.cabc_mode = value;
        return size;
    }

    cabc_onoff_ctrl(value);
//    set_backlight_pwm(cmc623_state.brightness);
    return size;
}
static ssize_t mipi_samsung_disp_acl_store(struct device *dev,
		struct device_attribute *attr, const char *buf, size_t size)
{
	struct msm_fb_data_type *mfd;

	mfd = platform_get_drvdata(msd.msm_pdev);

	if (!mfd->panel_power_on) {
		pr_info("%s: panel is off state. updating state value.\n",
			__func__);
		if (sysfs_streq(buf, "1") && !msd.dstat.acl_on)
			msd.dstat.acl_on = true;
		else if (sysfs_streq(buf, "0") && msd.dstat.acl_on)
			msd.dstat.acl_on = false;
		else
			pr_info("%s: Invalid argument!!", __func__);
	} else {
		if (sysfs_streq(buf, "1") && !msd.dstat.acl_on) {
			if (msd.mpd->set_acl(mfd->bl_level))
				mipi_samsung_disp_send_cmd(
					mfd, PANEL_ACL_OFF, true);
			else {
				mipi_samsung_disp_send_cmd(
					mfd, PANEL_ACL_ON, true);
				mipi_samsung_disp_send_cmd(
					mfd, PANEL_ACL_UPDATE, true);
#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_HD_PT)
				if (samsung_has_cmc624())
					cabc_onoff_ctrl(1);
#endif
			}
			msd.dstat.acl_on = true;
		} else if (sysfs_streq(buf, "0") && msd.dstat.acl_on) {
			mipi_samsung_disp_send_cmd(mfd, PANEL_ACL_OFF, true);
			msd.dstat.acl_on = false;
#if defined(CONFIG_FB_MSM_MIPI_SAMSUNG_OLED_VIDEO_HD_PT)
			if (samsung_has_cmc624())
				cabc_onoff_ctrl(0);
#endif
		} else {
			pr_info("%s: Invalid argument!!", __func__);
		}
	}

	return size;
}