brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0337-drm-panel-simple-Add-the-7-DPI-panel-from-Adafruit.patch
1 From 59c699fe982aa0df961465654c4d87d109b127e6 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Thu, 24 Mar 2016 17:23:48 -0700
4 Subject: [PATCH] drm/panel: simple: Add the 7" DPI panel from Adafruit
5
6 This is a basic TFT panel with a 40-pin FPC connector on it. The
7 specification doesn't define timings, but the Adafruit instructions
8 were setting up 800x480 CVT.
9
10 v2: Add .bus_format and vsync/hsync flags.
11
12 Signed-off-by: Eric Anholt <eric@anholt.net>
13 Acked-by: Rob Herring <robh@kernel.org>
14 [treding@nvidia.com: keep entries properly sorted]
15 Signed-off-by: Thierry Reding <treding@nvidia.com>
16
17 (cherry picked from commit 8070fdbd024727c752f815b18e5339c681a01bbe)
18 ---
19 .../bindings/display/panel/ontat,yx700wv03.txt | 7 ++++
20 drivers/gpu/drm/panel/panel-simple.c | 37 ++++++++++++++++++++++
21 2 files changed, 44 insertions(+)
22 create mode 100644 Documentation/devicetree/bindings/display/panel/ontat,yx700wv03.txt
23
24 --- /dev/null
25 +++ b/Documentation/devicetree/bindings/display/panel/ontat,yx700wv03.txt
26 @@ -0,0 +1,7 @@
27 +On Tat Industrial Company 7" DPI TFT panel.
28 +
29 +Required properties:
30 +- compatible: should be "ontat,yx700wv03"
31 +
32 +This binding is compatible with the simple-panel binding, which is specified
33 +in simple-panel.txt in this directory.
34 --- a/drivers/gpu/drm/panel/panel-simple.c
35 +++ b/drivers/gpu/drm/panel/panel-simple.c
36 @@ -1003,6 +1003,40 @@ static const struct panel_desc okaya_rs8
37 .bus_format = MEDIA_BUS_FMT_RGB666_1X18,
38 };
39
40 +/*
41 + * 800x480 CVT. The panel appears to be quite accepting, at least as far as
42 + * pixel clocks, but this is the timing that was being used in the Adafruit
43 + * installation instructions.
44 + */
45 +static const struct drm_display_mode ontat_yx700wv03_mode = {
46 + .clock = 29500,
47 + .hdisplay = 800,
48 + .hsync_start = 824,
49 + .hsync_end = 896,
50 + .htotal = 992,
51 + .vdisplay = 480,
52 + .vsync_start = 483,
53 + .vsync_end = 493,
54 + .vtotal = 500,
55 + .vrefresh = 60,
56 + .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
57 +};
58 +
59 +/*
60 + * Specification at:
61 + * https://www.adafruit.com/images/product-files/2406/c3163.pdf
62 + */
63 +static const struct panel_desc ontat_yx700wv03 = {
64 + .modes = &ontat_yx700wv03_mode,
65 + .num_modes = 1,
66 + .bpc = 8,
67 + .size = {
68 + .width = 154,
69 + .height = 83,
70 + },
71 + .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
72 +};
73 +
74 static const struct drm_display_mode ortustech_com43h4m85ulc_mode = {
75 .clock = 25000,
76 .hdisplay = 480,
77 @@ -1179,6 +1213,9 @@ static const struct of_device_id platfor
78 .compatible = "okaya,rs800480t-7x0gp",
79 .data = &okaya_rs800480t_7x0gp,
80 }, {
81 + .compatible = "ontat,yx700wv03",
82 + .data = &ontat_yx700wv03,
83 + }, {
84 .compatible = "ortustech,com43h4m85ulc",
85 .data = &ortustech_com43h4m85ulc,
86 }, {