Lines Matching +full:de +full:- +full:active

1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (c) 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>, Pengutronix
7 * based on of_videomode.c by Sascha Hauer <s.hauer@pengutronix.de>
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
64 ret |= parse_timing_property(np, "hback-porch", &dt->hback_porch); in of_parse_display_timing()
65 ret |= parse_timing_property(np, "hfront-porch", &dt->hfront_porch); in of_parse_display_timing()
66 ret |= parse_timing_property(np, "hactive", &dt->hactive); in of_parse_display_timing()
67 ret |= parse_timing_property(np, "hsync-len", &dt->hsync_len); in of_parse_display_timing()
68 ret |= parse_timing_property(np, "vback-porch", &dt->vback_porch); in of_parse_display_timing()
69 ret |= parse_timing_property(np, "vfront-porch", &dt->vfront_porch); in of_parse_display_timing()
70 ret |= parse_timing_property(np, "vactive", &dt->vactive); in of_parse_display_timing()
71 ret |= parse_timing_property(np, "vsync-len", &dt->vsync_len); in of_parse_display_timing()
72 ret |= parse_timing_property(np, "clock-frequency", &dt->pixelclock); in of_parse_display_timing()
74 dt->flags = 0; in of_parse_display_timing()
75 if (!of_property_read_u32(np, "vsync-active", &val)) in of_parse_display_timing()
76 dt->flags |= val ? DISPLAY_FLAGS_VSYNC_HIGH : in of_parse_display_timing()
78 if (!of_property_read_u32(np, "hsync-active", &val)) in of_parse_display_timing()
79 dt->flags |= val ? DISPLAY_FLAGS_HSYNC_HIGH : in of_parse_display_timing()
81 if (!of_property_read_u32(np, "de-active", &val)) in of_parse_display_timing()
82 dt->flags |= val ? DISPLAY_FLAGS_DE_HIGH : in of_parse_display_timing()
84 if (!of_property_read_u32(np, "pixelclk-active", &val)) in of_parse_display_timing()
85 dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE : in of_parse_display_timing()
88 if (!of_property_read_u32(np, "syncclk-active", &val)) in of_parse_display_timing()
89 dt->flags |= val ? DISPLAY_FLAGS_SYNC_POSEDGE : in of_parse_display_timing()
91 else if (dt->flags & (DISPLAY_FLAGS_PIXDATA_POSEDGE | in of_parse_display_timing()
93 dt->flags |= dt->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE ? in of_parse_display_timing()
98 dt->flags |= DISPLAY_FLAGS_INTERLACED; in of_parse_display_timing()
100 dt->flags |= DISPLAY_FLAGS_DOUBLESCAN; in of_parse_display_timing()
102 dt->flags |= DISPLAY_FLAGS_DOUBLECLK; in of_parse_display_timing()
106 return -EINVAL; in of_parse_display_timing()
113 * of_get_display_timing - parse a display_timing entry
125 return -EINVAL; in of_get_display_timing()
129 return -ENOENT; in of_get_display_timing()
140 * of_get_display_timings - parse all display_timing entries from a device_node
153 timings_np = of_get_child_by_name(np, "display-timings"); in of_get_display_timings()
155 pr_err("%pOF: could not find display-timings node\n", np); in of_get_display_timings()
165 entry = of_parse_phandle(timings_np, "native-mode", 0); in of_get_display_timings()
179 disp->num_timings = of_get_child_count(timings_np); in of_get_display_timings()
180 if (disp->num_timings == 0) { in of_get_display_timings()
186 disp->timings = kcalloc(disp->num_timings, in of_get_display_timings()
189 if (!disp->timings) { in of_get_display_timings()
194 disp->num_timings = 0; in of_get_display_timings()
195 disp->native_mode = 0; in of_get_display_timings()
215 np, disp->num_timings + 1); in of_get_display_timings()
221 disp->native_mode = disp->num_timings; in of_get_display_timings()
223 disp->timings[disp->num_timings] = dt; in of_get_display_timings()
224 disp->num_timings++; in of_get_display_timings()
234 np, disp->num_timings, in of_get_display_timings()
235 disp->native_mode + 1); in of_get_display_timings()