bcm27xx: 6.1: add kernel patches
[openwrt/staging/nbd.git] / target / linux / bcm27xx / patches-6.1 / 950-0742-panel-sitronix-st7701-Fix-panel-prepare-over-SPI.patch
1 From 162aedd492c420bbfe3d44dae1770c60a6c367bb Mon Sep 17 00:00:00 2001
2 From: Jack Andersen <jackoalan@gmail.com>
3 Date: Fri, 26 May 2023 12:19:19 -0700
4 Subject: [PATCH] panel-sitronix-st7701: Fix panel prepare over SPI
5
6 A DSI write is issued in st7701_prepare even when the probed panel
7 runs on SPI. In practice, this results in a panic with the
8 vc4-kms-dpi-hyperpixel2r overlay active.
9
10 Perform the equivalent write over SPI in this case.
11
12 Signed-off-by: Jack Andersen <jackoalan@gmail.com>
13 ---
14 drivers/gpu/drm/panel/panel-sitronix-st7701.c | 12 ++++++++++--
15 1 file changed, 10 insertions(+), 2 deletions(-)
16
17 --- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c
18 +++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c
19 @@ -571,8 +571,16 @@ static int st7701_prepare(struct drm_pan
20 st7701->desc->gip_sequence(st7701);
21
22 /* Disable Command2 */
23 - ST7701_DSI(st7701, DSI_CMD2BKX_SEL,
24 - 0x77, 0x01, 0x00, 0x00, DSI_CMD2BKX_SEL_NONE);
25 + switch (st7701->desc->interface) {
26 + case ST7701_CTRL_DSI:
27 + ST7701_DSI(st7701, DSI_CMD2BKX_SEL,
28 + 0x77, 0x01, 0x00, 0x00, DSI_CMD2BKX_SEL_NONE);
29 + break;
30 + case ST7701_CTRL_SPI:
31 + ST7701_SPI(st7701, DSI_CMD2BKX_SEL,
32 + 0x177, 0x101, 0x100, 0x100, SPI_CMD2BKX_SEL_NONE);
33 + break;
34 + }
35
36 return 0;
37 }