Commit b477a009 authored by Andreas Kemnade's avatar Andreas Kemnade Committed by Tomi Valkeinen

drm/omap: panel-tpo-td028ttec1: add backlight support

This panel has a backlight, so fetch it from devicetree using the
corresponding property as documented in panel-common.txt. It is
implemented the same way as in panel-dpi.c
This ensures the backlight is also disabled when the display is
turned off like when doing xset dpms force off.
Signed-off-by: default avatarAndreas Kemnade <andreas@kemnade.info>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent fe4ed1b4
...@@ -35,6 +35,8 @@ struct panel_drv_data { ...@@ -35,6 +35,8 @@ struct panel_drv_data {
struct videomode vm; struct videomode vm;
struct backlight_device *backlight;
struct spi_device *spi_dev; struct spi_device *spi_dev;
}; };
...@@ -258,12 +260,16 @@ static void td028ttec1_panel_enable(struct omap_dss_device *dssdev) ...@@ -258,12 +260,16 @@ static void td028ttec1_panel_enable(struct omap_dss_device *dssdev)
if (r) if (r)
dev_err(dssdev->dev, "%s: write error\n", __func__); dev_err(dssdev->dev, "%s: write error\n", __func__);
backlight_enable(ddata->backlight);
} }
static void td028ttec1_panel_disable(struct omap_dss_device *dssdev) static void td028ttec1_panel_disable(struct omap_dss_device *dssdev)
{ {
struct panel_drv_data *ddata = to_panel_data(dssdev); struct panel_drv_data *ddata = to_panel_data(dssdev);
backlight_disable(ddata->backlight);
dev_dbg(dssdev->dev, "td028ttec1_panel_disable()\n"); dev_dbg(dssdev->dev, "td028ttec1_panel_disable()\n");
jbt_ret_write_0(ddata, JBT_REG_DISPLAY_OFF); jbt_ret_write_0(ddata, JBT_REG_DISPLAY_OFF);
...@@ -311,6 +317,10 @@ static int td028ttec1_panel_probe(struct spi_device *spi) ...@@ -311,6 +317,10 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
if (ddata == NULL) if (ddata == NULL)
return -ENOMEM; return -ENOMEM;
ddata->backlight = devm_of_find_backlight(&spi->dev);
if (IS_ERR(ddata->backlight))
return PTR_ERR(ddata->backlight);
dev_set_drvdata(&spi->dev, ddata); dev_set_drvdata(&spi->dev, ddata);
ddata->spi_dev = spi; ddata->spi_dev = spi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment