diff options
author | Lothar Waßmann <LW@KARO-electronics.de> | 2016-07-12 09:30:02 -0400 |
---|---|---|
committer | Philipp Zabel <p.zabel@pengutronix.de> | 2016-08-08 05:44:20 -0400 |
commit | d72daa0d75e8fe71368113350254b9da2c64b235 (patch) | |
tree | 5a47353d2217b38e099624bd954bf919c2f1ee40 | |
parent | 29b4817d4018df78086157ea3a55c1d9424a7cfc (diff) |
drm: add a helper function to extract 'de-active' and 'pixelclk-active' from DT
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ßmann <LW@KARO-electronics.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
-rw-r--r-- | drivers/gpu/drm/drm_modes.c | 15 | ||||
-rw-r--r-- | include/drm/drm_modes.h | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index fc5040ae5f25..51804e5c58b9 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 drm_display_mode *dmode, | |||
657 | } | 657 | } |
658 | EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode); | 658 | EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode); |
659 | 659 | ||
660 | void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags) | ||
661 | { | ||
662 | *bus_flags = 0; | ||
663 | if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) | ||
664 | *bus_flags |= DRM_BUS_FLAG_PIXDATA_POSEDGE; | ||
665 | if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) | ||
666 | *bus_flags |= DRM_BUS_FLAG_PIXDATA_NEGEDGE; | ||
667 | |||
668 | if (vm->flags & DISPLAY_FLAGS_DE_LOW) | ||
669 | *bus_flags |= DRM_BUS_FLAG_DE_LOW; | ||
670 | if (vm->flags & DISPLAY_FLAGS_DE_HIGH) | ||
671 | *bus_flags |= DRM_BUS_FLAG_DE_HIGH; | ||
672 | } | ||
673 | EXPORT_SYMBOL_GPL(drm_bus_flags_from_videomode); | ||
674 | |||
660 | #ifdef CONFIG_OF | 675 | #ifdef CONFIG_OF |
661 | /** | 676 | /** |
662 | * of_get_drm_display_mode - get a drm_display_mode from devicetree | 677 | * 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 ff481770d76b..a8164d2336e6 100644 --- a/include/drm/drm_modes.h +++ b/include/drm/drm_modes.h | |||
@@ -434,7 +434,7 @@ struct drm_cmdline_mode; | |||
434 | struct drm_display_mode *drm_mode_create(struct drm_device *dev); | 434 | struct drm_display_mode *drm_mode_create(struct drm_device *dev); |
435 | void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode); | 435 | void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode); |
436 | void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out, | 436 | void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out, |
437 | const struct drm_display_mode *in); | 437 | const struct drm_display_mode *in); |
438 | int drm_mode_convert_umode(struct drm_display_mode *out, | 438 | int drm_mode_convert_umode(struct drm_display_mode *out, |
439 | const struct drm_mode_modeinfo *in); | 439 | const struct drm_mode_modeinfo *in); |
440 | void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode); | 440 | void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode); |
@@ -457,6 +457,7 @@ void drm_display_mode_from_videomode(const struct videomode *vm, | |||
457 | struct drm_display_mode *dmode); | 457 | struct drm_display_mode *dmode); |
458 | void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, | 458 | void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, |
459 | struct videomode *vm); | 459 | struct videomode *vm); |
460 | void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags); | ||
460 | int of_get_drm_display_mode(struct device_node *np, | 461 | int of_get_drm_display_mode(struct device_node *np, |
461 | struct drm_display_mode *dmode, | 462 | struct drm_display_mode *dmode, |
462 | int index); | 463 | int index); |