static ssize_t mipi_samsung_auto_brightness_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { #if defined(AUTO_BRIGHTNESS_CABC_FUNCTION) struct msm_fb_data_type *mfd = NULL; mfd = platform_get_drvdata(msd.msm_pdev); if (unlikely(!mfd)) return -ENODEV; if (unlikely(mfd->key != MFD_KEY)) return -EINVAL; // 0, 5, 6 => CABC OFF // 1, 2, 3, 4 => CABC ON 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__); if( (msd.dstat.auto_brightness >= 1) && (msd.dstat.auto_brightness <= 4) ) { if( is_disp_on == 1 ) mipi_samsung_cabc_onoff ( 1 ); else is_cabc_delayed = 1; } else { if( msd.mpd->siop_status == false ) mipi_samsung_cabc_onoff ( 0 ); } #else if (sysfs_streq(buf, "1")) msd.dstat.auto_brightness = 1; else if (sysfs_streq(buf, "0")) msd.dstat.auto_brightness = 0; else pr_info("%s: Invalid argument!!", __func__); #endif return size; }
static ssize_t mipi_samsung_disp_siop_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { if (sysfs_streq(buf, "1")) { msd.mpd->siop_status = true; mipi_samsung_cabc_onoff ( 1 ); } else if (sysfs_streq(buf, "0")) { msd.mpd->siop_status = false; if( msd.dstat.auto_brightness == false ) mipi_samsung_cabc_onoff ( 0 ); } else { pr_info("%s: Invalid argument!!", __func__); return size; } pr_info("%s : auto_brightness (%d) siop_status (%d)", __func__, msd.dstat.auto_brightness, msd.mpd->siop_status); return size; }
static ssize_t cabc_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { int value; sscanf(buf, "%d", &value); cabc = value? 1: 0; mipi_samsung_cabc_onoff ( cabc ); DPRINT ( "cabc_store, input value = %d\n", value); return size; }