aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2020-03-23 15:44:01 +0800
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2022-07-09 02:23:05 +0100
commitcf7d2c0c0b6796ee914d6fc8a9786bf8879200cc (patch)
treeea28e44e9c6a30c76e76a07746c6b9c354293d32
parentd8cf4eb5b47d6085f7c90021586ff98e236d8da7 (diff)
drm/panel/truly-r63350: Detect panel type from kernel cmdline
This is to support the use case that LK configures the panel for splash screen and then passes the panel type to kernel via cmdline. It's a vendor bootloader/kernel specific implementation, and not suitable for upstream. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
-rw-r--r--drivers/gpu/drm/panel/panel-truly-r63350.c41
1 files changed, 35 insertions, 6 deletions
diff --git a/drivers/gpu/drm/panel/panel-truly-r63350.c b/drivers/gpu/drm/panel/panel-truly-r63350.c
index adb47c78f459..f62e3dd74fea 100644
--- a/drivers/gpu/drm/panel/panel-truly-r63350.c
+++ b/drivers/gpu/drm/panel/panel-truly-r63350.c
@@ -24,6 +24,12 @@ static const char * const regulator_names[] = {
"avee",
};
+enum panel_vendor {
+ NOT_INITIALIZE = -1,
+ TRULY,
+ AUO,
+};
+
struct cmd_set {
const u8 *payload;
size_t size;
@@ -50,6 +56,20 @@ struct truly_panel {
bool enabled;
};
+/* Panel vendor/type provided by bootloader */
+static enum panel_vendor vendor_from_bl = NOT_INITIALIZE;
+
+static int __init panel_setup(char *str)
+{
+ if (strstr(str, "truly_r63350"))
+ vendor_from_bl = TRULY;
+ else if (strstr(str, "auo_r63350"))
+ vendor_from_bl = AUO;
+
+ return 1;
+}
+__setup("mdss_mdp.panel=", panel_setup);
+
static inline struct truly_panel *panel_to_truly(struct drm_panel *panel)
{
return container_of(panel, struct truly_panel, panel);
@@ -71,6 +91,14 @@ static int truly_r63350_power_on(struct truly_panel *truly)
if (ret)
return ret;
+ if (vendor_from_bl != NOT_INITIALIZE) {
+ /*
+ * If bootloader already configures the panel, we are
+ * done and skip panel reset below.
+ */
+ return 0;
+ }
+
/* Reset panel */
gpiod_set_value(truly->reset_gpio, 0);
usleep_range(20000, 30000);
@@ -221,7 +249,6 @@ static const struct drm_display_mode truly_fhd_mode = {
.vsync_start = 1920 + 4,
.vsync_end = 1920 + 4 + 1,
.vtotal = 1920 + 4 + 1 + 5,
- .vrefresh = 60,
.flags = 0,
};
@@ -285,11 +312,7 @@ static int truly_r63350_panel_add(struct truly_panel *truly)
return ret;
}
- ret = drm_panel_add(&truly->panel);
- if (ret) {
- DRM_DEV_ERROR(dev, "failed to add panel: %d\n", ret);
- return ret;
- }
+ drm_panel_add(&truly->panel);
return 0;
}
@@ -639,6 +662,12 @@ static int truly_r63350_probe(struct mipi_dsi_device *dsi)
if (!truly->data)
return -ENODEV;
+ /* Override data if bootloader provides the panel type */
+ if (vendor_from_bl == TRULY)
+ truly->data = &truly_fhd_data;
+ else if (vendor_from_bl == AUO)
+ truly->data = &auo_fhd_data;
+
truly->dev = dev;
ret = truly_r63350_panel_add(truly);