summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorNikhil M Jain <n-jain1@ti.com>2023-01-31 15:35:14 +0530
committerAnatolij Gustschin <agust@denx.de>2023-02-04 18:13:21 +0100
commit0347cc7732703bdf94bba5ce8a157c2174f01067 (patch)
treec7affe83505501a069be4109748a980f0a206367 /include/dm
parentf4cf8710a16c0fe1c98e8265b50ac2826869becf (diff)
downloadu-boot-0347cc7732703bdf94bba5ce8a157c2174f01067.tar.gz
u-boot-0347cc7732703bdf94bba5ce8a157c2174f01067.tar.bz2
u-boot-0347cc7732703bdf94bba5ce8a157c2174f01067.zip
drivers: core: ofnode: Add panel timing decode.
ofnode_decode_display_timing supports reading timing parameters from subnode of display-timings node, for displays supporting multiple resolution, in case if a display supports single resolution, it fails reading directly from display-timings node, to support it ofnode_decode_panel_timing is added. Signed-off-by: Nikhil M Jain <n-jain1@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/ofnode.h12
-rw-r--r--include/dm/read.h20
2 files changed, 32 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index fa9865602d..3f6b0843c5 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -975,6 +975,18 @@ int ofnode_decode_display_timing(ofnode node, int index,
struct display_timing *config);
/**
+ * ofnode_decode_panel_timing() - decode display timings
+ *
+ * Decode panel timings from the supplied 'panel-timings' node.
+ *
+ * @node: 'display-timing' node containing the timing subnodes
+ * @config: Place to put timings
+ * Return: 0 if OK, -FDT_ERR_NOTFOUND if not found
+ */
+int ofnode_decode_panel_timing(ofnode node,
+ struct display_timing *config);
+
+/**
* ofnode_get_property() - get a pointer to the value of a node property
*
* @node: node to read
diff --git a/include/dm/read.h b/include/dm/read.h
index cc4f16196f..56ac076c9f 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -785,6 +785,20 @@ int dev_decode_display_timing(const struct udevice *dev, int index,
struct display_timing *config);
/**
+ * dev_decode_panel_timing() - decode panel timings
+ *
+ * Decode display timings from the supplied 'panel-timings' node.
+ *
+ * @dev: device to read DT display timings from. The node linked to the device
+ * contains a child node called 'display-timings' which in turn contains
+ * one or more display timing nodes.
+ * @config: place to put timings
+ * Return: 0 if OK, -FDT_ERR_NOTFOUND if not found
+ */
+int dev_decode_panel_timing(const struct udevice *dev,
+ struct display_timing *config);
+
+/**
* dev_get_phy_node() - Get PHY node for a MAC (if not fixed-link)
*
* This function parses PHY handle from the Ethernet controller's ofnode
@@ -1183,6 +1197,12 @@ static inline int dev_decode_display_timing(const struct udevice *dev,
return ofnode_decode_display_timing(dev_ofnode(dev), index, config);
}
+static inline int dev_decode_panel_timing(const struct udevice *dev,
+ struct display_timing *config)
+{
+ return ofnode_decode_panel_timing(dev_ofnode(dev), config);
+}
+
static inline ofnode dev_get_phy_node(const struct udevice *dev)
{
return ofnode_get_phy_node(dev_ofnode(dev));