From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1B111075262 for ; Thu, 19 Mar 2026 06:37:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5448410E8A1; Thu, 19 Mar 2026 06:37:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="saWBZ+rn"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9406210E8A0 for ; Thu, 19 Mar 2026 06:37:16 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id F2AC0444DF; Thu, 19 Mar 2026 06:37:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 9DC92C19425; Thu, 19 Mar 2026 06:37:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773902235; bh=Tvh/ZMrQYmKux1TR6qR4iLxN0MQAoNlck4Q6TwaE9JU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=saWBZ+rnqxU3UAUa7j1reewnUzdvckNRpTRh9HQLPpcy0A3m0cuAkXC1LLf91YnkZ YGXTd4hu9nn5sm1GnDV9CHbPcutSAIwy0OhGmD8lArmfPN2CYV7pHfDJInnSizplAl kg8ET1L5X5zDAHDpMI8AflFjxHBv/fBY0rfU8PC3vowuHwn4vtUiKCTWyYZ7FwVbhg Nq8wr1I1Y8M8CCRx3wHjTtfVkWhJ+iMNJ3lzaFTskx7NPdpKHhdV3vXz26czMFnXZj m1yt/Mk8tvssS4PlrDLB8dEPtbNIwb/pPhOPJp/PN5JJ4bfS2bmh36zY7PQSqRx2xU n+NEt2+Wg3KBQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 912FA1075262; Thu, 19 Mar 2026 06:37:15 +0000 (UTC) From: Hermes Wu via B4 Relay Date: Thu, 19 Mar 2026 14:37:12 +0800 Subject: [PATCH v4 2/2] drm/bridge: Add ITE IT6162 MIPI DSI to HDMI bridge driver MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260319-upstream-6162-v4-2-7268483ef03d@ite.com.tw> References: <20260319-upstream-6162-v4-0-7268483ef03d@ite.com.tw> In-Reply-To: <20260319-upstream-6162-v4-0-7268483ef03d@ite.com.tw> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Pet.Weng@ite.com.tw, Kenneth.Hung@ite.com.tw, Hermes Wu , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Hermes Wu X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773902234; l=50563; i=Hermes.wu@ite.com.tw; s=20241230; h=from:subject:message-id; bh=IGEyYAbss4vIx39eW0w7OT4lxtlJh3K1lE9LY7l9sKE=; b=KlpMCglUgsgdEFRdwbmJ1lFojeRuWHzyUSLP2lOX3AaqHc8hDzOO2qFu7dcxFz0EUoD7o5CTL OLVQRc1YRerClqv7Ffs2h1OTn0xCWxxHNuVEgMHAD1pTibTQa5Sc5y3 X-Developer-Key: i=Hermes.wu@ite.com.tw; a=ed25519; pk=qho5Dawp2WWj9CGyjtJ6/Y10xH8odjRdS6SXDaDAerU= X-Endpoint-Received: by B4 Relay for Hermes.wu@ite.com.tw/20241230 with auth_id=310 X-Original-From: Hermes Wu X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Hermes.wu@ite.com.tw Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Hermes Wu Add support for the ITE IT6162 MIPI DSI to HDMI 2.0 bridge chip. The IT6162 is an I2C-controlled bridge that supports the following configurations: - Single MIPI DSI input: up to 4K @ 30Hz - Dual MIPI DSI input (combined): up to 4K @ 60Hz The driver implements the DRM bridge and connector frameworks, including mode setting, EDID retrieval, and HPD support. Also add a MAINTAINERS entry for the newly introduced ITE IT6162 MIPI DSI to HDMI bridge driver, covering the driver source file and the device tree binding document. Signed-off-by: Hermes Wu --- Changes in v4 * Drop struc it6162_audio * Add HDCP_AUTO in enum hdcp_ver{}, FW enable HDCP by sink capability. * Call drm_atomic_helper_connector_hdmi_clear_audio_infoframe() in it6162_bridge_hdmi_audio_shutdown() * Drop it6162_bridge_hdmi_audio_startup() * Add hdmi_clear_hdmi_infoframe and hdmi_write_hdmi_infoframe * Drop it6162_parse_dt() due to "ite,support-hdcp" is removed from DT. * Add DRM_BRIDGE_OP_HDMI to it6162->bridge.ops Changes in v3: * Fix OFFSET_VERSION_H register offset from 0x03 to 0x05 * Add MIPI_PORT_EN_MASK macro combining MIPI_PORT1_EN_MASK and MIPI_PORT0_EN_MASK * Rename HDCP enums: NO_HDCP -> HDCP_DISABLE, NO_HDCP_STATE -> HDCP_STATE_IDLE, AUTH_DONE -> HDCP_STATE_AUTH_DONE, AUTH_FAIL -> HDCP_STATE_AUTH_FAIL * Rename it6162_infoblock_complete() to it6162_wait_command_complete() * Rename it6162_infoblock_host_set() to it6162_infoblock_trigger() * Remove it6162_infoblock_mipi_config() and it6162_infoblock_write_msg() wrappers, inline into it6162_reset_init() and it6162_mipi_set_video_timing() respectively * Remove it6162_set_default_config() wrapper, inline into it6162_reset_init() * Fix typo: hdcp_encyption -> hdcp_encryption * Fix typo: it6162_hdcp_read_infomation -> it6162_hdcp_read_information * Remove dev_err_probe() usage outside of probe path * Remove verbose success-path dev_info/dev_dbg logging throughout * Replace __func__ usage in error messages with descriptive strings * Fix double error printing in probe for it6162_init_pdata failure path * Fix uninitialized variable warning: initialize cp_status to DRM_MODE_CONTENT_PROTECTION_DESIRED at declaration; move drm_hdcp_update_content_protection() inside the state-change block * Fix audio sample width mapping: case 20 now maps to WORD_LENGTH_20BIT, case 24 to WORD_LENGTH_24BIT * Remove stray drm_dbg("it6162_bridge_atomic_disable") call * Remove drm_dbg() calls from it6162_display_mode_to_settings() * Drop unused struct it6162 * parameter from it6162_avi_to_video_setting() and it6162_display_mode_to_settings() * Fold it6162_set_default_config() body directly into it6162_reset_init(), removing the wrapper * Fix it6162_infoblock_request_data(): split command complete polling and buffer status check into two steps; use wait_event_timeout() for data_buf_sts since it is updated asynchronously by the interrupt handler; add wait_queue_head_t data_buf_wait to struct it6162 and wake_up() in interrupt handler --- MAINTAINERS | 7 + drivers/gpu/drm/bridge/Kconfig | 17 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/ite-it6162.c | 1628 +++++++++++++++++++++++++++++++++++ 4 files changed, 1653 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 30f3472c72933c93b9237d93ad35802d6dda75f1..9c6e7c02227e810f280d2bfaa73e0eb572db0119 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -13640,6 +13640,13 @@ W: https://linuxtv.org Q: http://patchwork.linuxtv.org/project/linux-media/list/ F: drivers/media/tuners/it913x* +ITE IT6162 MIPI DSI TO HDMI BRIDGE DRIVER +M: Hermes Wu +L: dri-devel@lists.freedesktop.org +S: Maintained +F: Documentation/devicetree/bindings/display/bridge/ite,it6162.yaml +F: drivers/gpu/drm/bridge/ite-it6162.c + ITE IT6263 LVDS TO HDMI BRIDGE DRIVER M: Liu Ying L: dri-devel@lists.freedesktop.org diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 1cabfa1d2b2efc6fca68619eea6050fe96a892e8..1a8fe59506cf60958babb48429b842ca3aecc755 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -107,6 +107,23 @@ config DRM_INNO_HDMI select DRM_DISPLAY_HELPER select DRM_KMS_HELPER +config DRM_ITE_IT6162 + tristate "iTE IT6162 DSI to HDMI bridge" + depends on OF + select REGMAP_I2C + select DRM_MIPI_DSI + select DRM_PANEL_BRIDGE + select DRM_KMS_HELPER + select DRM_HDMI_HELPER + select DRM_DISPLAY_HDMI_HELPER + select DRM_DISPLAY_HDCP_HELPER + select DRM_DISPLAY_HELPER + help + Driver for iTE IT6162 DSI to HDMI bridge + chip driver that converts DSI to HDMI signals + support up to 4k60 with 2 MIPI DSI + Please say Y if you have such hardware. + config DRM_ITE_IT6263 tristate "ITE IT6263 LVDS/HDMI bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index fb0cf0bf88756bed8323830c80f3f1d066b51e36..3a199b27b3bbe8294a5bef6c82cfee4cd7b8a34e 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -11,6 +11,7 @@ tda998x-y := tda998x_drv.o obj-$(CONFIG_DRM_I2C_NXP_TDA998X) += tda998x.o obj-$(CONFIG_DRM_INNO_HDMI) += inno-hdmi.o +obj-$(CONFIG_DRM_ITE_IT6162) += ite-it6162.o obj-$(CONFIG_DRM_ITE_IT6263) += ite-it6263.o obj-$(CONFIG_DRM_ITE_IT6505) += ite-it6505.o obj-$(CONFIG_DRM_LONTIUM_LT8912B) += lontium-lt8912b.o diff --git a/drivers/gpu/drm/bridge/ite-it6162.c b/drivers/gpu/drm/bridge/ite-it6162.c new file mode 100644 index 0000000000000000000000000000000000000000..09274468dc73f8fbe786dc983d9340c77b70ed48 --- /dev/null +++ b/drivers/gpu/drm/bridge/ite-it6162.c @@ -0,0 +1,1628 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2024 ITE Tech. Inc. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include