TS050 screen flickering

Which system do you use? Android, Ubuntu, OOWOW or others?

Android

Which version of system do you use? Khadas official images, self built images, or others?

Official Android image

Please describe your issue below:

Hello, i have a big problem with the TS050 touchscreen.
When i put the device in standby with the screen connected and then resume after a while, the screen starts heavy white flickering. The longer it is in standby the stronger is the flickering.

I hope someone can help me.

Thanks in advance

Hi @Shizet ,

Could you state your installed Android version ?

Is this only with a particular firmware or is the issue there in other firmware you have tested ?

Regards.

Hi thank for the reply.

The problem occured on these firmwares.

edge2-android-12-v230625
edge2-android-12-v230325
edge2-android-12-v230315

Currently iam on the latest v230625

Have you tried other firmware like Ubuntu ?

What power supply are you using ?

No i haven’t tried Ubuntu or any other os because Android was my preffered way for emulation, but i will give it a go and then report back.

My Edge is powered by 2 Lipo batteries @7.4V and then boosted to 12V. Yesterday i tried 20V but nothing changed.

I would suspect that is your problem. Noise from the boost regulator will interfere with stuff. At minimum do some testing using a good solid power supply. If the problem goes away you just found the problem.

Oh that is very good suggestion, i never thought about that and will try that.

Edit: ok i checked it with a reliable power supply and the problem persists.

@Shizet I have reproduced the problem you mentioned, and I will work hard to solve it.

Thank you very much, so is that a software problem?

@Shizet Yes. This issue has been corrected. But releasing a version requires a process. It may take a long time. Have you downloaded the code to compile firmware? If possible, I can release the modified code to you.

@goenjoy yes that would be great if you can release the code.

Thank you very much for the help

@Shizet

kernel-5.10$ git log -p
commit 15614cd4e0db35c9d5c2a1a1ea09e1483ea220ad (HEAD -> khadas-edge2-android12)

    LCD: fix the issue of TS050 screen waking up after half an hour of sleep, resulting in screen LCD polarization

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 558e1d550124..015c102d4cee 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -148,6 +148,7 @@ struct panel_simple {
        struct drm_dsc_picture_parameter_set *pps;
        enum drm_panel_orientation orientation;
 };
+extern void lcd_reset_pin_reset(void);
 
 static inline struct panel_simple *to_panel_simple(struct drm_panel *panel)
 {
@@ -463,6 +464,7 @@ static int panel_simple_unprepare(struct drm_panel *panel)
                        panel_simple_xfer_dsi_cmd_seq(p, p->desc->exit_seq);
 
        //gpiod_direction_output(p->reset_gpio, 0);
+       lcd_reset_pin_reset();
        gpiod_direction_output(p->enable_gpio, 0);
 
        panel_simple_regulator_disable(p);
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c
index f55a3a5c5c7c..0962d7ac6950 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c
@@ -271,6 +271,8 @@ struct dw_mipi_dsi2 {
        u32 format;
        unsigned long mode_flags;
 
+       struct gpio_desc *reset_gpio;
+       unsigned int reset_ms;
        const struct dw_mipi_dsi2_plat_data *pdata;
        struct rockchip_drm_sub_dev sub_dev;
 
@@ -279,6 +281,8 @@ struct dw_mipi_dsi2 {
        struct drm_property *user_split_mode_prop;
 };
 
+struct dw_mipi_dsi2 *mdsi2 = NULL;
+
 static inline struct dw_mipi_dsi2 *host_to_dsi2(struct mipi_dsi_host *host)
 {
        return container_of(host, struct dw_mipi_dsi2, host);
@@ -1321,6 +1325,23 @@ static int dw_mipi_dsi2_bind(struct device *dev, struct device *master,
        return ret;
 }
 
+void lcd_reset_pin_reset(void){
+       if(mdsi2 == NULL)
+               return;
+//printk("%s: dsi2->reset_gpio: %d dsi2->reset_ms=%d\n", __func__, mdsi2->reset_gpio,mdsi2->reset_ms);
+       gpiod_set_value_cansleep(mdsi2->reset_gpio, 0);
+       mdelay(mdsi2->reset_ms);
+
+       gpiod_set_value_cansleep(mdsi2->reset_gpio, 1);
+       mdelay(mdsi2->reset_ms);
+
+       gpiod_set_value_cansleep(mdsi2->reset_gpio, 0);
+       mdelay(mdsi2->reset_ms);
+
+       gpiod_set_value_cansleep(mdsi2->reset_gpio, 1);
+       mdelay(mdsi2->reset_ms);
+};
+
 static void dw_mipi_dsi2_unbind(struct device *dev, struct device *master,
                               void *data)
 {
@@ -1530,6 +1551,7 @@ static int dw_mipi_dsi2_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct dw_mipi_dsi2 *dsi2;
+       struct device_node *np = NULL;
        struct resource *res;
        void __iomem *regs;
        int id;
@@ -1540,6 +1562,7 @@ static int dw_mipi_dsi2_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        id = of_alias_get_id(dev->of_node, "dsi");
+       np = dev->of_node;
        if (id < 0)
                id = 0;
 
@@ -1603,6 +1626,14 @@ static int dw_mipi_dsi2_probe(struct platform_device *pdev)
                return ret;
        }
 
+       of_property_read_u32(np, "reset-delay-ms", &dsi2->reset_ms);
+
+       dsi2->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS);
+       if (IS_ERR(dsi2->reset_gpio)){
+               dsi2->reset_gpio = NULL;
+               printk("%s: Cannot get reset GPIO: %d\n", __func__, __LINE__);
+       }
+
        dsi2->te_gpio = devm_gpiod_get_optional(dsi2->dev, "te", GPIOD_IN);
        if (IS_ERR(dsi2->te_gpio))
                dsi2->te_gpio = NULL;
@@ -1632,6 +1663,7 @@ static int dw_mipi_dsi2_probe(struct platform_device *pdev)
                DRM_DEV_ERROR(dev, "Failed to register MIPI host: %d\n", ret);
                return ret;
        }
+       mdsi2 = dsi2;
 
        return component_add(&pdev->dev, &dw_mipi_dsi2_ops);
 }