struct tpo_td043_device {
struct spi_device *spi;
struct regulator *vcc_reg;
+ struct regulator *vdd_reg;
int nreset_gpio;
u16 gamma[12];
u32 mode;
.pixel_clock = 36000,
+ /* note:
+ * hbp+hsw must be 215
+ * if vbp+vsw < 32, the panel tears at the bottom
+ * if vbp+vsw > 35, it wraps from the top */
.hsw = 1,
- .hfp = 68,
+ .hfp = 150,
.hbp = 214,
.vsw = 1,
- .vfp = 39,
+ .vfp = 0,
.vbp = 34,
};
return 0;
regulator_enable(tpo_td043->vcc_reg);
+ regulator_enable(tpo_td043->vdd_reg);
/* wait for regulator to stabilize */
msleep(160);
tpo_td043_write(tpo_td043->spi, 3, TPO_R03_VAL_STANDBY);
+ regulator_disable(tpo_td043->vdd_reg);
regulator_disable(tpo_td043->vcc_reg);
tpo_td043->powered_on = 0;
goto fail_regulator;
}
+ tpo_td043->vdd_reg = regulator_get(&dssdev->dev, "vdd");
+ if (IS_ERR(tpo_td043->vdd_reg)) {
+ dev_err(&dssdev->dev, "failed to get LCD VDD regulator\n");
+ ret = PTR_ERR(tpo_td043->vdd_reg);
+ goto fail_vdd_regulator;
+ }
+
if (gpio_is_valid(nreset_gpio)) {
ret = gpio_request(nreset_gpio, "lcd reset");
if (ret < 0) {
fail_gpio_direction:
gpio_free(nreset_gpio);
fail_gpio_req:
+ regulator_put(tpo_td043->vdd_reg);
+fail_vdd_regulator:
regulator_put(tpo_td043->vcc_reg);
fail_regulator:
kfree(tpo_td043);
dev_dbg(&dssdev->dev, "remove\n");
sysfs_remove_group(&dssdev->dev.kobj, &tpo_td043_attr_group);
+ regulator_put(tpo_td043->vdd_reg);
regulator_put(tpo_td043->vcc_reg);
if (gpio_is_valid(nreset_gpio))
gpio_free(nreset_gpio);