Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e7efe4e authored by Sebastian Reichel's avatar Sebastian Reichel Committed by Tomi Valkeinen
Browse files

OMAPDSS: acx565akm: Add DT support



Add DT support for panel-sony-acx565akm

Signed-off-by: default avatarSebastian Reichel <sre@debian.org>
[tomi.valkeinen@ti.com: some modifications]
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarArchit Taneja <archit@ti.com>
parent fcc900a6
Loading
Loading
Loading
Loading
+32 −1
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@
#include <linux/backlight.h>
#include <linux/fb.h>
#include <linux/gpio.h>
#include <linux/of.h>
#include <linux/of_gpio.h>

#include <video/omapdss.h>
#include <video/omap-panel-data.h>
@@ -547,6 +549,8 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
	dev_dbg(&ddata->spi->dev, "%s\n", __func__);

	in->ops.sdi->set_timings(in, &ddata->videomode);

	if (ddata->datapairs > 0)
		in->ops.sdi->set_datapairs(in, ddata->datapairs);

	r = in->ops.sdi->enable(in);
@@ -726,6 +730,22 @@ static int acx565akm_probe_pdata(struct spi_device *spi)
	return 0;
}

static int acx565akm_probe_of(struct spi_device *spi)
{
	struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
	struct device_node *np = spi->dev.of_node;

	ddata->reset_gpio = of_get_named_gpio(np, "reset-gpios", 0);

	ddata->in = omapdss_of_find_source_for_first_ep(np);
	if (IS_ERR(ddata->in)) {
		dev_err(&spi->dev, "failed to find video source\n");
		return PTR_ERR(ddata->in);
	}

	return 0;
}

static int acx565akm_probe(struct spi_device *spi)
{
	struct panel_drv_data *ddata;
@@ -753,7 +773,12 @@ static int acx565akm_probe(struct spi_device *spi)
		r = acx565akm_probe_pdata(spi);
		if (r)
			return r;
	} else if (spi->dev.of_node) {
		r = acx565akm_probe_of(spi);
		if (r)
			return r;
	} else {
		dev_err(&spi->dev, "platform data missing!\n");
		return -ENODEV;
	}

@@ -864,10 +889,16 @@ static int acx565akm_remove(struct spi_device *spi)
	return 0;
}

static const struct of_device_id acx565akm_of_match[] = {
	{ .compatible = "omapdss,sony,acx565akm", },
	{},
};

static struct spi_driver acx565akm_driver = {
	.driver = {
		.name	= "acx565akm",
		.owner	= THIS_MODULE,
		.of_match_table = acx565akm_of_match,
	},
	.probe	= acx565akm_probe,
	.remove	= acx565akm_remove,