Skip to content

Commit 694f050

Browse files
committed
videomode: remove timing_entry_index
Display timing's fields have minimum, typical and maximum values. These can be accessed by using timing_entry_index enum, and display_timing_get_value() function. There's no real need for this extra complexity. The values can be accessed more easily by just using the min/typ/max fields. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
1 parent 32ed6ef commit 694f050

2 files changed

Lines changed: 9 additions & 34 deletions

File tree

‎drivers/video/videomode.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ int videomode_from_timing(const struct display_timings *disp,
2020
if (!dt)
2121
return -EINVAL;
2222

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);
23+
vm->pixelclock = dt->pixelclock.typ;
24+
vm->hactive = dt->hactive.typ;
25+
vm->hfront_porch = dt->hfront_porch.typ;
26+
vm->hback_porch = dt->hback_porch.typ;
27+
vm->hsync_len = dt->hsync_len.typ;
2828

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);
29+
vm->vactive = dt->vactive.typ;
30+
vm->vfront_porch = dt->vfront_porch.typ;
31+
vm->vback_porch = dt->vback_porch.typ;
32+
vm->vsync_len = dt->vsync_len.typ;
3333

3434
vm->flags = dt->flags;
3535

‎include/video/display_timing.h‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@ struct timing_entry {
3939
u32 max;
4040
};
4141

42-
enum timing_entry_index {
43-
TE_MIN = 0,
44-
TE_TYP = 1,
45-
TE_MAX = 2,
46-
};
47-
4842
/*
4943
* Single "mode" entry. This describes one set of signal timings a display can
5044
* have in one setting. This struct can later be converted to struct videomode
@@ -91,25 +85,6 @@ struct display_timings {
9185
struct display_timing **timings;
9286
};
9387

94-
/* get value specified by index from struct timing_entry */
95-
static inline u32 display_timing_get_value(const struct timing_entry *te,
96-
enum timing_entry_index index)
97-
{
98-
switch (index) {
99-
case TE_MIN:
100-
return te->min;
101-
break;
102-
case TE_TYP:
103-
return te->typ;
104-
break;
105-
case TE_MAX:
106-
return te->max;
107-
break;
108-
default:
109-
return te->typ;
110-
}
111-
}
112-
11388
/* get one entry from struct display_timings */
11489
static inline struct display_timing *display_timings_get(const struct
11590
display_timings *disp,

0 commit comments

Comments
 (0)