diff options
-rw-r--r-- | drivers/video/of_display_timing.c | 22 | ||||
-rw-r--r-- | include/fb.h | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index 6fe1e1b08b..6082d45493 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c @@ -99,6 +99,28 @@ static int of_parse_display_timing(const struct device_node *np, } /** + * of_get_display_timing - parse a display_timing entry + * @np: device_node with the timing subnode + * @name: name of the timing node + * @mode: fb_videomode struct to fill + **/ +int of_get_display_timing(const struct device_node *np, const char *name, + struct fb_videomode *mode) +{ + struct device_node *timing_np; + + if (!np) + return -EINVAL; + + timing_np = of_get_child_by_name(np, name); + if (!timing_np) + return -ENOENT; + + return of_parse_display_timing(timing_np, mode); +} +EXPORT_SYMBOL_GPL(of_get_display_timing); + +/** * of_get_display_timings - parse all display_timing entries from a device_node * @np: device_node with the subnodes **/ diff --git a/include/fb.h b/include/fb.h index bf5f688342..15bb74b995 100644 --- a/include/fb.h +++ b/include/fb.h @@ -147,6 +147,8 @@ struct fb_info { int shadowfb; }; +int of_get_display_timing(const struct device_node *np, const char *name, + struct fb_videomode *mode); struct display_timings *of_get_display_timings(struct device_node *np); void display_timings_release(struct display_timings *); |