Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2515191pxb; Mon, 18 Apr 2022 02:01:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBKfq/942emWmn46gowTKn4SzSSIWJj1NONwQw5yYVdlwE4IhbpHBQFF+ga+oKB6m5vh66 X-Received: by 2002:a65:41cc:0:b0:380:6f53:a550 with SMTP id b12-20020a6541cc000000b003806f53a550mr9175837pgq.471.1650272484546; Mon, 18 Apr 2022 02:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650272484; cv=none; d=google.com; s=arc-20160816; b=GhWRswwF2dk0OW5OeZ6b2keUyKyhz2GzMqopbiXpM5W7tRAm7PNDb3KYjbM4U1R3Nr pb+F2GlwAMKx0ubFuE8RyzzCWiUah3WeXedKM/8V4FuGIOGvS6fGu0E4Y1jgJ4XddFxE p1/zr1tGyqGJt0Py8pAc49LqnfxaR5DGwXA6OdlstOtjvZri+YwZcEtwV1uQSxLkP+XV Xjc6x2I5Q7N4ol/MkoSO2FP+3tbXmAe+i29+4UdiCfqaXHd8elwIcclZffxxfYx0djpM bYsSo56Hj118QfVLjz5vvaFgJQ38dMFqIKcZxp7PgRgiOi+nDjejk7ba3gwptgqVpS/J Qh6g== 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 :organization:message-id:subject:cc:to:from:date; bh=XeOuIELZN+TqkdfW+ifEe0gFPVFhQQUrhAs2M9n7wNk=; b=aFSdhBjF3jblhNGq4ugKbtBzL/lyF3c85la+YaTlTY8abxVXy+dioeHdOY8yiw2Mji dhNYvHIblzdHstf90PSg87mXrfSm4fBE2UnJ9DFhqvhJlczozhn0GIIjAFk1TCTCRMZd g6pV+p9Db131d4aaUtHa6sM6EtPVJQUGzcLYz2ti1By4Hr/uw4F58HGA6KUhxbwwVy2n KD4EL6+cPV++QvFdojkUqMaeZszMzENuE66iH2mzbcEe5C0RwQc8DREffFZSNmaTSg8f bnpFjd4O1fR7rQYE9afQyxw2wV9oHeNHDG6MaO8/kyCySXSLc934SkvjHMialMH/63m5 6kGQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a654783000000b0039cb90dd2e9si8560188pgs.132.2022.04.18.02.01.10; Mon, 18 Apr 2022 02:01:24 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234364AbiDQQSr (ORCPT + 99 others); Sun, 17 Apr 2022 12:18:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234358AbiDQQSq (ORCPT ); Sun, 17 Apr 2022 12:18:46 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67C181EC4C; Sun, 17 Apr 2022 09:16:10 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 107) id 91FD668D0A; Sun, 17 Apr 2022 18:16:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from blackhole (p5b0d8d05.dip0.t-ipconnect.de [91.13.141.5]) by verein.lst.de (Postfix) with ESMTPSA id 6412A67373; Sun, 17 Apr 2022 18:15:43 +0200 (CEST) Date: Sun, 17 Apr 2022 18:15:38 +0200 From: Torsten Duwe To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Cc: David Airlie , Daniel Vetter , Thierry Reding , Lyude Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Harald Geyer , stable@vger.kernel.org, Vasily Khoruzhick Subject: [PATCH] drm/bridge: fix anx6345 power up sequence Message-ID: <20220417181538.57fa1303@blackhole> Organization: LST e.V. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Align the power-up sequence with the known-good procedure documented in [1]: un-swap dvdd12 and dvdd25, and allow a little extra time for them to settle before de-asserting reset. Fixes: 6aa192698089b ("drm/bridge: Add Analogix anx6345 support") [1] https://github.com/OLIMEX/DIY-LAPTOP/blob/master/ HARDWARE/A64-TERES/TERES-PCB1-A64-MAIN/Rev.C/TERES_PCB1-A64-MAIN_Rev.C.pdf (page 5, blue comment down left) Reported-by: Harald Geyer Signed-off-by: Torsten Duwe Cc: stable@vger.kernel.org --- This fixes the problem that e.g. X screensaver turns the screen black, and it stays black until the next reboot; definitely on the Teres-I, probably on the pinebook64, too. --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c @@ -309,27 +309,27 @@ static void anx6345_poweron(struct anx63 gpiod_set_value_cansleep(anx6345->gpiod_reset, 1); usleep_range(1000, 2000); - err = regulator_enable(anx6345->dvdd12); + err = regulator_enable(anx6345->dvdd25); if (err) { - DRM_ERROR("Failed to enable dvdd12 regulator: %d\n", + DRM_ERROR("Failed to enable dvdd25 regulator: %d\n", err); return; } - /* T1 - delay between VDD12 and VDD25 should be 0-2ms */ + /* T1 - delay between VDD25 and VDD12 should be 0-2ms */ usleep_range(1000, 2000); - err = regulator_enable(anx6345->dvdd25); + err = regulator_enable(anx6345->dvdd12); if (err) { - DRM_ERROR("Failed to enable dvdd25 regulator: %d\n", + DRM_ERROR("Failed to enable dvdd12 regulator: %d\n", err); return; } /* T2 - delay between RESETN and all power rail stable, - * should be 2-5ms + * should be at least 2-5ms, 10ms to be safe. */ - usleep_range(2000, 5000); + usleep_range(9000, 11000); gpiod_set_value_cansleep(anx6345->gpiod_reset, 0);