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 37B51226D12; Mon, 2 Jun 2025 14:55:39 +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=1748876139; cv=none; b=luXcNxTU3togVDudC2CFPMjdifA+z1nvSR504eRXUScmG1wMSqyuHdRd7gBAIhx6eh73Eu2bWa7YIH4QeVM5rG/nLQKDZ45ae9ox5/BITAhEXgqgOx4YvooDVzw8Wkb/UWRjnvxLFkJ2JFFkBq/fdPDiJh1BAuxw3VYXnOlKLak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748876139; c=relaxed/simple; bh=xrZaNTxVw/k9W7vnlPFPjIQLm+VK2705HI+gQJLCjMo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eudv5JyX8Ekhyi6b7ZjtrC2fBEG0Z5EX+N8qdLfmY8vvB1iS5Jp2QGAHvEQvq9anYv51LrNZgRXZXI+X6VYUjflt6mcKz7CW5kjwRng+D+oTT4I1um8dyzNpcJekGRx+6mH/GFfx2eStLg7OvpYZRGTrTIpWLUJT3CEWqA6ios4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IHw2PovB; 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="IHw2PovB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 987BFC4CEEB; Mon, 2 Jun 2025 14:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748876139; bh=xrZaNTxVw/k9W7vnlPFPjIQLm+VK2705HI+gQJLCjMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IHw2PovBb8np3js2dWdkx8iJvfs5OJxNg8xXvuB+QKFlOsg451Vg3ridM3DGoBJlD 4LGS1BPevMRk5VqjcAglXnZCHyAz3zARCOySwzvhtTob/y5whWgU1SAgYWYL15jfRI 1qyWdZsBs3MEV/GLAjE140WffGaFM0Fwfgwq3CC4= 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 5.15 082/207] drm/mediatek: mtk_dpi: Add checks for reg_h_fre_con existence Date: Mon, 2 Jun 2025 15:47:34 +0200 Message-ID: <20250602134301.952749983@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134258.769974467@linuxfoundation.org> References: <20250602134258.769974467@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 5.15-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 9518672dc21b3..3f39109b69154 100644 --- a/drivers/gpu/drm/mediatek/mtk_dpi.c +++ b/drivers/gpu/drm/mediatek/mtk_dpi.c @@ -346,12 +346,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