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

Commit 1f324509 authored by Marek Belisko's avatar Marek Belisko Committed by Tomi Valkeinen
Browse files

omapdss: panel-tpo-td028ec1: Add DT support.

parent 02b7a320
Loading
Loading
Loading
Loading
+30 −0
Original line number Original line Diff line number Diff line
Toppoly TD028TTEC1 Panel
========================

Required properties:
- compatible: "toppoly,td028ttec1"

Optional properties:
- label: a symbolic name for the panel

Required nodes:
- Video port for DPI input

Example
-------

lcd-panel: td028ttec1@0 {
	compatible = "toppoly,td028ttec1";
	reg = <0>;
	spi-max-frequency = <100000>;
	spi-cpol;
	spi-cpha;

	label = "lcd";
	port {
		lcd_in: endpoint {
			remote-endpoint = <&dpi_out>;
		};
	};
};
+1 −0
Original line number Original line Diff line number Diff line
@@ -566,6 +566,7 @@ static const char * const dss_compat_conv_list[] __initconst = {
	"svideo-connector",
	"svideo-connector",
	"ti,tfp410",
	"ti,tfp410",
	"ti,tpd12s015",
	"ti,tpd12s015",
	"toppoly,td028ttec1",
};
};


/* prepend compatible string with "omapdss," */
/* prepend compatible string with "omapdss," */
+31 −1
Original line number Original line Diff line number Diff line
@@ -206,6 +206,7 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)
	if (omapdss_device_is_enabled(dssdev))
	if (omapdss_device_is_enabled(dssdev))
		return 0;
		return 0;


	if (ddata->data_lines)
		in->ops.dpi->set_data_lines(in, ddata->data_lines);
		in->ops.dpi->set_data_lines(in, ddata->data_lines);
	in->ops.dpi->set_timings(in, &ddata->videomode);
	in->ops.dpi->set_timings(in, &ddata->videomode);


@@ -389,6 +390,23 @@ static int td028ttec1_panel_probe_pdata(struct spi_device *spi)
	return 0;
	return 0;
}
}


static int td028ttec1_probe_of(struct spi_device *spi)
{
	struct device_node *node = spi->dev.of_node;
	struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev);
	struct omap_dss_device *in;

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

	ddata->in = in;

	return 0;
}

static int td028ttec1_panel_probe(struct spi_device *spi)
static int td028ttec1_panel_probe(struct spi_device *spi)
{
{
	struct panel_drv_data *ddata;
	struct panel_drv_data *ddata;
@@ -418,6 +436,10 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
		r = td028ttec1_panel_probe_pdata(spi);
		r = td028ttec1_panel_probe_pdata(spi);
		if (r)
		if (r)
			return r;
			return r;
	} else if (spi->dev.of_node) {
		r = td028ttec1_probe_of(spi);
		if (r)
			return r;
	} else {
	} else {
		return -ENODEV;
		return -ENODEV;
	}
	}
@@ -463,6 +485,13 @@ static int td028ttec1_panel_remove(struct spi_device *spi)
	return 0;
	return 0;
}
}


static const struct of_device_id td028ttec1_of_match[] = {
	{ .compatible = "omapdss,toppoly,td028ttec1", },
	{},
};

MODULE_DEVICE_TABLE(of, td028ttec1_of_match);

static struct spi_driver td028ttec1_spi_driver = {
static struct spi_driver td028ttec1_spi_driver = {
	.probe		= td028ttec1_panel_probe,
	.probe		= td028ttec1_panel_probe,
	.remove		= td028ttec1_panel_remove,
	.remove		= td028ttec1_panel_remove,
@@ -470,6 +499,7 @@ static struct spi_driver td028ttec1_spi_driver = {
	.driver         = {
	.driver         = {
		.name   = "panel-tpo-td028ttec1",
		.name   = "panel-tpo-td028ttec1",
		.owner  = THIS_MODULE,
		.owner  = THIS_MODULE,
		.of_match_table = td028ttec1_of_match,
	},
	},
};
};