Skip to content

Commit

Permalink
linux: fix building on RK3326
Browse files Browse the repository at this point in the history
  • Loading branch information
spycat88 committed May 12, 2024
1 parent 5e0f58a commit 7d0eab3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion packages/kernel/linux/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi
case ${DEVICE} in
RK3326)
PKG_VERSION="6.8.9"
PKG_URL="https://git.kernel.org/torvalds/t/linux-${PKG_VERSION}.tar.gz"
PKG_URL="https://www.kernel.org/pub/linux/kernel/v${PKG_VERSION/.*/}.x/${PKG_NAME}-${PKG_VERSION}.tar.xz"
PKG_PATCH_DIRS+=" mainline"
;;
RK3588)
Expand Down
82 changes: 41 additions & 41 deletions projects/Rockchip/patches/linux/RK3326/001-panel-updates.patch
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ index 94d89ffd596b..561a77abd2c9 100644

static const struct of_device_id newvision_nv3051d_of_match[] = {
diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
index a3e142f156d5..04cc2aef01f1 100644
index b55bafd1a8be..c65d9e459f01 100644
--- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
+++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
@@ -13,8 +13,9 @@
Expand All @@ -171,7 +171,7 @@ index a3e142f156d5..04cc2aef01f1 100644
#define ST7703_CMD_SETGAMMA 0xE0
#define ST7703_CMD_SETEQ 0xE3
#define ST7703_CMD_SETGIP1 0xE9
@@ -78,6 +80,14 @@ static inline struct st7703 *panel_to_st7703(struct drm_panel *panel)
@@ -77,6 +79,14 @@ static inline struct st7703 *panel_to_st7703(struct drm_panel *panel)
return container_of(panel, struct st7703, panel);
}

Expand All @@ -186,7 +186,7 @@ index a3e142f156d5..04cc2aef01f1 100644
static int jh057n_init_sequence(struct st7703 *ctx)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
@@ -87,27 +97,27 @@ static int jh057n_init_sequence(struct st7703 *ctx)
@@ -86,27 +96,27 @@ static int jh057n_init_sequence(struct st7703 *ctx)
* resemble the ST7703 but the number of parameters often don't match
* so it's likely a clone.
*/
Expand Down Expand Up @@ -226,7 +226,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x82, 0x10, 0x06, 0x05, 0x9E, 0x0A, 0xA5, 0x12,
0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00,
@@ -116,7 +126,7 @@ static int jh057n_init_sequence(struct st7703 *ctx)
@@ -115,7 +125,7 @@ static int jh057n_init_sequence(struct st7703 *ctx)
0x64, 0x20, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
0x02, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
Expand All @@ -235,7 +235,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13,
@@ -125,7 +135,7 @@ static int jh057n_init_sequence(struct st7703 *ctx)
@@ -124,7 +134,7 @@ static int jh057n_init_sequence(struct st7703 *ctx)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0A,
0xA5, 0x00, 0x00, 0x00, 0x00);
Expand All @@ -244,7 +244,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41, 0x37,
0x07, 0x0B, 0x0D, 0x10, 0x11, 0x0F, 0x10, 0x11,
0x18, 0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41,
@@ -160,6 +170,15 @@ static const struct st7703_panel_desc jh057n00900_panel_desc = {
@@ -159,6 +169,15 @@ static const struct st7703_panel_desc jh057n00900_panel_desc = {
.init_sequence = jh057n_init_sequence,
};

Expand All @@ -260,7 +260,7 @@ index a3e142f156d5..04cc2aef01f1 100644
static int xbd599_init_sequence(struct st7703 *ctx)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
@@ -169,9 +188,9 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -168,9 +187,9 @@ static int xbd599_init_sequence(struct st7703 *ctx)
*/

/* Magic sequence to unlock user commands below. */
Expand All @@ -272,7 +272,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x33, /* VC_main = 0, Lane_Number = 3 (4 lanes) */
0x81, /* DSI_LDO_SEL = 1.7V, RTERM = 90 Ohm */
0x05, /* IHSRX = x6 (Low High Speed driving ability) */
@@ -183,14 +202,14 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -182,14 +201,14 @@ static int xbd599_init_sequence(struct st7703 *ctx)
0x44, 0x25, 0x00, 0x91, 0x0a, 0x00, 0x00, 0x02,
0x4F, 0x11, 0x00, 0x00, 0x37);

Expand All @@ -289,7 +289,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x10, /* VBP_RGB_GEN */
0x10, /* VFP_RGB_GEN */
0x05, /* DE_BP_RGB_GEN */
@@ -201,7 +220,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -200,7 +219,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
0x00, 0x00);

/* Source driving settings. */
Expand All @@ -298,7 +298,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x73, /* N_POPON */
0x73, /* N_NOPON */
0x50, /* I_POPON */
@@ -213,19 +232,19 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -212,19 +231,19 @@ static int xbd599_init_sequence(struct st7703 *ctx)
0x00 /* Undocumented */);

/* NVDDD_SEL = -1.8V, VDDD_SEL = out of range (possibly 1.9V?) */
Expand All @@ -322,7 +322,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0xF0, /* NL = 240 */
0x12, /* RES_V_LSB = 0, BLK_CON = VSSD,
* RESO_SEL = 720RGB
@@ -235,7 +254,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -234,7 +253,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
* ISC = 0 frames
*/);

Expand All @@ -331,7 +331,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x00, /* PNOEQ */
0x00, /* NNOEQ */
0x0B, /* PEQGND */
@@ -255,9 +274,10 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -254,9 +273,10 @@ static int xbd599_init_sequence(struct st7703 *ctx)
* ESD_DET_TIME_SEL = 0 frames
*/);

Expand All @@ -344,7 +344,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x74, /* VBTHS, VBTLS: VGH = 17V, VBL = -11V */
0x00, /* FBOFF_VGH = 0, FBOFF_VGL = 0 */
0x32, /* VRP */
@@ -275,19 +295,20 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -274,19 +294,20 @@ static int xbd599_init_sequence(struct st7703 *ctx)
0x77 /* VGH3_R_DIV, VGL3_R_DIV (4.5MHz) */);

/* Reference voltage. */
Expand All @@ -369,7 +369,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x82, 0x10, 0x06, 0x05, 0xA2, 0x0A, 0xA5, 0x12,
0x31, 0x23, 0x37, 0x83, 0x04, 0xBC, 0x27, 0x38,
0x0C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x00,
@@ -298,7 +319,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -297,7 +318,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);

/* This command is to set backward GIP timing. */
Expand All @@ -378,7 +378,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x02, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x46, 0x02, 0x88,
0x88, 0x88, 0x88, 0x88, 0x88, 0x64, 0x88, 0x13,
@@ -309,7 +330,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
@@ -308,7 +329,7 @@ static int xbd599_init_sequence(struct st7703 *ctx)
0xA5, 0x00, 0x00, 0x00, 0x00);

/* Adjust the gamma characteristics of the panel. */
Expand All @@ -387,7 +387,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41, 0x35,
0x07, 0x0D, 0x0E, 0x12, 0x13, 0x10, 0x12, 0x12,
0x18, 0x00, 0x09, 0x0D, 0x23, 0x27, 0x3C, 0x41,
@@ -342,7 +363,15 @@ static const struct st7703_panel_desc xbd599_desc = {
@@ -341,7 +362,15 @@ static const struct st7703_panel_desc xbd599_desc = {
.init_sequence = xbd599_init_sequence,
};

Expand All @@ -404,7 +404,7 @@ index a3e142f156d5..04cc2aef01f1 100644
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);

@@ -350,44 +379,44 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
@@ -349,44 +378,44 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
* Init sequence was supplied by the panel vendor.
*/

Expand Down Expand Up @@ -469,7 +469,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x00, 0xb0, 0xb1, 0x11, 0x31, 0x23, 0x28, 0x80,
0xb0, 0xb1, 0x27, 0x08, 0x00, 0x04, 0x02, 0x00,
0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00,
@@ -396,7 +425,7 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
@@ -395,7 +424,7 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
0x18, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00);
Expand All @@ -478,7 +478,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x81, 0x88, 0xba, 0x17, 0x53, 0x88, 0x88, 0x88,
0x88, 0x88, 0x88, 0x80, 0x88, 0xba, 0x06, 0x42,
@@ -405,12 +434,12 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
@@ -404,12 +433,12 @@ static int rg353v2_init_sequence(struct st7703 *ctx)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00);
Expand All @@ -493,19 +493,18 @@ index a3e142f156d5..04cc2aef01f1 100644
.hdisplay = 640,
.hsync_start = 640 + 40,
.hsync_end = 640 + 40 + 2,
@@ -425,15 +454,210 @@ static const struct drm_display_mode rg353v2_mode = {
@@ -424,15 +453,210 @@ static const struct drm_display_mode rg353v2_mode = {
.height_mm = 57,
};

-static const struct st7703_panel_desc rg353v2_desc = {
- .mode = &rg353v2_mode,
+static const struct st7703_panel_desc rg351v2_desc = {
+ .mode = &rg351v2_mode,
.lanes = 4,
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_LPM,
.format = MIPI_DSI_FMT_RGB888,
- .init_sequence = rg353v2_init_sequence,
+ .lanes = 4,
+ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+ MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_LPM,
+ .format = MIPI_DSI_FMT_RGB888,
+ .init_sequence = rg351v2_init_sequence,
+};
+
Expand Down Expand Up @@ -592,17 +591,18 @@ index a3e142f156d5..04cc2aef01f1 100644
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
+ .width_mm = 52,
+ .height_mm = 70,
};
+};
+
+static const struct st7703_panel_desc xu10_desc = {
+ .mode = &xu10_mode,
+ .lanes = 4,
+ .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
+ MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_LPM,
+ .format = MIPI_DSI_FMT_RGB888,
.lanes = 4,
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST |
MIPI_DSI_MODE_NO_EOT_PACKET | MIPI_DSI_MODE_LPM,
.format = MIPI_DSI_FMT_RGB888,
- .init_sequence = rg353v2_init_sequence,
+ .init_sequence = xu10_init_sequence,
+};
+
};
+static int r36s_init_sequence(struct st7703 *ctx)
+{
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
Expand Down Expand Up @@ -707,7 +707,7 @@ index a3e142f156d5..04cc2aef01f1 100644
static int rgb30panel_init_sequence(struct st7703 *ctx)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
@@ -447,31 +671,31 @@ static int rgb30panel_init_sequence(struct st7703 *ctx)
@@ -446,31 +670,31 @@ static int rgb30panel_init_sequence(struct st7703 *ctx)
mipi_dsi_dcs_exit_sleep_mode(dsi);
msleep(250);

Expand Down Expand Up @@ -754,7 +754,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x0f, 0xa1, 0x80, 0x12, 0x31, 0x23, 0x47, 0x86,
0xa1, 0x80, 0x47, 0x08, 0x00, 0x00, 0x0d, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
@@ -480,7 +704,7 @@ static int rgb30panel_init_sequence(struct st7703 *ctx)
@@ -479,7 +703,7 @@ static int rgb30panel_init_sequence(struct st7703 *ctx)
0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00);
Expand All @@ -763,7 +763,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x01, 0x78, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4f, 0x31, 0x8b, 0xa8, 0x31, 0x75, 0x88, 0x88,
0x88, 0x88, 0x88, 0x4f, 0x20, 0x8b, 0xa8, 0x20,
@@ -489,7 +713,7 @@ static int rgb30panel_init_sequence(struct st7703 *ctx)
@@ -488,7 +712,7 @@ static int rgb30panel_init_sequence(struct st7703 *ctx)
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x40, 0xa1, 0x80, 0x00, 0x00, 0x00,
0x00);
Expand All @@ -772,7 +772,7 @@ index a3e142f156d5..04cc2aef01f1 100644
0x29, 0x3b, 0x3f, 0x42, 0x39, 0x06, 0x0d, 0x10,
0x13, 0x15, 0x14, 0x15, 0x10, 0x17, 0x00, 0x0a,
0x0f, 0x29, 0x3b, 0x3f, 0x42, 0x39, 0x06, 0x0d,
@@ -766,7 +990,7 @@ static int allpixelson_set(void *data, u64 val)
@@ -667,7 +891,7 @@ static int allpixelson_set(void *data, u64 val)
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);

dev_dbg(ctx->dev, "Setting all pixels on\n");
Expand All @@ -781,7 +781,7 @@ index a3e142f156d5..04cc2aef01f1 100644
msleep(val * 1000);
/* Reset the panel to get video back */
drm_panel_disable(&ctx->panel);
@@ -811,7 +1035,7 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
@@ -712,7 +936,7 @@ static int st7703_probe(struct mipi_dsi_device *dsi)
mipi_dsi_set_drvdata(dsi, ctx);

ctx->dev = dev;
Expand All @@ -790,18 +790,18 @@ index a3e142f156d5..04cc2aef01f1 100644

dsi->mode_flags = ctx->desc->mode_flags;
dsi->format = ctx->desc->format;
@@ -886,7 +1110,9 @@ static void st7703_remove(struct mipi_dsi_device *dsi)
@@ -783,7 +1007,9 @@ static void st7703_remove(struct mipi_dsi_device *dsi)
}

static const struct of_device_id st7703_of_match[] = {
- { .compatible = "anbernic,rg353v-panel-v2", .data = &rg353v2_desc },
+ { .compatible = "gameconsole,r36s-panel", .data = &r36s_desc },
+ { .compatible = "magicx,xu10-panel", .data = &xu10_desc },
+ { .compatible = "anbernic,rg351v-panel-v2", .data = &rg351v2_desc },
{ .compatible = "powkiddy,rgb10max3-panel", .data = &rgb10max3_panel_desc },
{ .compatible = "powkiddy,rgb30-panel", .data = &rgb30panel_desc },
{ .compatible = "rocktech,jh057n00900", .data = &jh057n00900_panel_desc },
@@ -906,6 +1132,6 @@ static struct mipi_dsi_driver st7703_driver = {
{ .compatible = "xingbangda,xbd599", .data = &xbd599_desc },
@@ -802,6 +1028,6 @@ static struct mipi_dsi_driver st7703_driver = {
};
module_mipi_dsi_driver(st7703_driver);

Expand Down

0 comments on commit 7d0eab3

Please sign in to comment.