Lines Matching +full:display +full:- +full:timings

1 // SPDX-License-Identifier: GPL-2.0-only
3 * OF helpers for parsing display timings
16 * parse_timing_property - parse timing_entry from device_node
34 return -EINVAL; in parse_timing_property()
39 ret = of_property_read_u32(np, name, &result->typ); in parse_timing_property()
40 result->min = result->typ; in parse_timing_property()
41 result->max = result->typ; in parse_timing_property()
43 ret = of_property_read_u32_array(np, name, &result->min, cells); in parse_timing_property()
46 return -EINVAL; in parse_timing_property()
53 * of_parse_display_timing - parse display_timing entry from device_node
65 ret |= parse_timing_property(np, "hback-porch", &dt->hback_porch); in of_parse_display_timing()
66 ret |= parse_timing_property(np, "hfront-porch", &dt->hfront_porch); in of_parse_display_timing()
67 ret |= parse_timing_property(np, "hactive", &dt->hactive); in of_parse_display_timing()
68 ret |= parse_timing_property(np, "hsync-len", &dt->hsync_len); in of_parse_display_timing()
69 ret |= parse_timing_property(np, "vback-porch", &dt->vback_porch); in of_parse_display_timing()
70 ret |= parse_timing_property(np, "vfront-porch", &dt->vfront_porch); in of_parse_display_timing()
71 ret |= parse_timing_property(np, "vactive", &dt->vactive); in of_parse_display_timing()
72 ret |= parse_timing_property(np, "vsync-len", &dt->vsync_len); in of_parse_display_timing()
73 ret |= parse_timing_property(np, "clock-frequency", &dt->pixelclock); in of_parse_display_timing()
75 dt->flags = 0; in of_parse_display_timing()
76 if (!of_property_read_u32(np, "vsync-active", &val)) in of_parse_display_timing()
77 dt->flags |= val ? DISPLAY_FLAGS_VSYNC_HIGH : in of_parse_display_timing()
79 if (!of_property_read_u32(np, "hsync-active", &val)) in of_parse_display_timing()
80 dt->flags |= val ? DISPLAY_FLAGS_HSYNC_HIGH : in of_parse_display_timing()
82 if (!of_property_read_u32(np, "de-active", &val)) in of_parse_display_timing()
83 dt->flags |= val ? DISPLAY_FLAGS_DE_HIGH : in of_parse_display_timing()
85 if (!of_property_read_u32(np, "pixelclk-active", &val)) in of_parse_display_timing()
86 dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : in of_parse_display_timing()
89 if (!of_property_read_u32(np, "syncclk-active", &val)) in of_parse_display_timing()
90 dt->flags |= val ? DISPLAY_FLAGS_SYNC_POSEDGE : in of_parse_display_timing()
92 else if (dt->flags & (DISPLAY_FLAGS_PIXDATA_POSEDGE | in of_parse_display_timing()
94 dt->flags |= dt->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ? in of_parse_display_timing()
99 dt->flags |= DISPLAY_FLAGS_INTERLACED; in of_parse_display_timing()
101 dt->flags |= DISPLAY_FLAGS_DOUBLESCAN; in of_parse_display_timing()
103 dt->flags |= DISPLAY_FLAGS_DOUBLECLK; in of_parse_display_timing()
107 return -EINVAL; in of_parse_display_timing()
114 * of_get_display_timing - parse a display_timing entry
126 return -EINVAL; in of_get_display_timing()
130 return -ENOENT; in of_get_display_timing()
141 * of_get_display_timings - parse all display_timing entries from a device_node
154 timings_np = of_get_child_by_name(np, "display-timings"); in of_get_display_timings()
156 pr_err("%pOF: could not find display-timings node\n", np); in of_get_display_timings()
166 entry = of_parse_phandle(timings_np, "native-mode", 0); in of_get_display_timings()
180 disp->num_timings = of_get_child_count(timings_np); in of_get_display_timings()
181 if (disp->num_timings == 0) { in of_get_display_timings()
183 pr_err("%pOF: no timings specified\n", np); in of_get_display_timings()
187 disp->timings = kcalloc(disp->num_timings, in of_get_display_timings()
190 if (!disp->timings) { in of_get_display_timings()
191 pr_err("%pOF: could not allocate timings array\n", np); in of_get_display_timings()
195 disp->num_timings = 0; in of_get_display_timings()
196 disp->native_mode = 0; in of_get_display_timings()
216 np, disp->num_timings + 1); in of_get_display_timings()
222 disp->native_mode = disp->num_timings; in of_get_display_timings()
224 disp->timings[disp->num_timings] = dt; in of_get_display_timings()
225 disp->num_timings++; in of_get_display_timings()
234 pr_debug("%pOF: got %d timings. Using timing #%d as default\n", in of_get_display_timings()
235 np, disp->num_timings, in of_get_display_timings()
236 disp->native_mode + 1); in of_get_display_timings()