From nobody Thu Nov 28 20:41:59 2024 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A51778493; Fri, 27 Sep 2024 14:16:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727446568; cv=none; b=uVlHW3lNHwNXZq/b1YrOoBXiPUwB+mAFRWTPjvbPO3vf7q+MEyakYFORy8vYZIEeSZccSukQD+zIG53E0pMLGmG+L2XC/lX1mYAOXO27Moxi6Eix43WXUt7CV8AStj6GUk10x0uL/wvVaUp2vUQ1jD6B670uRJ17iPgNq4QaqWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727446568; c=relaxed/simple; bh=Y+KbHIb4oHpeFuLUCsPn+9dosUtmgAlL5hFLy/c3O7c=; h=From:To:Cc:Date:Message-Id:MIME-Version:Subject; b=o++qgoSEtNeCKMkp5V4+zEVtQj1Vo+DuV2Lnf5q0d1D90MAmAUThOkkjYEiAWORzkWt4qybmNUhTkwKoKnjPi3lZh1UDHzgJKJ8HOnJq7xD66aQmlwguKMN2Gp7tlG9y0A73i9hL+PFHZ6gLmQ17sA1pLrLcktCEZoCuMyV2tkA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=WfN/0X3q; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="WfN/0X3q" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=rFY2f6oSwge6XyupmQECSbR1vqc99i87yPhEVwH6LEY=; b=WfN/0X3qoT0Pfn4oZLPNzDrwHD kA1LEpVnfSTZ8ZvHRXwNiwuAkAcQDg25ID4lM82d1DJePJKy02SlN1JVQE8A0KgoSfNKDI2XunotA buyJcTLHjXWT4Zm3RGQEmnFGWmrTpcB24sQs9HXTIfCAhgBkJSZMZRou6wOrA5+K2h8M=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:54798 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1suBQP-0007xB-Uu; Fri, 27 Sep 2024 09:54:26 -0400 From: Hugo Villeneuve To: Jagan Teki , Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Linus Walleij Cc: hugo@hugovil.com, Hugo Villeneuve , stable@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Fri, 27 Sep 2024 09:53:05 -0400 Message-Id: <20240927135306.857617-1-hugo@hugovil.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Subject: [PATCH] drm: panel: jd9365da-h3: fix reset signal polarity X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Content-Type: text/plain; charset="utf-8" From: Hugo Villeneuve In jadard_prepare() a reset pulse is generated with the following statements (delays ommited for clarity): gpiod_set_value(jadard->reset, 1); --> Deassert reset gpiod_set_value(jadard->reset, 0); --> Assert reset for 10ms gpiod_set_value(jadard->reset, 1); --> Deassert reset However, specifying second argument of "0" to gpiod_set_value() means to deassert the GPIO, and "1" means to assert it. If the reset signal is defined as GPIO_ACTIVE_LOW in the DTS, the above statements will incorrectly generate the reset pulse (inverted) and leave it asserted (LOW) at the end of jadard_prepare(). Fix reset behavior by inverting gpiod_set_value() second argument in jadard_prepare(). Also modify second argument to devm_gpiod_get() in jadard_dsi_probe() to assert the reset when probing. Do not modify it in jadard_unprepare() as it is already properly asserted with "1", which seems to be the intended behavior. Fixes: 6b818c533dd8 ("drm: panel: Add Jadard JD9365DA-H3 DSI panel") Cc: Signed-off-by: Hugo Villeneuve Reviewed-by: Neil Armstrong --- drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c b/drivers/gpu= /drm/panel/panel-jadard-jd9365da-h3.c index 44897e5218a69..6fec99cf4d935 100644 --- a/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c +++ b/drivers/gpu/drm/panel/panel-jadard-jd9365da-h3.c @@ -110,13 +110,13 @@ static int jadard_prepare(struct drm_panel *panel) if (jadard->desc->lp11_to_reset_delay_ms) msleep(jadard->desc->lp11_to_reset_delay_ms); =20 - gpiod_set_value(jadard->reset, 1); + gpiod_set_value(jadard->reset, 0); msleep(5); =20 - gpiod_set_value(jadard->reset, 0); + gpiod_set_value(jadard->reset, 1); msleep(10); =20 - gpiod_set_value(jadard->reset, 1); + gpiod_set_value(jadard->reset, 0); msleep(130); =20 ret =3D jadard->desc->init(jadard); @@ -1131,7 +1131,7 @@ static int jadard_dsi_probe(struct mipi_dsi_device *d= si) dsi->format =3D desc->format; dsi->lanes =3D desc->lanes; =20 - jadard->reset =3D devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); + jadard->reset =3D devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(jadard->reset)) { DRM_DEV_ERROR(&dsi->dev, "failed to get our reset GPIO\n"); return PTR_ERR(jadard->reset); base-commit: 18ba6034468e7949a9e2c2cf28e2e123b4fe7a50 --=20 2.39.5