1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-25 02:30:38 +02:00

Set correct color sequnce.

Add a debug sysfs entry reg which gives direct write access to lcms display
registers.
This commit is contained in:
Lars-Peter Clausen 2009-09-03 21:20:19 +02:00 committed by Xiangfu Liu
parent 3a1ece5ea7
commit 1976b23d08

View File

@ -74,6 +74,23 @@ int gpm940b0_bl_update_status(struct backlight_device *bl)
return 0;
}
static size_t reg_write(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
char *buf2;
uint32_t reg = simple_strtoul(buf, &buf2, 10);
uint32_t val = simple_strtoul(buf2 + 1, NULL, 10);
struct gpm940b0 *gpm940b0 = dev_get_drvdata(dev);
if (reg < 0 || val < 0)
return -EINVAL;
gpm940b0_write_reg(gpm940b0->spi, reg, val);
return count;
}
static DEVICE_ATTR(reg, 0644, NULL, reg_write);
static struct lcd_ops gpm940b0_lcd_ops = {
.set_power = gpm940b0_set_power,
.set_contrast = gpm940b0_set_contrast,
@ -125,7 +142,11 @@ static int __devinit gpm940b0_probe(struct spi_device *spi)
gpm940b0->bl->props.brightness = 0;
gpm940b0->bl->props.power = FB_BLANK_UNBLANK;
}
device_create_file(&spi->dev, &dev_attr_reg);
dev_set_drvdata(&spi->dev, gpm940b0);
gpm940b0_write_reg(spi, 0x13, 0x1);
return 0;
err_free_gpm940b0:
return ret;