From nobody Fri Apr 3 04:34:27 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 AAB181DE3B5 for ; Tue, 17 Feb 2026 06:37:05 +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=1771310225; cv=none; b=ooqeI5AV0JL4mX7tmHa+Lb1cUD4k7xUlrBz4/btsF5LOBwdRDD4DEsb4W/WdMoLCoHlLDeIwn/mNbUuoT7Fe5rYpKVNv7MGWef1QRgClDEh0MQWgijwo9y4JOcbzd3DKK5x8ZFqftCcVwIAZ3vf8RSpQE4Smp0rq3mDhY/A+bb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771310225; c=relaxed/simple; bh=uGjzkrhdhXqwSIJbMckxgT5nNy3d6MsSF3Jryrexppc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XIMlDur5c6/Mt5MvRaN2CswSVamI+DEaez/3nZdkKnpJvwsph+jL9qsyy1Xnq2j98nbX2eeb8FwuORmICrGOpMUkrLDQGCprntkETn0ab+OD4Dh7eOcwexMN9isoyDlLMjmsIH/g/faj6tBqby+2x602DGpuGEdh8EL9xqEAxrE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=njYfn1+L; 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="njYfn1+L" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29607C4AF0B; Tue, 17 Feb 2026 06:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771310225; bh=uGjzkrhdhXqwSIJbMckxgT5nNy3d6MsSF3Jryrexppc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=njYfn1+Lxa9ZOudVq/alNThuCJSvN1gK71IKqFJLD1JYM00ORUiiVfs4XXo3nmv8G CgPLd7fFxSCLj2lzo5qV6dscLvJUDD81qFdO2rJOEmeNWAlDaq0OOyh04OuyPuumvl erKV75LKATxwffKhEYe3UiQNaD++F7fIKWtx5bmQrLNlQJ2pSwvlUJnVqCshM151sH OVntSAdPdtoLPnRwgwyEKl9uF1wtIp53LtHlC18uR8h9XApWDDAH8Ad8FKkwVM3xT5 6DV0q7zLiYGabO0/o234MV2f5Hxdpg3nWh+zRRoDpzFjisXg89TQ4tviByi52ZeV0O eYoiwJhgkWiAg== Received: by wens.tw (Postfix, from userid 1000) id 90D9E5F755; Tue, 17 Feb 2026 14:37:02 +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 1/2] drm/mipi-dbi: Provide option to invert reset GPIO logic Date: Tue, 17 Feb 2026 14:36:43 +0800 Message-ID: <20260217063647.3160826-2-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260217063647.3160826-1-wens@kernel.org> References: <20260217063647.3160826-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