Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4973201pxu; Tue, 13 Oct 2020 11:25:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYFUXltnRod57CpjsIBvdP4alkphb/xK9sTzgSrOGLbh153Ewa/lXYIuioTRy0TZyeBAmg X-Received: by 2002:a17:906:dc5:: with SMTP id p5mr1163378eji.116.1602613541402; Tue, 13 Oct 2020 11:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602613541; cv=none; d=google.com; s=arc-20160816; b=qD/EQ9ausDDxltxQhsDMSes4x4wNhnVWcgHSdsrAknrQfubjQ1a0dzX7crxMi3yUyt bjkmIDsDxI0DDjYyzZuAN6WteghR/pBxWrfjJehngCSJqCbfRY8Cfg8Ar3paVAs1fwPl 5UGkAVu55E6R0WtP18OU53vBIegjvyyMKEm9E2l8AND2U83O9fYvc3XMyM/wF1xEYfyK XAQxLYpqhYho3LsjcpCb8OtIWuuXc8di499RrwxNrlDyHSjzDiBTAxv1C+OFaQJeYBQ2 gDjveaWEDxxH1xolZreflU928Rjv/1L1lZD1ckLOCKymqF9CnQ8fqj29bdPOxp78AnN8 LnKg== 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:date:subject:to:from; bh=31s5mRkRY4GRCQg8+in8vm8TuCYUIO3VjHZrnlnRxic=; b=Ivu+y5gQdEANSkR6zxuzysPP2FJ5Pqjm70KXTze7l4aE5a9NBs8TWnQmgAqbeCR7W1 4R5Yl8bZhZGzdhsoKCQ5WK21CF5ef8wxfemE2hqpSSur8h3DSf4v/GDktiTst0dUImjN 3uNmXKbFIZkhBy3QiuRT7x+07OHW4oBb42cx60rxr+WQmrelNVefTRtf9Dyp7rlKXz2g X48pwpkFur5/ydDVnPwmfhQItDMHzRJmYYNrekJcEXDpFYn75Q1ekFa4yCTjZbexPniL 2kRT3L5MJCJf1BhxGeFbs30ILA7C8nf9lu2h9OTnYQ4w8stRLK2NBR6VdXaabO5fR4RN bSIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si377967eje.374.2020.10.13.11.25.12; Tue, 13 Oct 2020 11:25:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731027AbgJMKcz (ORCPT + 99 others); Tue, 13 Oct 2020 06:32:55 -0400 Received: from honk.sigxcpu.org ([24.134.29.49]:45934 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730322AbgJMKcy (ORCPT ); Tue, 13 Oct 2020 06:32:54 -0400 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id CB939FB02; Tue, 13 Oct 2020 12:32:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org 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 NZmo5Bvm5eqH; Tue, 13 Oct 2020 12:32:49 +0200 (CEST) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 9411E402FA; Tue, 13 Oct 2020 12:32:48 +0200 (CEST) From: =?UTF-8?q?Guido=20G=C3=BCnther?= To: Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , Rob Herring , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] drm/panel: mantix: Fix panel reset Date: Tue, 13 Oct 2020 12:32:47 +0200 Message-Id: X-Mailer: git-send-email 2.28.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mantix panel needs two reset lines (RESX and TP_RSTN) deasserted to output an image. Only deasserting RESX is not enough and the display will stay blank. Deassert in prepare() and assert in unprepare() to keep device held in reset when off. Signed-off-by: Guido Günther --- .../gpu/drm/panel/panel-mantix-mlaf057we51.c | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c index 4a7fbf64bb7a..0c5f22e95c2d 100644 --- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c +++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c @@ -26,7 +26,9 @@ struct mantix { struct device *dev; struct drm_panel panel; + struct gpio_desc *reset_gpio; + struct gpio_desc *tp_rstn_gpio; struct regulator *avdd; struct regulator *avee; @@ -124,6 +126,10 @@ static int mantix_unprepare(struct drm_panel *panel) { struct mantix *ctx = panel_to_mantix(panel); + gpiod_set_value_cansleep(ctx->tp_rstn_gpio, 1); + usleep_range(5000, 6000); + gpiod_set_value_cansleep(ctx->reset_gpio, 1); + regulator_disable(ctx->avee); regulator_disable(ctx->avdd); /* T11 */ @@ -165,13 +171,10 @@ static int mantix_prepare(struct drm_panel *panel) return ret; } - /* T3+T5 */ - usleep_range(10000, 12000); - - gpiod_set_value_cansleep(ctx->reset_gpio, 1); - usleep_range(5150, 7000); - + /* T3 + T4 + time for voltage to become stable: */ + usleep_range(6000, 7000); gpiod_set_value_cansleep(ctx->reset_gpio, 0); + gpiod_set_value_cansleep(ctx->tp_rstn_gpio, 0); /* T6 */ msleep(50); @@ -236,12 +239,18 @@ static int mantix_probe(struct mipi_dsi_device *dsi) if (!ctx) return -ENOMEM; - ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); + ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(ctx->reset_gpio)) { dev_err(dev, "cannot get reset gpio\n"); return PTR_ERR(ctx->reset_gpio); } + ctx->tp_rstn_gpio = devm_gpiod_get(dev, "mantix,tp-rstn", GPIOD_OUT_HIGH); + if (IS_ERR(ctx->tp_rstn_gpio)) { + dev_err(dev, "cannot get tp-rstn gpio\n"); + return PTR_ERR(ctx->tp_rstn_gpio); + } + mipi_dsi_set_drvdata(dsi, ctx); ctx->dev = dev; -- 2.28.0