]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: panel: get timings from panel
authorYannick Fertré <yannick.fertre@st.com>
Fri, 13 Jul 2018 12:11:09 +0000 (14:11 +0200)
committerAnatolij Gustschin <agust@denx.de>
Wed, 1 Aug 2018 16:03:58 +0000 (18:03 +0200)
Get timings from panel instead of read device tree.

Signed-off-by: Yannick Fertré <yannick.fertre@st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/video/panel-uclass.c
include/panel.h

index 2841bb3f3aa1adfe2fe94b10969bfe55b3b696de..aec44a8bf7a2d333e6fe5d56b4953d046e986a58 100644 (file)
@@ -18,6 +18,17 @@ int panel_enable_backlight(struct udevice *dev)
        return ops->enable_backlight(dev);
 }
 
+int panel_get_display_timing(struct udevice *dev,
+                            struct display_timing *timings)
+{
+       struct panel_ops *ops = panel_get_ops(dev);
+
+       if (!ops->get_display_timing)
+               return -ENOSYS;
+
+       return ops->get_display_timing(dev, timings);
+}
+
 UCLASS_DRIVER(panel) = {
        .id             = UCLASS_PANEL,
        .name           = "panel",
index 46dca48bf75eb3d8ceaa5b53197bc1c6a0e35926..6237d32657d9d1abf37f1e38052ffd6fad222f91 100644 (file)
@@ -15,6 +15,15 @@ struct panel_ops {
         * @return 0 if OK, -ve on error
         */
        int (*enable_backlight)(struct udevice *dev);
+       /**
+        * get_timings() - Get display timings from panel.
+        *
+        * @dev:        Panel device containing the display timings
+        * @tim:        Place to put timings
+        * @return 0 if OK, -ve on error
+        */
+       int (*get_display_timing)(struct udevice *dev,
+                                 struct display_timing *timing);
 };
 
 #define panel_get_ops(dev)     ((struct panel_ops *)(dev)->driver->ops)
@@ -27,4 +36,13 @@ struct panel_ops {
  */
 int panel_enable_backlight(struct udevice *dev);
 
+/**
+ * panel_get_display_timing() - Get display timings from panel.
+ *
+ * @dev:       Panel device containing the display timings
+ * @return 0 if OK, -ve on error
+ */
+int panel_get_display_timing(struct udevice *dev,
+                            struct display_timing *timing);
+
 #endif