From: Grazvydas Ignotas Date: Sun, 22 May 2016 22:16:48 +0000 (+0300) Subject: OMAPDSS: TPO-TD03MTEA1: add vdd regulator X-Git-Tag: sz_175~18 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdae4a3d59781a7c9dbcd4211520a210879d7b9e;p=pandora-kernel.git OMAPDSS: TPO-TD03MTEA1: add vdd regulator It's for CC units, where vdd comes from regen controlled 5V supply. On Rebirth/1GHz vdd is controlled by vaux1 (vcc). --- diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c index 1c7254f1bea0..0c6aca1b492c 100644 --- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c +++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c @@ -53,6 +53,7 @@ static const u16 tpo_td043_def_gamma[12] = { struct tpo_td043_device { struct spi_device *spi; struct regulator *vcc_reg; + struct regulator *vdd_reg; int nreset_gpio; u16 gamma[12]; u32 mode; @@ -281,6 +282,7 @@ static int tpo_td043_power_on(struct tpo_td043_device *tpo_td043) return 0; regulator_enable(tpo_td043->vcc_reg); + regulator_enable(tpo_td043->vdd_reg); /* wait for regulator to stabilize */ msleep(160); @@ -319,6 +321,7 @@ static void tpo_td043_power_off(struct tpo_td043_device *tpo_td043) 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; @@ -439,6 +442,13 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) 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) { @@ -462,6 +472,8 @@ static int tpo_td043_probe(struct omap_dss_device *dssdev) 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); @@ -476,6 +488,7 @@ static void tpo_td043_remove(struct omap_dss_device *dssdev) 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);