From nobody Fri Apr 3 04:58:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 40860308F3B for ; Tue, 17 Feb 2026 09:27:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771320472; cv=none; b=rnS29whfnndFltWWjd0cLj3iqXK876H2pQ2gtaLS7Rg1nQ1Sdi28M/fGHcHpzKjka0mro5TkGkwVaAJid1kyXMrmO9SckQ/pSnKSrOwf+/HGJDFsBCWRom3oZt4/7SzWekV2XrgvdnkQwPJOa86HHVAxXfdiI6lUpKUJkFtSPeE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771320472; c=relaxed/simple; bh=uGjzkrhdhXqwSIJbMckxgT5nNy3d6MsSF3Jryrexppc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=heMxv1xb2RWiiiveTY28mz/bY1tA7iE5GNgPt2l9dfEw45THg33f17DIZdGS9CxcOSToJTMkpliGVYLjCQtFOWW9oeMGfd7bpcfMEyMfmbElV23xyVMIrXFA9INaUecyYwy+iJ5clVPpM4jBCxWuDsOBIvFT+NaMQhVPhMum7ps= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BNxc2S46; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BNxc2S46" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE8B4C4CEF7; Tue, 17 Feb 2026 09:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771320471; bh=uGjzkrhdhXqwSIJbMckxgT5nNy3d6MsSF3Jryrexppc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BNxc2S46X9YlRIjj8PaWuj5CWyzTLESuP33i3mE8orNt0R+b5ZOBXjsScD8tBb77v iIZPaZ1m+II5eVo6mn4mw0z6VhnIgWupnEQUzvyPnUTxNabUUVS3OVtfpCixOfwky5 QUYfVfgOGIC4wCvwK5DlJoXsJeWB+N/1EIrneg40PNbu6oiuxIk8TomIk8zQYqK036 16MsqPOYyDo+8fxlpUw9F7lq4cEHUBtMVpm93qBabUgSmOsvXezKoUfuDqpWQIBvIf g6/R8lF+LnjixCIrdCaCaWm2qjYbsvmpd9EAerdmx281hsI/bLFvmQgCVjtyO6AU6H chnrY2iCDfWOg== Received: by wens.tw (Postfix, from userid 1000) id 8BF955F755; Tue, 17 Feb 2026 17:27:49 +0800 (CST) From: Chen-Yu Tsai To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: Sebastian Reichel , Gerald Loacker , Michael Riesch , Miquel Raynal , Chen-Yu Tsai , David Airlie , Simona Vetter , Archit Anant , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [RFT PATCH v2 1/2] drm/mipi-dbi: Provide option to invert reset GPIO logic Date: Tue, 17 Feb 2026 17:27:36 +0800 Message-ID: <20260217092738.3238016-2-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260217092738.3238016-1-wens@kernel.org> References: <20260217092738.3238016-1-wens@kernel.org> 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 Content-Type: text/plain; charset="utf-8" When mipi_dbi (tinydrm) was added, the reset handling assumed that "logic high" or "active" was out of reset, while "logic low" or "inactive" was in reset. This is the opposite of how many reset bindings are written, wherein "active" means the reset is active, i.e the device is put or held in reset. Provide an option to invert the logic so that drivers for bindings with "active is in reset" using mipi_dbi can use the common reset handling. Signed-off-by: Chen-Yu Tsai --- drivers/gpu/drm/drm_mipi_dbi.c | 4 ++-- include/drm/drm_mipi_dbi.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index 00482227a9cd..7fa1f73a38a4 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -713,9 +713,9 @@ void mipi_dbi_hw_reset(struct mipi_dbi *dbi) if (!dbi->reset) return; =20 - gpiod_set_value_cansleep(dbi->reset, 0); + gpiod_set_value_cansleep(dbi->reset, dbi->invert_reset ? 1 : 0); usleep_range(20, 1000); - gpiod_set_value_cansleep(dbi->reset, 1); + gpiod_set_value_cansleep(dbi->reset, dbi->invert_reset ? 0 : 1); msleep(120); } EXPORT_SYMBOL(mipi_dbi_hw_reset); diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h index f45f9612c0bc..6cebf74bcecc 100644 --- a/include/drm/drm_mipi_dbi.h +++ b/include/drm/drm_mipi_dbi.h @@ -44,6 +44,15 @@ struct mipi_dbi { */ bool swap_bytes; =20 + /** + * @invert_reset: Invert reset logic level. + * + * This is needed as drm_mipi_dbi (formerly tinydrm) introduced reset + * GPIO controls with "logic high" being "out of reset", while other + * bindings typically have "logic high" as "in reset". + */ + bool invert_reset; + /** * @reset: Optional reset gpio */ --=20 2.47.3