static int s6d6aa1_ldi_disable(struct lcd_info *lcd)
{
	int ret = 0;

	s6d6aa1_write(lcd, SEQ_DISPOFF, ARRAY_SIZE(SEQ_DISPOFF));
	s6d6aa1_write(lcd, SEQ_SLPIN, ARRAY_SIZE(SEQ_SLPIN));

	return ret;
}
static int s6d6aa1_ldi_enable(struct lcd_info *lcd)
{
	int ret = 0;

	s6d6aa1_write(lcd, SEQ_DISPON, ARRAY_SIZE(SEQ_DISPON));

	return ret;
}
Beispiel #3
0
static int s6d6aa1_ldi_init(struct lcd_info *lcd)
{
	int ret = 0;

	usleep_range(20000, 20000);

	s6d6aa1_write(lcd, SEQ_SLPOUT, ARRAY_SIZE(SEQ_SLPOUT));

	usleep_range(120000, 120000);

	s6d6aa1_write(lcd, SEQ_DSCTL, ARRAY_SIZE(SEQ_DSCTL));
	s6d6aa1_write(lcd, SEQ_WRCTRLD, ARRAY_SIZE(SEQ_WRCTRLD));
	s6d6aa1_write(lcd, SEQ_WRCABC, ARRAY_SIZE(SEQ_WRCABC));


	return ret;
}
static ssize_t auto_brightness_store(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t size)
{
	struct lcd_info *lcd = dev_get_drvdata(dev);
	int value;
	int rc;

	rc = strict_strtoul(buf, (unsigned int)0, (unsigned long *)&value);
	if (rc < 0)
		return rc;
	else {
		lcd->auto_brightness = value;
		if (lcd->auto_brightness < 4)
			s6d6aa1_write(lcd, SEQ_WRCABC, ARRAY_SIZE(SEQ_WRCABC));
		else
			s6d6aa1_write(lcd, SEQ_WRCABC_OUTDOOR, ARRAY_SIZE(SEQ_WRCABC_OUTDOOR));
	}
	return size;
}
Beispiel #5
0
static int update_brightness(struct lcd_info *lcd, u8 force)
{
	u32 brightness;

	mutex_lock(&lcd->bl_lock);

	brightness = lcd->bd->props.brightness;

	if (brightness < DIM_BRIGHTNESS)
		brightness = DIM_BRIGHTNESS;

	lcd->bl = get_backlight_level_from_brightness(brightness);

	if (LEVEL_IS_HBM(lcd->auto_brightness) && (brightness == lcd->bd->props.max_brightness))
		lcd->outdoor = true;
	else
		lcd->outdoor = false;

	if ((force) || ((lcd->ldi_enable) && (lcd->current_bl != lcd->bl))) {

		lcd->current_bl = lcd->bl;
		SEQ_WRDISBV_CTL[1] = lcd->bl;
		s6d6aa1_write(lcd, SEQ_WRDISBV_CTL, ARRAY_SIZE(SEQ_WRDISBV_CTL));

		dev_info(&lcd->ld->dev, "brightness=%d, bl=%d\n", brightness, lcd->bl);
	}

	if ((force) || (lcd->current_outdoor != lcd->outdoor)) {
		lcd->current_outdoor = lcd->outdoor;
		SEQ_WRDISBV_CTL[1] = lcd->outdoor ? 230 : lcd->bl;

		s6d6aa1_write(lcd, SEQ_WRDISBV_CTL,	ARRAY_SIZE(SEQ_WRDISBV_CTL));
		s6d6aa1_write(lcd, (lcd->outdoor ? SEQ_WRCABC_OUTDOOR : SEQ_WRCABC), \
			ARRAY_SIZE(SEQ_WRCABC));

		dev_info(&lcd->ld->dev, "outdoor mode is %s\n", lcd->outdoor ? "ON" : "OFF");
	}

	mutex_unlock(&lcd->bl_lock);

	return 0;
}
Beispiel #6
0
static ssize_t outdoor_store(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t size)
{
	struct lcd_info *lcd = dev_get_drvdata(dev);
	int value;
	int rc;

	rc = strict_strtoul(buf, (unsigned int)0, (unsigned long *)&value);
	if (rc < 0)
		return rc;
	else {
		lcd->outdoor = value;

		s6d6aa1_write(lcd, (lcd->outdoor ? SEQ_WRCABC_OUTDOOR : SEQ_WRCABC), \
			ARRAY_SIZE(SEQ_WRCABC));
	}
	return size;
}
static int update_brightness(struct lcd_info *lcd, u8 force)
{
	u32 brightness;

	mutex_lock(&lcd->bl_lock);

	brightness = lcd->bd->props.brightness;

	lcd->bl = get_backlight_level_from_brightness(brightness);

	if ((force) || ((lcd->ldi_enable) && (lcd->current_bl != lcd->bl))) {

		lcd->current_bl = lcd->bl;
		SEQ_WRDISBV_CTL[1] = lcd->bl;
		s6d6aa1_write(lcd, SEQ_WRDISBV_CTL, \
			ARRAY_SIZE(SEQ_WRDISBV_CTL));

		dev_info(&lcd->ld->dev, "brightness=%d, bl=%d\n", brightness, lcd->bl);
	}

	mutex_unlock(&lcd->bl_lock);

	return 0;
}
static int s6d6aa1_ldi_init(struct lcd_info *lcd)
{
	int ret = 0;

	msleep(15);

	s6d6aa1_write(lcd, SEQ_SLPOUT, ARRAY_SIZE(SEQ_SLPOUT));

	msleep(145);

	s6d6aa1_write(lcd, SEQ_PASSWD1, ARRAY_SIZE(SEQ_PASSWD1));
	s6d6aa1_write(lcd, SEQ_PASSWD2, ARRAY_SIZE(SEQ_PASSWD2));
	s6d6aa1_write(lcd, SEQ_SONY_IP_SET1, ARRAY_SIZE(SEQ_SONY_IP_SET1));
	s6d6aa1_write(lcd, SEQ_SONY_IP_SET2, ARRAY_SIZE(SEQ_SONY_IP_SET2));
	s6d6aa1_write(lcd, SEQ_PGAMMACTL, ARRAY_SIZE(SEQ_PGAMMACTL));
	s6d6aa1_write(lcd, SEQ_NGAMMACTL, ARRAY_SIZE(SEQ_NGAMMACTL));
	s6d6aa1_write(lcd, SEQ_PASSWD1_DISABLE, ARRAY_SIZE(SEQ_PASSWD1_DISABLE));
	s6d6aa1_write(lcd, SEQ_PASSWD2_DISABLE, ARRAY_SIZE(SEQ_PASSWD2_DISABLE));
	s6d6aa1_write(lcd, SEQ_DSCTL, ARRAY_SIZE(SEQ_DSCTL));
	s6d6aa1_write(lcd, SEQ_WRCTRLD, ARRAY_SIZE(SEQ_WRCTRLD));
	s6d6aa1_write(lcd, SEQ_WRCABC, ARRAY_SIZE(SEQ_WRCABC));


	return ret;
}