[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200614200121.14147-3-digetx@gmail.com>
Date: Sun, 14 Jun 2020 23:01:18 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Thierry Reding <thierry.reding@...il.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
Derek Basehore <dbasehore@...omium.org>,
Sam Ravnborg <sam@...nborg.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Sean Paul <sean@...rly.run>
Cc: dri-devel@...ts.freedesktop.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 2/5] drm/panel: lvds: Set up panel orientation
The panel orientation needs to parsed from a device-tree and assigned to
the panel's connector in order to make orientation property available to
userspace. That's what this patch does for the generic LVDS panel.
Signed-off-by: Dmitry Osipenko <digetx@...il.com>
---
drivers/gpu/drm/panel/panel-lvds.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index 5ce3f4a2b7a1..333d21cee5f6 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -37,6 +37,8 @@ struct panel_lvds {
struct gpio_desc *enable_gpio;
struct gpio_desc *reset_gpio;
+
+ enum drm_panel_orientation orientation;
};
static inline struct panel_lvds *to_panel_lvds(struct drm_panel *panel)
@@ -99,6 +101,7 @@ static int panel_lvds_get_modes(struct drm_panel *panel,
connector->display_info.bus_flags = lvds->data_mirror
? DRM_BUS_FLAG_DATA_LSB_TO_MSB
: DRM_BUS_FLAG_DATA_MSB_TO_LSB;
+ drm_connector_set_panel_orientation(connector, lvds->orientation);
return 1;
}
@@ -223,6 +226,11 @@ static int panel_lvds_probe(struct platform_device *pdev)
drm_panel_init(&lvds->panel, lvds->dev, &panel_lvds_funcs,
DRM_MODE_CONNECTOR_LVDS);
+ ret = of_drm_get_panel_orientation(lvds->dev->of_node,
+ &lvds->orientation);
+ if (ret)
+ return ret;
+
ret = drm_panel_of_backlight(&lvds->panel);
if (ret)
return ret;
--
2.26.0
Powered by blists - more mailing lists