Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp199926pxm; Wed, 2 Mar 2022 13:23:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLql6eweAaUe7sE98HhyfSlna2d9LoCQn9fI8FpvJOhjdcrcFqgxdXFxDYC8RtZnPXc8Ba X-Received: by 2002:a17:902:f701:b0:14d:7cea:82af with SMTP id h1-20020a170902f70100b0014d7cea82afmr32384871plo.71.1646256201893; Wed, 02 Mar 2022 13:23:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646256201; cv=none; d=google.com; s=arc-20160816; b=Xkb1kENXiqFxek/7Gy6jDkh5khbfzcxWKkrG1CQofncevK/2a59LR8meAScsINwhtw hCAOlzA6FWLrxPNRpTiFCCXYl4yiyxsySaAhTUUzcC1lic2KQsto3njSIuJzM3r8EaFH ewZgAK68RvRD4ahcr9amUuXmMWEpN+diTQnQTVlpX21eqhP90g//lffzE+btCHolOEVA wyKD1pbufj4PGHbCDhoU5PWbUEn3yZe/zZFqWzZuKYd43W1iBHwsyYb9JwA4jhNCiUI3 75vaE3+FLoITbe/g14tDia7WRmG9cK12iXvFxDSWfJp5iTH8Vm3ao4p19nOltuUkkdhW 8nZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date; bh=C0vEx1hT45a2eVidNTEQUJrlAN632QJIs2J+EBP0Oy0=; b=hIs8NjzerKhXOfVXrBIzigPq88wbmWRpmdbWusuj3pQlnniX9Wcr3d3RnANLkmLsQV rRmTjZ6wZ7atyiRoYHMX9Vn+sHaKD4qLwYCTakqVh27e5fyspjkEr699D0/zwHhtqNG+ lqx4iwzJM/+SaYMQENiCj3UAFZnSMfcy03kisPL0A14kLbjc9T2zCEpDcWzJjdIKYmpI bz08spZs4G6v9GzjKuMtqqVHmjkwgDK0EPvFgVOvScd83nvn9pKwzhbz97lE2X+QbOQs SLMHyoPQsG0CsLl2knb8zFCNU20/0Wb13rLVZe68mYx5QqPkDIvoT/NVxAjg/g05FWXJ s3ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx3-20020a17090b4b0300b001bf0621f11bsi1467265pjb.97.2022.03.02.13.23.05; Wed, 02 Mar 2022 13:23:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240368AbiCBLXH convert rfc822-to-8bit (ORCPT + 99 others); Wed, 2 Mar 2022 06:23:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241411AbiCBLWy (ORCPT ); Wed, 2 Mar 2022 06:22:54 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB3487657; Wed, 2 Mar 2022 03:22:11 -0800 (PST) Date: Wed, 02 Mar 2022 10:40:07 +0000 From: Paul Cercueil Subject: Re: [PATCH v1 3/3] drm/panel : innolux-ej030na and abt-y030xx067a : add .enable and .disable To: Christophe Branchereau Cc: David Airlie , Daniel Vetter , Thierry Reding , Sam Ravnborg , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, dri-devel@lists.freedesktop.org Message-Id: In-Reply-To: <20220301153122.20660-4-cbranchereau@gmail.com> References: <20220301153122.20660-1-cbranchereau@gmail.com> <20220301153122.20660-4-cbranchereau@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christophe, Le mar., mars 1 2022 at 16:31:22 +0100, Christophe Branchereau a ?crit : > Following the introduction of bridge_atomic_enable in the ingenic > drm driver, the crtc is enabled between .prepare and .enable, if > it exists. > > Add it so the backlight is only enabled after the crtc is, to avoid > graphical issues. > > Signed-off-by: Christophe Branchereau > --- > drivers/gpu/drm/panel/panel-abt-y030xx067a.c | 23 ++++++++++++-- > drivers/gpu/drm/panel/panel-innolux-ej030na.c | 31 > ++++++++++++++++--- > 2 files changed, 48 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > index f043b484055b..b5736344e3ec 100644 > --- a/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > +++ b/drivers/gpu/drm/panel/panel-abt-y030xx067a.c > @@ -183,8 +183,6 @@ static int y030xx067a_prepare(struct drm_panel > *panel) > goto err_disable_regulator; > } > > - msleep(120); > - > return 0; > > err_disable_regulator: > @@ -202,6 +200,25 @@ static int y030xx067a_unprepare(struct drm_panel > *panel) > return 0; > } > > +static int y030xx067a_enable(struct drm_panel *panel) > +{ > + if (panel->backlight) { > + /* Wait for the picture to be ready before enabling backlight */ > + msleep(120); > + } > + > + return 0; > +} > + > +static int y030xx067a_disable(struct drm_panel *panel) > +{ > + struct y030xx067a *priv = to_y030xx067a(panel); > + > + regmap_clear_bits(priv->map, 0x06, REG06_XPSAVE); Shouldn't that be balanced by a regmap_set_bits() in the .enable() function? Cheers, -Paul > + > + return 0; > +} > + > static int y030xx067a_get_modes(struct drm_panel *panel, > struct drm_connector *connector) > { > @@ -239,6 +256,8 @@ static int y030xx067a_get_modes(struct drm_panel > *panel, > static const struct drm_panel_funcs y030xx067a_funcs = { > .prepare = y030xx067a_prepare, > .unprepare = y030xx067a_unprepare, > + .enable = y030xx067a_enable, > + .disable = y030xx067a_disable, > .get_modes = y030xx067a_get_modes, > }; > > diff --git a/drivers/gpu/drm/panel/panel-innolux-ej030na.c > b/drivers/gpu/drm/panel/panel-innolux-ej030na.c > index c558de3f99be..6de7370185cd 100644 > --- a/drivers/gpu/drm/panel/panel-innolux-ej030na.c > +++ b/drivers/gpu/drm/panel/panel-innolux-ej030na.c > @@ -80,8 +80,6 @@ static const struct reg_sequence > ej030na_init_sequence[] = { > { 0x47, 0x08 }, > { 0x48, 0x0f }, > { 0x49, 0x0f }, > - > - { 0x2b, 0x01 }, > }; > > static int ej030na_prepare(struct drm_panel *panel) > @@ -109,8 +107,6 @@ static int ej030na_prepare(struct drm_panel > *panel) > goto err_disable_regulator; > } > > - msleep(120); > - > return 0; > > err_disable_regulator: > @@ -128,6 +124,31 @@ static int ej030na_unprepare(struct drm_panel > *panel) > return 0; > } > > +static int ej030na_enable(struct drm_panel *panel) > +{ > + struct ej030na *priv = to_ej030na(panel); > + > + /* standby off */ > + regmap_write(priv->map, 0x2b, 0x01); > + > + if (panel->backlight) { > + /* Wait for the picture to be ready before enabling backlight */ > + msleep(120); > + } > + > + return 0; > +} > + > +static int ej030na_disable(struct drm_panel *panel) > +{ > + struct ej030na *priv = to_ej030na(panel); > + > + /* standby on */ > + regmap_write(priv->map, 0x2b, 0x00); > + > + return 0; > +} > + > static int ej030na_get_modes(struct drm_panel *panel, > struct drm_connector *connector) > { > @@ -165,6 +186,8 @@ static int ej030na_get_modes(struct drm_panel > *panel, > static const struct drm_panel_funcs ej030na_funcs = { > .prepare = ej030na_prepare, > .unprepare = ej030na_unprepare, > + .enable = ej030na_enable, > + .disable = ej030na_disable, > .get_modes = ej030na_get_modes, > }; > > -- > 2.34.1 >