829e9d90423d4e097073801fc3dc613a4d03ee39
[openwrt/staging/pepe2k.git] /
1 From 937472c7d58945412f75ad7a4f9d44c83be42ab4 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 30 Nov 2020 16:57:01 +0000
4 Subject: [PATCH 0946/1085] drm/panel: ilitek-ili9881c: Allow configuration of
5 the number of lanes
6
7 Not all panels use all 4 data lanes, so allow configuration based
8 on the compatible string.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 8 +++++++-
13 1 file changed, 7 insertions(+), 1 deletion(-)
14
15 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
16 +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c
17 @@ -45,6 +45,7 @@ struct ili9881c_desc {
18 const size_t init_length;
19 const struct drm_display_mode *mode;
20 const unsigned long mode_flags;
21 + unsigned int lanes;
22 };
23
24 struct ili9881c {
25 @@ -1565,7 +1566,7 @@ static int ili9881c_dsi_probe(struct mip
26
27 dsi->mode_flags = ctx->desc->mode_flags;
28 dsi->format = MIPI_DSI_FMT_RGB888;
29 - dsi->lanes = 4;
30 + dsi->lanes = ctx->desc->lanes;
31
32 ret = mipi_dsi_attach(dsi);
33 if (ret)
34 @@ -1587,6 +1588,7 @@ static const struct ili9881c_desc lhr050
35 .init_length = ARRAY_SIZE(lhr050h41_init),
36 .mode = &lhr050h41_default_mode,
37 .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
38 + .lanes = 4,
39 };
40
41 static const struct ili9881c_desc k101_im2byl02_desc = {
42 @@ -1594,6 +1596,7 @@ static const struct ili9881c_desc k101_i
43 .init_length = ARRAY_SIZE(k101_im2byl02_init),
44 .mode = &k101_im2byl02_default_mode,
45 .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE,
46 + .lanes = 4,
47 };
48
49 static const struct ili9881c_desc nwe080_desc = {
50 @@ -1601,6 +1604,7 @@ static const struct ili9881c_desc nwe080
51 .init_length = ARRAY_SIZE(nwe080_init),
52 .mode = &nwe080_default_mode,
53 .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_VIDEO,
54 + .lanes = 4,
55 };
56
57 static const struct ili9881c_desc tl050hdv35_desc = {
58 @@ -1617,6 +1621,7 @@ static const struct ili9881c_desc w55294
59 .mode = &w552946aba_default_mode,
60 .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
61 MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET,
62 + .lanes = 4,
63 };
64
65 static const struct ili9881c_desc cfaf7201280a0_050tx_desc = {
66 @@ -1624,6 +1629,7 @@ static const struct ili9881c_desc cfaf72
67 .init_length = ARRAY_SIZE(cfaf7201280a0_050tx_init),
68 .mode = &cfaf7201280a0_050tx_default_mode,
69 .mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_VIDEO,
70 + .lanes = 4,
71 };
72
73 static const struct of_device_id ili9881c_of_match[] = {