aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/of_display_timing.c33
-rw-r--r--include/video/of_display_timing.h2
2 files changed, 32 insertions, 3 deletions
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 0e8102344b2e..9c0f17b2e6fb 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -53,10 +53,10 @@ static int parse_timing_property(struct device_node *np, const char *name,
53} 53}
54 54
55/** 55/**
56 * of_get_display_timing - parse display_timing entry from device_node 56 * of_parse_display_timing - parse display_timing entry from device_node
57 * @np: device_node with the properties 57 * @np: device_node with the properties
58 **/ 58 **/
59static int of_get_display_timing(struct device_node *np, 59static int of_parse_display_timing(struct device_node *np,
60 struct display_timing *dt) 60 struct display_timing *dt)
61{ 61{
62 u32 val = 0; 62 u32 val = 0;
@@ -103,6 +103,33 @@ static int of_get_display_timing(struct device_node *np,
103} 103}
104 104
105/** 105/**
106 * of_get_display_timing - parse a display_timing entry
107 * @np: device_node with the timing subnode
108 * @name: name of the timing node
109 * @dt: display_timing struct to fill
110 **/
111int of_get_display_timing(struct device_node *np, const char *name,
112 struct display_timing *dt)
113{
114 struct device_node *timing_np;
115
116 if (!np) {
117 pr_err("%s: no devicenode given\n", of_node_full_name(np));
118 return -EINVAL;
119 }
120
121 timing_np = of_find_node_by_name(np, name);
122 if (!timing_np) {
123 pr_err("%s: could not find node '%s'\n",
124 of_node_full_name(np), name);
125 return -ENOENT;
126 }
127
128 return of_parse_display_timing(timing_np, dt);
129}
130EXPORT_SYMBOL_GPL(of_get_display_timing);
131
132/**
106 * of_get_display_timings - parse all display_timing entries from a device_node 133 * of_get_display_timings - parse all display_timing entries from a device_node
107 * @np: device_node with the subnodes 134 * @np: device_node with the subnodes
108 **/ 135 **/
@@ -177,7 +204,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
177 goto timingfail; 204 goto timingfail;
178 } 205 }
179 206
180 r = of_get_display_timing(entry, dt); 207 r = of_parse_display_timing(entry, dt);
181 if (r) { 208 if (r) {
182 /* 209 /*
183 * to not encourage wrong devicetrees, fail in case of 210 * to not encourage wrong devicetrees, fail in case of
diff --git a/include/video/of_display_timing.h b/include/video/of_display_timing.h
index 8016eb727cf3..6562ad965889 100644
--- a/include/video/of_display_timing.h
+++ b/include/video/of_display_timing.h
@@ -14,6 +14,8 @@ struct display_timings;
14 14
15#define OF_USE_NATIVE_MODE -1 15#define OF_USE_NATIVE_MODE -1
16 16
17int of_get_display_timing(struct device_node *np, const char *name,
18 struct display_timing *dt);
17struct display_timings *of_get_display_timings(struct device_node *np); 19struct display_timings *of_get_display_timings(struct device_node *np);
18int of_display_timings_exist(struct device_node *np); 20int of_display_timings_exist(struct device_node *np);
19 21