All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Sebastian Reichel <sre@kernel.org>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Tony Lindgren <tony@atomide.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Subject: [PATCHv1 10/14] drm/omap: panel-dsi-cm: add physical size support
Date: Mon, 24 Jul 2017 19:33:07 +0200	[thread overview]
Message-ID: <20170724173311.27170-11-sebastian.reichel@collabora.co.uk> (raw)
In-Reply-To: <20170724173311.27170-1-sebastian.reichel@collabora.co.uk>

Add support to load physical size information from DT using
the properties defined by the common panel binding.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
---
 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
index 95c28f518239..b50b1e81b2f5 100644
--- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
+++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
@@ -66,6 +66,9 @@ struct panel_drv_data {
 
 	bool use_dsi_backlight;
 
+	int width_mm;
+	int height_mm;
+
 	struct omap_dsi_pin_config pin_config;
 
 	/* runtime variables */
@@ -1163,6 +1166,15 @@ static int dsicm_check_timings(struct omap_dss_device *dssdev,
 	return ret;
 }
 
+static void dsicm_get_size(struct omap_dss_device *dssdev,
+			  unsigned int *width, unsigned int *height)
+{
+	struct panel_drv_data *ddata = to_panel_data(dssdev);
+
+	*width = ddata->width_mm;
+	*height = ddata->height_mm;
+}
+
 static struct omap_dss_driver dsicm_ops = {
 	.connect	= dsicm_connect,
 	.disconnect	= dsicm_disconnect,
@@ -1175,6 +1187,7 @@ static struct omap_dss_driver dsicm_ops = {
 
 	.get_timings	= dsicm_get_timings,
 	.check_timings	= dsicm_check_timings,
+	.get_size	= dsicm_get_size,
 
 	.enable_te	= dsicm_enable_te,
 	.get_te		= dsicm_get_te,
@@ -1216,6 +1229,12 @@ static int dsicm_probe_of(struct platform_device *pdev)
 			 "failed to get video timing, using defaults\n");
 	}
 
+	ddata->width_mm = 0;
+	of_property_read_u32(node, "width-mm", &ddata->width_mm);
+
+	ddata->height_mm = 0;
+	of_property_read_u32(node, "height-mm", &ddata->height_mm);
+
 	in = omapdss_of_find_source_for_first_ep(node);
 	if (IS_ERR(in)) {
 		dev_err(&pdev->dev, "failed to find video source\n");
-- 
2.13.2

  parent reply	other threads:[~2017-07-24 17:36 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-24 17:32 [PATCHv1 00/14] omapdrm: DSI command mode panel support Sebastian Reichel
2017-07-24 17:32 ` [PATCHv1 01/14] drm/omap: remove unused function defines Sebastian Reichel
2017-07-26 10:39   ` Pavel Machek
2017-12-01 12:30   ` Tomi Valkeinen
2017-12-01 12:30     ` Tomi Valkeinen
2017-07-24 17:32 ` [PATCHv1 02/14] drm/omap: drop incorrect comment Sebastian Reichel
2017-07-26 10:40   ` Pavel Machek
2017-07-26 10:40     ` Pavel Machek
2017-07-24 17:33 ` [PATCHv1 03/14] drm/omap: plane: update fifo size on ovl setup Sebastian Reichel
2017-12-01 12:10   ` Tomi Valkeinen
2017-12-01 12:10     ` Tomi Valkeinen
2017-12-01 12:25     ` Sebastian Reichel
2017-07-24 17:33 ` [PATCHv1 04/14] drm/omap: add framedone interrupt support Sebastian Reichel
2017-07-24 17:33 ` [PATCHv1 05/14] drm/omap: add manual update detection helper Sebastian Reichel
2017-07-24 17:33 ` [PATCHv1 06/14] drm/omap: add support for manually updated displays Sebastian Reichel
2017-07-24 17:33 ` [PATCHv1 07/14] drm/omap: add support for physical size hints from display drivers Sebastian Reichel
2017-07-26 10:41   ` Pavel Machek
2017-07-26 10:41     ` Pavel Machek
2017-07-24 17:33 ` [PATCHv1 08/14] drm/omap: panel-dsi-cm: fix driver Sebastian Reichel
2017-12-01 12:28   ` Tomi Valkeinen
2017-12-01 12:28     ` Tomi Valkeinen
2017-07-24 17:33 ` [PATCHv1 09/14] drm/omap: panel-dsi-cm: add regulator support Sebastian Reichel
2017-07-24 17:33 ` Sebastian Reichel [this message]
2017-07-24 17:33 ` [PATCHv1 11/14] drm/omap: panel-dsi-cm: add external backlight support Sebastian Reichel
2017-07-24 17:33 ` [PATCHv1 12/14] drm/omap: panel-dsi-cm: switch to gpiod Sebastian Reichel
2017-07-24 17:33 ` [PATCHv1 13/14] ARM: dts: omap4-droid4: improve LCD description Sebastian Reichel
2017-07-24 17:33 ` [PATCHv1 14/14] ARM: dts: n950: add display support Sebastian Reichel
2017-07-26 10:41   ` Pavel Machek
2017-07-27 12:02 ` [PATCHv1 00/14] omapdrm: DSI command mode panel support Tony Lindgren
2017-09-29 13:26 ` Sebastian Reichel
2017-10-12  8:45   ` Tomi Valkeinen
2017-10-12  8:45     ` Tomi Valkeinen
2017-10-13 17:12     ` Tony Lindgren
2017-10-23 22:01       ` Sebastian Reichel
2017-10-26 11:59         ` Tomi Valkeinen
2017-10-26 11:59           ` Tomi Valkeinen
2017-10-27 18:00           ` Sebastian Reichel
2017-11-06 10:29           ` Pavel Machek
2017-12-01 12:58 ` Tomi Valkeinen
2017-12-01 12:58   ` Tomi Valkeinen
2017-12-08 18:01   ` Sebastian Reichel
2017-12-11  8:30     ` Tomi Valkeinen
2017-12-11  8:30       ` Tomi Valkeinen
2018-02-08  9:41   ` Pavel Machek
2018-02-08 10:53     ` Tomi Valkeinen
2018-02-08 10:53       ` Tomi Valkeinen
2018-02-08 18:30       ` Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170724173311.27170-11-sebastian.reichel@collabora.co.uk \
    --to=sebastian.reichel@collabora.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=sre@kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.