2 * generic display timing functions
4 * Copyright (c) 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>, Pengutronix
6 * This file is released under the GPLv2
9 #include <linux/errno.h>
10 #include <linux/export.h>
11 #include <video/display_timing.h>
12 #include <video/videomode.h>
14 int videomode_from_timing(const struct display_timings *disp,
15 struct videomode *vm, unsigned int index)
17 struct display_timing *dt;
19 dt = display_timings_get(disp, index);
23 vm->pixelclock = display_timing_get_value(&dt->pixelclock, TE_TYP);
24 vm->hactive = display_timing_get_value(&dt->hactive, TE_TYP);
25 vm->hfront_porch = display_timing_get_value(&dt->hfront_porch, TE_TYP);
26 vm->hback_porch = display_timing_get_value(&dt->hback_porch, TE_TYP);
27 vm->hsync_len = display_timing_get_value(&dt->hsync_len, TE_TYP);
29 vm->vactive = display_timing_get_value(&dt->vactive, TE_TYP);
30 vm->vfront_porch = display_timing_get_value(&dt->vfront_porch, TE_TYP);
31 vm->vback_porch = display_timing_get_value(&dt->vback_porch, TE_TYP);
32 vm->vsync_len = display_timing_get_value(&dt->vsync_len, TE_TYP);
34 vm->dmt_flags = dt->dmt_flags;
35 vm->data_flags = dt->data_flags;
39 EXPORT_SYMBOL_GPL(videomode_from_timing);