From patchwork Fri May 17 21:36:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13667411 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CAA62C04FFE for ; Fri, 17 May 2024 21:38:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 10D8A10E19C; Fri, 17 May 2024 21:38:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="AcBGNuIy"; dkim-atps=neutral Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id C8C5D10E0CD for ; Fri, 17 May 2024 21:37:47 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6f457853950so426359b3a.0 for ; Fri, 17 May 2024 14:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715981867; x=1716586667; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wMrmoliKPswHzuEojIBGChDP268r8lDTpqZYT1tgrB0=; b=AcBGNuIyswLkJq9adE7wFbgK2cgEKLpMFDoQy8eKwEsLHXgRWYP6vaLi4z/C4lgFxx uvBfeW2SxXGVlBmZbR4UGa3CIn6mmWTMBlGJnF560fhR/sEF0ieax5uQn7Ly1S6iETvm fzxwvA5rRdov80UeGOnj9UGvyWydD4gkiwIA8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715981867; x=1716586667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wMrmoliKPswHzuEojIBGChDP268r8lDTpqZYT1tgrB0=; b=sD/y3XDBOu9jByekYEcO2LCK8Pvth7VT9VyJwe/EWpQP2PKvXav/L0GZsQW37Pw2HI xuDplqdQrCWl98XmP7t4eMS1w3spIzw2layGcz2Rilh93/5+a1LgH9zhLUCMKYW2nYDy k3p4YGUXDx9549nS4pgMcBikQhA+HYWrpkRUCGk8UjPZIQqZGcIcH9xFgy5WXGf5Fn1k iymw4vD1WFFbAfOer4gYmEuwHgvd11YeLq3p4yAjrgGOqNhhMkoIoRUn77bJdaWesH3n SKhUAlfht9x98OC7WuR3EKk6mBtFp0Q3b7tVUPkaLXbeo+R8HK/InCZjVSLC6o8sstve x1oQ== X-Forwarded-Encrypted: i=1; AJvYcCWbTy0N1+XOY9KmB89waDj9eyfjFoSCE/DP09pdlHNtOF4h5VH5jBtbdVS0Jb9sKIkMmbVixqaafvNxbvIkb2JA+7xjiTMku/SYowIjcE2C X-Gm-Message-State: AOJu0YwfC5678ufafhJS2X8K6JQuGXcI5BvG7SAVtghDk+b3a49QFjsf HwyQyEJ2TBYzQRGAzURtKY3vGHKs4yO7pg5Ann3oG8GiH5vcetZNT2UZVA4TZz/yKveVW7EEWes = X-Google-Smtp-Source: AGHT+IG0DV+RQTrF64BGZMxIPU0+NC5JzIe/lzMpLQ15ksBfa6Z15kVlWjTAgXqC398NIEA3infXfw== X-Received: by 2002:a05:6a21:9988:b0:1ad:886e:ef5a with SMTP id adf61e73a8af0-1b1ca42879dmr436290637.19.1715981867162; Fri, 17 May 2024 14:37:47 -0700 (PDT) Received: from dianders.sjc.corp.google.com ([2620:15c:9d:2:26de:b1dd:5:771c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2b2f8b3sm15168736b3a.211.2024.05.17.14.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 14:37:46 -0700 (PDT) From: Douglas Anderson To: Neil Armstrong , Jessica Zhang , Sam Ravnborg Cc: Linus Walleij , Dmitry Baryshkov , Douglas Anderson , Cong Yang , Daniel Vetter , David Airlie , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/8] drm/panel: himax-hx83102: If prepare fails, disable GPIO before regulators Date: Fri, 17 May 2024 14:36:41 -0700 Message-ID: <20240517143643.6.Id0659a80147cf51e0ebb8fe7fee18db86851960d@changeid> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: <20240517213712.3135166-1-dianders@chromium.org> References: <20240517213712.3135166-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The enable GPIO should clearly be set low before turning off regulators. That matches both the inverse order that things were enabled and also the order in unprepare(). Fixes: 0ef94554dc40 ("drm/panel: himax-hx83102: Break out as separate driver") Signed-off-by: Douglas Anderson Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/panel/panel-himax-hx83102.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-himax-hx83102.c b/drivers/gpu/drm/panel/panel-himax-hx83102.c index 1a6975937f30..4ac7f9d8b232 100644 --- a/drivers/gpu/drm/panel/panel-himax-hx83102.c +++ b/drivers/gpu/drm/panel/panel-himax-hx83102.c @@ -578,13 +578,13 @@ static int hx83102_prepare(struct drm_panel *panel) return 0; poweroff: + gpiod_set_value(ctx->enable_gpio, 0); regulator_disable(ctx->avee); poweroffavdd: regulator_disable(ctx->avdd); poweroff1v8: usleep_range(5000, 7000); regulator_disable(ctx->pp1800); - gpiod_set_value(ctx->enable_gpio, 0); return ret; }