From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D64E1C83F14 for ; Tue, 29 Aug 2023 16:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237429AbjH2QRQ (ORCPT ); Tue, 29 Aug 2023 12:17:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236473AbjH2QQq (ORCPT ); Tue, 29 Aug 2023 12:16:46 -0400 Received: from honk.sigxcpu.org (honk.sigxcpu.org [24.134.29.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6880C1B1 for ; Tue, 29 Aug 2023 09:16:34 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 175D6FB02; Tue, 29 Aug 2023 18:16:31 +0200 (CEST) Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wmPcIvMR29Ee; Tue, 29 Aug 2023 18:16:29 +0200 (CEST) Date: Tue, 29 Aug 2023 18:16:28 +0200 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Frank Oltmanns Cc: Ondrej Jirman , Purism Kernel Team , Ondrej Jirman , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , "open list:DRM PANEL DRIVERS" , open list , Samuel Holland Subject: Re: [PATCH v2 1/1] drm/panel: st7703: Fix timings when entering/exiting sleep Message-ID: References: <20230213123238.76889-1-frank@oltmanns.dev> <20230213123238.76889-2-frank@oltmanns.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230213123238.76889-2-frank@oltmanns.dev> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Feb 13, 2023 at 01:32:38PM +0100, Frank Oltmanns wrote: > Fix flickering of the pinephone's XDB599 panel that happens after > resume. > > Extend the delay after issuing the command to exit sleep mode from 60 to > 120 msec as per the controller's specification. > > Introduce a 120 msec delay after issuing the command to enter sleep > mode. This is needed in order for the controller to reliably finalize > the sleep in sequence before switching of power supply. > > In contrast to the JH057N panel, the XBD599 panel does not require a 20 > msec delay after initialization and exiting sleep mode. Therefore, move > the delay into the already existing device specific initialization > function. > > The XDB599 does not require a 20 msec delay between the SETBGP and > SETVCOM commands. Therefore, remove the delay from the device specific > initialization function. > > Signed-off-by: Frank Oltmanns > Cc: Ondrej Jirman > Reported-by: Samuel Holland > --- > drivers/gpu/drm/panel/panel-sitronix-st7703.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c > index 6747ca237ced..c49f4ef883fc 100644 > --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c > +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c > @@ -126,6 +126,7 @@ static int jh057n_init_sequence(struct st7703 *ctx) > 0x18, 0x00, 0x09, 0x0E, 0x29, 0x2D, 0x3C, 0x41, > 0x37, 0x07, 0x0B, 0x0D, 0x10, 0x11, 0x0F, 0x10, > 0x11, 0x18); > + msleep(20); > > return 0; > } > @@ -273,7 +274,6 @@ static int xbd599_init_sequence(struct st7703 *ctx) > mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETBGP, > 0x07, /* VREF_SEL = 4.2V */ > 0x07 /* NVREF_SEL = 4.2V */); > - msleep(20); > > mipi_dsi_dcs_write_seq(dsi, ST7703_CMD_SETVCOM, > 0x2C, /* VCOMDC_F = -0.67V */ > @@ -350,16 +350,14 @@ static int st7703_enable(struct drm_panel *panel) > return ret; > } > > - msleep(20); > - > ret = mipi_dsi_dcs_exit_sleep_mode(dsi); > if (ret < 0) { > dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); > return ret; > } > > - /* Panel is operational 120 msec after reset */ > - msleep(60); > + /* It takes the controller 120 msec to wake up after sleep. */ > + msleep(120); > > ret = mipi_dsi_dcs_set_display_on(dsi); > if (ret) > @@ -384,6 +382,9 @@ static int st7703_disable(struct drm_panel *panel) > if (ret < 0) > dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret); > > + /* It takes the controller 120 msec to enter sleep mode. */ > + msleep(120); > + > return 0; > } Tested this patch on a Librem 5 devkit. Reviewed-by: Guido Günther Tested-by: Guido Günther Cheers, -- Guido > > -- > 2.39.1 >