0001-PATCHv2-6-8-drm-omap-panel-dsi-cm-add-orientation-support.patch (2676B)
1 From patchwork Thu Feb 8 18:30:33 2018 2 Content-Type: text/plain; charset="utf-8" 3 MIME-Version: 1.0 4 Content-Transfer-Encoding: 7bit 5 Subject: [PATCHv2,6/8] drm/omap: panel-dsi-cm: add orientation support 6 From: Sebastian Reichel <sebastian.reichel@collabora.co.uk> 7 X-Patchwork-Id: 10207747 8 Message-Id: <20180208183035.8461-7-sebastian.reichel@collabora.co.uk> 9 To: Sebastian Reichel <sre@kernel.org>, 10 Tomi Valkeinen <tomi.valkeinen@ti.com>, Tony Lindgren <tony@atomide.com> 11 Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, 12 Hans de Goede <hdegoede@redhat.com>, Rob Herring <robh+dt@kernel.org>, 13 Mark Rutland <mark.rutland@arm.com>, 14 dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, 15 linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, 16 kernel@collabora.com, Sebastian Reichel <sebastian.reichel@collabora.co.uk> 17 Date: Thu, 8 Feb 2018 19:30:33 +0100 18 19 Add support to inform the DRM subsystem about the orientation 20 the display has been mounted to the casing. 21 22 Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> 23 --- 24 drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 13 +++++++++++++ 25 1 file changed, 13 insertions(+) 26 27 diff --git a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c 28 index 15399a1a666b..7a63d6775a27 100644 29 --- a/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c 30 +++ b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c 31 @@ -68,6 +68,7 @@ struct panel_drv_data { 32 33 int width_mm; 34 int height_mm; 35 + int orientation; 36 37 struct omap_dsi_pin_config pin_config; 38 39 @@ -1198,6 +1199,14 @@ static void dsicm_get_size(struct omap_dss_device *dssdev, 40 *height = ddata->height_mm; 41 } 42 43 +static void dsicm_get_orientation(struct omap_dss_device *dssdev, 44 + int *orientation) 45 +{ 46 + struct panel_drv_data *ddata = to_panel_data(dssdev); 47 + 48 + *orientation = ddata->orientation; 49 +} 50 + 51 static struct omap_dss_driver dsicm_ops = { 52 .connect = dsicm_connect, 53 .disconnect = dsicm_disconnect, 54 @@ -1211,6 +1220,7 @@ static struct omap_dss_driver dsicm_ops = { 55 .get_timings = dsicm_get_timings, 56 .check_timings = dsicm_check_timings, 57 .get_size = dsicm_get_size, 58 + .get_orientation = dsicm_get_orientation, 59 60 .enable_te = dsicm_enable_te, 61 .get_te = dsicm_get_te, 62 @@ -1259,6 +1269,9 @@ static int dsicm_probe_of(struct platform_device *pdev) 63 ddata->height_mm = 0; 64 of_property_read_u32(node, "height-mm", &ddata->height_mm); 65 66 + ddata->orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; 67 + of_property_read_u32(node, "orientation", &ddata->orientation); 68 + 69 in = omapdss_of_find_source_for_first_ep(node); 70 if (IS_ERR(in)) { 71 dev_err(&pdev->dev, "failed to find video source\n");