From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= Subject: [PATCHv4 2/3] drm: add a helper function to extract 'de-active' and 'pixelclk-active' from DT Date: Tue, 12 Jul 2016 15:30:02 +0200 Message-ID: <1468330203-29150-3-git-send-email-LW@KARO-electronics.de> References: <1468330203-29150-1-git-send-email-LW@KARO-electronics.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <1468330203-29150-1-git-send-email-LW@KARO-electronics.de> Sender: linux-kernel-owner@vger.kernel.org To: David Airlie , Philipp Zabel , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Daniel Vetter Cc: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= List-Id: dri-devel@lists.freedesktop.org add a helper function to extract information about pixel clock and DE polarity from DT for use by of_get_drm_display_mode(). While at it, convert spaces to tabs in indentation in drm_modes.h. Signed-off-by: Lothar Wa=C3=9Fmann --- drivers/gpu/drm/drm_modes.c | 15 +++++++++++++++ include/drm/drm_modes.h | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index fc5040a..51804e5 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -657,6 +657,21 @@ void drm_display_mode_to_videomode(const struct dr= m_display_mode *dmode, } EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode); =20 +void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus= _flags) +{ + *bus_flags =3D 0; + if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) + *bus_flags |=3D DRM_BUS_FLAG_PIXDATA_POSEDGE; + if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) + *bus_flags |=3D DRM_BUS_FLAG_PIXDATA_NEGEDGE; + + if (vm->flags & DISPLAY_FLAGS_DE_LOW) + *bus_flags |=3D DRM_BUS_FLAG_DE_LOW; + if (vm->flags & DISPLAY_FLAGS_DE_HIGH) + *bus_flags |=3D DRM_BUS_FLAG_DE_HIGH; +} +EXPORT_SYMBOL_GPL(drm_bus_flags_from_videomode); + #ifdef CONFIG_OF /** * of_get_drm_display_mode - get a drm_display_mode from devicetree diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h index ff48177..a8164d2 100644 --- a/include/drm/drm_modes.h +++ b/include/drm/drm_modes.h @@ -434,7 +434,7 @@ struct drm_cmdline_mode; struct drm_display_mode *drm_mode_create(struct drm_device *dev); void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode = *mode); void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out, - const struct drm_display_mode *in); + const struct drm_display_mode *in); int drm_mode_convert_umode(struct drm_display_mode *out, const struct drm_mode_modeinfo *in); void drm_mode_probed_add(struct drm_connector *connector, struct drm_d= isplay_mode *mode); @@ -457,6 +457,7 @@ void drm_display_mode_from_videomode(const struct v= ideomode *vm, struct drm_display_mode *dmode); void drm_display_mode_to_videomode(const struct drm_display_mode *dmod= e, struct videomode *vm); +void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus= _flags); int of_get_drm_display_mode(struct device_node *np, struct drm_display_mode *dmode, int index); --=20 2.1.4