diff options
author | Dario Binacchi <dariobin@libero.it> | 2020-12-30 00:16:26 +0100 |
---|---|---|
committer | Lokesh Vutla <lokeshvutla@ti.com> | 2021-01-12 10:58:05 +0530 |
commit | 15daa4860bf3c49f53ae76812e0033e4d5faa0a2 (patch) | |
tree | c632e5e8fbc12a732c91acc95d103dd1367b1b0d /include/dm | |
parent | 0f4effb05b275f36c490673313317cfe897c9b79 (diff) | |
download | u-boot-15daa4860bf3c49f53ae76812e0033e4d5faa0a2.tar.gz u-boot-15daa4860bf3c49f53ae76812e0033e4d5faa0a2.tar.xz u-boot-15daa4860bf3c49f53ae76812e0033e4d5faa0a2.zip |
dm: core: add a function to decode display timings
The patch adds a function to get display timings from the device tree
node attached to the device.
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/read.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/dm/read.h b/include/dm/read.h index fc987f7759..c875e11a13 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -678,6 +678,23 @@ int dev_get_child_count(const struct udevice *dev); */ int dev_read_pci_bus_range(const struct udevice *dev, struct resource *res); +/** + * dev_decode_display_timing() - decode display timings + * + * Decode display timings from the supplied 'display-timings' node. + * See doc/device-tree-bindings/video/display-timing.txt for binding + * information. + * + * @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. + * @index: index number to read (0=first timing subnode) + * @config: place to put timings + * @return 0 if OK, -FDT_ERR_NOTFOUND if not found + */ +int dev_decode_display_timing(const struct udevice *dev, int index, + struct display_timing *config); + #else /* CONFIG_DM_DEV_READ_INLINE is enabled */ static inline int dev_read_u32(const struct udevice *dev, @@ -1000,6 +1017,13 @@ static inline int dev_get_child_count(const struct udevice *dev) return ofnode_get_child_count(dev_ofnode(dev)); } +static inline int dev_decode_display_timing(const struct udevice *dev, + int index, + struct display_timing *config) +{ + return ofnode_decode_display_timing(dev_ofnode(dev), index, config); +} + #endif /* CONFIG_DM_DEV_READ_INLINE */ /** |