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-11-15 10:24:42 +0000
commit7f168258ec391a1915a0087e512044d92aa9d7db (patch)
tree094ecafbd66921a0d593d8973eeb156504b2e108
parent4fe1836e6772382d464c1f9b5b7db992c711f30d (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 926fd72f7667..7d70781f6e1d 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);