From 6529007522ded00b8912c079250620fa7a732166 Mon Sep 17 00:00:00 2001 From: Fabrizio Castro Date: Tue, 17 Dec 2019 13:45:56 +0000 Subject: drm: of: Add drm_of_lvds_get_dual_link_pixel_order An LVDS dual-link connection is made of two links, with even pixels transitting on one link, and odd pixels on the other link. The device tree can be used to fully describe dual-link LVDS connections between encoders and bridges/panels. The sink of an LVDS dual-link connection is made of two ports, the corresponding OF graph port nodes can be marked with either dual-lvds-even-pixels or dual-lvds-odd-pixels, and that fully describes an LVDS dual-link connection, including pixel order. drm_of_lvds_get_dual_link_pixel_order is a new helper added by this patch, given the source port nodes it returns DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS if the source port nodes belong to an LVDS dual-link connection, with even pixels expected to be generated from the first port, and odd pixels expected to be generated from the second port. If the new helper returns DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS, odd pixels are expected to be generated from the first port, and even pixels from the other port. Signed-off-by: Fabrizio Castro Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- include/drm/drm_of.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/drm/drm_of.h') diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h index ead34ab5ca4e..8ec7ca6d2369 100644 --- a/include/drm/drm_of.h +++ b/include/drm/drm_of.h @@ -16,6 +16,18 @@ struct drm_panel; struct drm_bridge; struct device_node; +/** + * enum drm_lvds_dual_link_pixels - Pixel order of an LVDS dual-link connection + * @DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS: Even pixels are expected to be generated + * from the first port, odd pixels from the second port + * @DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS: Odd pixels are expected to be generated + * from the first port, even pixels from the second port + */ +enum drm_lvds_dual_link_pixels { + DRM_LVDS_DUAL_LINK_EVEN_ODD_PIXELS = 0, + DRM_LVDS_DUAL_LINK_ODD_EVEN_PIXELS = 1, +}; + #ifdef CONFIG_OF uint32_t drm_of_crtc_port_mask(struct drm_device *dev, struct device_node *port); @@ -35,6 +47,8 @@ int drm_of_find_panel_or_bridge(const struct device_node *np, int port, int endpoint, struct drm_panel **panel, struct drm_bridge **bridge); +int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, + const struct device_node *port2); #else static inline uint32_t drm_of_crtc_port_mask(struct drm_device *dev, struct device_node *port) @@ -77,6 +91,12 @@ static inline int drm_of_find_panel_or_bridge(const struct device_node *np, { return -EINVAL; } + +int drm_of_lvds_get_dual_link_pixel_order(const struct device_node *port1, + const struct device_node *port2) +{ + return -EINVAL; +} #endif /* -- cgit v1.2.3-59-g8ed1b