diff mbox series

[v1,4/4] video: orisetech_otm8009a: fill characteristics of DSI data link

Message ID 20200624084542.18098-5-yannick.fertre@st.com
State Accepted
Commit bccb385a83a5f9ee603a30de1d39b03fd6f45b23
Headers show
Series rework DSI characteristics | expand

Commit Message

Yannick Fertre June 24, 2020, 8:45 a.m. UTC
Fill characteristics of DSI data link to platform data instead of
mipi device to avoid memory corruption.

Signed-off-by: Yannick Fertre <yannick.fertre at st.com>
---
 drivers/video/orisetech_otm8009a.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

Comments

Patrick Delaunay June 24, 2020, 1:30 p.m. UTC | #1
Hi Yannick,

> From: Yannick FERTRE <yannick.fertre at st.com>
> Sent: mercredi 24 juin 2020 10:46
> 
> Fill characteristics of DSI data link to platform data instead of mipi device to avoid
> memory corruption.
> 
> Signed-off-by: Yannick Fertre <yannick.fertre at st.com>
> ---
>  drivers/video/orisetech_otm8009a.c | 20 +++++---------------
>  1 file changed, 5 insertions(+), 15 deletions(-)
> 

Reviewed-by: Patrick Delaunay <patrick.delaunay at st.com>

Thanks

Patrick
Anatolij Gustschin June 29, 2020, 7:03 a.m. UTC | #2
On Wed, 24 Jun 2020 10:45:42 +0200
Yannick Fertre yannick.fertre at st.com wrote:

> Fill characteristics of DSI data link to platform data instead of
> mipi device to avoid memory corruption.
> 
> Signed-off-by: Yannick Fertre <yannick.fertre at st.com>
> ---
>  drivers/video/orisetech_otm8009a.c | 20 +++++---------------
>  1 file changed, 5 insertions(+), 15 deletions(-)

Applied to u-boot-video/master, thanks!

--
Anatolij
diff mbox series

Patch

diff --git a/drivers/video/orisetech_otm8009a.c b/drivers/video/orisetech_otm8009a.c
index b1f2dd403e..362bf6a6fe 100644
--- a/drivers/video/orisetech_otm8009a.c
+++ b/drivers/video/orisetech_otm8009a.c
@@ -62,9 +62,6 @@ 
 struct otm8009a_panel_priv {
 	struct udevice *reg;
 	struct gpio_desc reset;
-	unsigned int lanes;
-	enum mipi_dsi_pixel_format format;
-	unsigned long mode_flags;
 };
 
 static const struct display_timing default_timing = {
@@ -293,17 +290,8 @@  static int otm8009a_panel_enable_backlight(struct udevice *dev)
 static int otm8009a_panel_get_display_timing(struct udevice *dev,
 					     struct display_timing *timings)
 {
-	struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
-	struct mipi_dsi_device *device = plat->device;
-	struct otm8009a_panel_priv *priv = dev_get_priv(dev);
-
 	memcpy(timings, &default_timing, sizeof(*timings));
 
-	/* fill characteristics of DSI data link */
-	device->lanes = priv->lanes;
-	device->format = priv->format;
-	device->mode_flags = priv->mode_flags;
-
 	return 0;
 }
 
@@ -335,6 +323,7 @@  static int otm8009a_panel_ofdata_to_platdata(struct udevice *dev)
 static int otm8009a_panel_probe(struct udevice *dev)
 {
 	struct otm8009a_panel_priv *priv = dev_get_priv(dev);
+	struct mipi_dsi_panel_plat *plat = dev_get_platdata(dev);
 	int ret;
 
 	if (IS_ENABLED(CONFIG_DM_REGULATOR) && priv->reg) {
@@ -350,9 +339,10 @@  static int otm8009a_panel_probe(struct udevice *dev)
 	dm_gpio_set_value(&priv->reset, false);
 	mdelay(10); /* >5ms */
 
-	priv->lanes = 2;
-	priv->format = MIPI_DSI_FMT_RGB888;
-	priv->mode_flags = MIPI_DSI_MODE_VIDEO |
+	/* fill characteristics of DSI data link */
+	plat->lanes = 2;
+	plat->format = MIPI_DSI_FMT_RGB888;
+	plat->mode_flags = MIPI_DSI_MODE_VIDEO |
 			   MIPI_DSI_MODE_VIDEO_BURST |
 			   MIPI_DSI_MODE_LPM;