21aa2168ad9d8b43beda1549627dc7d404615507
[openwrt/staging/linusw.git] /
1 From 02ce5b14d69bf513f3c6cc93c005cae07db985a0 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Fri, 26 Mar 2021 17:06:36 +0000
4 Subject: [PATCH] drm/panel-simple: Add a timing for the Raspberry Pi
5 7" panel
6
7 The Raspberry Pi 7" 800x480 panel uses a Toshiba TC358762 DSI
8 to DPI bridge chip, so there is a requirement for the timings
9 to be specified for the end panel. Add such a definition.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 drivers/gpu/drm/panel/panel-simple.c | 28 ++++++++++++++++++++++++++++
14 1 file changed, 28 insertions(+)
15
16 --- a/drivers/gpu/drm/panel/panel-simple.c
17 +++ b/drivers/gpu/drm/panel/panel-simple.c
18 @@ -3761,6 +3761,31 @@ static const struct panel_desc qishenglo
19 .connector_type = DRM_MODE_CONNECTOR_DPI,
20 };
21
22 +static const struct drm_display_mode raspberrypi_7inch_mode = {
23 + .clock = 25979400 / 1000,
24 + .hdisplay = 800,
25 + .hsync_start = 800 + 2,
26 + .hsync_end = 800 + 2 + 2,
27 + .htotal = 800 + 2 + 2 + 46,
28 + .vdisplay = 480,
29 + .vsync_start = 480 + 7,
30 + .vsync_end = 480 + 7 + 2,
31 + .vtotal = 480 + 7 + 2 + 21,
32 + .flags = DRM_MODE_FLAG_NVSYNC | DRM_MODE_FLAG_NHSYNC,
33 +};
34 +
35 +static const struct panel_desc raspberrypi_7inch = {
36 + .modes = &raspberrypi_7inch_mode,
37 + .num_modes = 1,
38 + .bpc = 8,
39 + .size = {
40 + .width = 154,
41 + .height = 86,
42 + },
43 + .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
44 + .connector_type = DRM_MODE_CONNECTOR_DSI,
45 +};
46 +
47 static const struct display_timing rocktech_rk070er9427_timing = {
48 .pixelclock = { 26400000, 33300000, 46800000 },
49 .hactive = { 800, 800, 800 },
50 @@ -4841,6 +4866,9 @@ static const struct of_device_id platfor
51 .compatible = "qishenglong,gopher2b-lcd",
52 .data = &qishenglong_gopher2b_lcd,
53 }, {
54 + .compatible = "raspberrypi,7inch-dsi",
55 + .data = &raspberrypi_7inch,
56 + }, {
57 .compatible = "rocktech,rk070er9427",
58 .data = &rocktech_rk070er9427,
59 }, {