From mboxrd@z Thu Jan 1 00:00:00 1970 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 1B33723C4F8; Mon, 2 Jun 2025 14:11:48 +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=1748873509; cv=none; b=pbK/bjE69Oj2z3/ExV0KG2Lu0mAbkTg0dq3aXwCvDBNtWKGqZwp8wWp6Tb4cJthD+62pxrKQbrBrbtU+JJqVwzFTrroEEAOAaqMVytirVkEp6E/BUpCUW/P1BbeR89UnB3JEcUdnVeNyFnHjjvYFfHgNYW0mmoOD5iFaO/SW/RM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748873509; c=relaxed/simple; bh=oEOQ15XYFH3e49Hx8hY6EGu1XEAA7FA0j1e1AJ6kBE8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qrWgERvs7DQ+UQ/dVrsVZV2OkgPtUwrUzr1IshzhOi068GPn0Wl8DMhFlA+s+4mo+j3JW1vkOu7BfXC6Rhaaz3kSKGC3barw1SDlOXdt/0KcHEYaZ4Qx9f/ln1d6hpYSLxfngoHHE4ionjcGbruPNMLU+lLF4M+4c8pHiBq+aFM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0nWnGPQx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0nWnGPQx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C7ECC4CEEB; Mon, 2 Jun 2025 14:11:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748873508; bh=oEOQ15XYFH3e49Hx8hY6EGu1XEAA7FA0j1e1AJ6kBE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0nWnGPQxWtTV6XL+9Q8UrNGUo8zrd6F+Q3wg6hql8UBDsTMwww32t14MxBRIJ5ZXk G99xxU+TCITid7pyZbisC/7QGupFKJgDkuMDVbqkOoPC3p85iX3QTYWJO5PoE5EY37 F+cOll6tz1Cl5WzM2ZAnJHowv0ReYyijB1/4OojU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, CK Hu , AngeloGioacchino Del Regno , Chun-Kuang Hu , Sasha Levin Subject: [PATCH 6.6 163/444] drm/mediatek: mtk_dpi: Add checks for reg_h_fre_con existence Date: Mon, 2 Jun 2025 15:43:47 +0200 Message-ID: <20250602134347.524992590@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134340.906731340@linuxfoundation.org> References: <20250602134340.906731340@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: AngeloGioacchino Del Regno [ Upstream commit 8c9da7cd0bbcc90ab444454fecf535320456a312 ] In preparation for adding support for newer DPI instances which do support direct-pin but do not have any H_FRE_CON register, like the one found in MT8195 and MT8188, add a branch to check if the reg_h_fre_con variable was declared in the mtk_dpi_conf structure for the probed SoC DPI version. As a note, this is useful specifically only for cases in which the support_direct_pin variable is true, so mt8195-dpintf is not affected by any issue. Reviewed-by: CK Hu Signed-off-by: AngeloGioacchino Del Regno Link: https://patchwork.kernel.org/project/dri-devel/patch/20250217154836.108895-6-angelogioacchino.delregno@collabora.com/ Signed-off-by: Chun-Kuang Hu Signed-off-by: Sasha Levin --- drivers/gpu/drm/mediatek/mtk_dpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dpi.c b/drivers/gpu/drm/mediatek/mtk_dpi.c index 54fc3f819577e..6391afdf202e2 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -410,12 +410,13 @@ static void mtk_dpi_config_swap_input(struct mtk_dpi *dpi, bool enable) static void mtk_dpi_config_2n_h_fre(struct mtk_dpi *dpi) { - mtk_dpi_mask(dpi, dpi->conf->reg_h_fre_con, H_FRE_2N, H_FRE_2N); + if (dpi->conf->reg_h_fre_con) + mtk_dpi_mask(dpi, dpi->conf->reg_h_fre_con, H_FRE_2N, H_FRE_2N); } static void mtk_dpi_config_disable_edge(struct mtk_dpi *dpi) { - if (dpi->conf->edge_sel_en) + if (dpi->conf->edge_sel_en && dpi->conf->reg_h_fre_con) mtk_dpi_mask(dpi, dpi->conf->reg_h_fre_con, 0, EDGE_SEL_EN); } -- 2.39.5