Browse Source

video: Rename raydium-rm68200-starfive.c to starfive_seeed_panel.c

The code is ported from tag JH7110_DVK_515_v3.9.3 of Devkits repo.

Signed-off-by: Keith Zhao <keith.zhao@starfivetech.com>
Signed-off-by: Shengyang Chen <shengyang.chen@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Hal Feng 8 months ago
parent
commit
9338dd6190
2 changed files with 25 additions and 10 deletions
  1. 1 1
      drivers/video/Makefile
  2. 24 9
      drivers/video/starfive_seeed_panel.c

+ 1 - 1
drivers/video/Makefile

@@ -57,7 +57,7 @@ obj-$(CONFIG_VIDEO_LCD_ANX9804) += anx9804.o
 obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o
 obj-$(CONFIG_VIDEO_LCD_ORISETECH_OTM8009A) += orisetech_otm8009a.o
 obj-$(CONFIG_VIDEO_LCD_RAYDIUM_RM68200) += raydium-rm68200.o
-obj-$(CONFIG_VIDEO_LCD_STARFIVE_SEEED) += raydium-rm68200-starfive.o
+obj-$(CONFIG_VIDEO_LCD_STARFIVE_SEEED) += starfive_seeed_panel.o
 obj-$(CONFIG_VIDEO_SF_MIPI2EDP) += starfive_edp.o
 obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o
 obj-$(CONFIG_VIDEO_LCD_TDO_TL070WSH30) += tdo-tl070wsh30.o

+ 24 - 9
drivers/video/raydium-rm68200-starfive.c → drivers/video/starfive_seeed_panel.c

@@ -4,8 +4,8 @@
  * Author(s): Yannick Fertre <yannick.fertre@st.com> for STMicroelectronics.
  *            Philippe Cornu <philippe.cornu@st.com> for STMicroelectronics.
  *
- * This rm68200 panel driver is inspired from the Linux Kernel driver
- * drivers/gpu/drm/panel/panel-raydium-rm68200.c.
+ * This seeed panel driver is inspired from the Linux Kernel driver
+ * drivers/gpu/drm/panel/panel-raydium-seeed.c.
  */
 #include <common.h>
 #include <backlight.h>
@@ -145,15 +145,16 @@ enum REG_ADDR {
 /* Chip/Rev Registers */
 #define IDREG 0x04A0
 
-/* Debug Registers */
+/* printf Registers */
 #define WCMDQUEUE 0x0500
 #define RCMDQUEUE 0x0504
 
 
-struct rm68200_panel_priv {
+struct seeed_panel_priv {
 	struct udevice *reg;
 	struct udevice *backlight;
-	struct gpio_desc reset;
+	struct gpio_desc *sel_gpio;   //select
+
 };
 
 static const struct display_timing default_timing = {
@@ -292,6 +293,9 @@ static int rm68200_panel_of_to_plat(struct udevice *dev)
 static int rm68200_panel_probe(struct udevice *dev)
 {
 	struct mipi_dsi_panel_plat *plat = dev_get_plat(dev);
+#if CONFIG_IS_ENABLED(TARGET_STARFIVE_DEVKITS)
+	struct seeed_panel_priv *priv = dev_get_priv(dev);
+#endif
 
 	u8 reg_value = 0;
 
@@ -315,6 +319,17 @@ static int rm68200_panel_probe(struct udevice *dev)
 		   return -ENODEV;
 	}
 
+#if CONFIG_IS_ENABLED(TARGET_STARFIVE_DEVKITS)
+	priv->sel_gpio = devm_gpiod_get_optional(dev, "sel", GPIOD_IS_OUT);
+
+	if (IS_ERR(priv->sel_gpio)) {
+		pr_err("Failed get reset sel gpio\n");
+		return PTR_ERR(priv->sel_gpio);
+	}
+
+	dm_gpio_set_value(priv->sel_gpio, 0);
+#endif
+
 	return 0;
 }
 
@@ -324,17 +339,17 @@ static const struct panel_ops rm68200_panel_ops = {
 };
 
 static const struct udevice_id rm68200_panel_ids[] = {
-	{ .compatible = "raydium,rm68200" },
+	{ .compatible = "starfive,seeed" },
 	{ }
 };
 
-U_BOOT_DRIVER(rm68200_panel) = {
-	.name			  = "rm68200_panel",
+U_BOOT_DRIVER(seeed_panel) = {
+	.name			  = "seeed_panel",
 	.id			  = UCLASS_PANEL,
 	.of_match		  = rm68200_panel_ids,
 	.ops			  = &rm68200_panel_ops,
 	.of_to_plat	  = rm68200_panel_of_to_plat,
 	.probe			  = rm68200_panel_probe,
 	.plat_auto	= sizeof(struct mipi_dsi_panel_plat),
-	.priv_auto	= sizeof(struct rm68200_panel_priv),
+	.priv_auto	= sizeof(struct seeed_panel_priv),
 };