From patchwork Fri Feb 14 16:43:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13975264 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 C68C0C02198 for ; Fri, 14 Feb 2025 16:47:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4832610ED10; Fri, 14 Feb 2025 16:47:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="pNEiFYbR"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9F46B10ED10 for ; Fri, 14 Feb 2025 16:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1739551623; bh=e93WMTX324UPBYpzF8zp+DIsYjQOE6P2V+HVCGC9Dvk=; h=From:To:Cc:Subject:Date:From; b=pNEiFYbR4xbtlhNmC3ZBXWgXW4ymzif8S2mhPyUzPkZGMGLqqP0wkp7wa2ZdisR3X T+PAVkg9aBZOZOJzZEdNCBgP2YpWB9gpgalb5DfMFzSCco1GDgLO3vlCbyvf8t+uXD TOMpZlbTmEMGAmHpmPuJQ24QgluhyLtEC6ISv8YCSNzv7N6CE5fQwwop337htcUnrk piAFL37JB2tkvqWmIHiMVZcBnwqByf0niUJ55c/6crcqBbi4d6Bma0+NP+oyrPbVXf hYBd8jBXTpPHc80UMPeeu4NP/ViYix9VcNGpR8KZYZCFlYQtUoOjewbHR3NVHhX2Z1 YKtaFJu4jSeuQ== Received: from earth.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by bali.collaboradmins.com (Postfix) with ESMTPSA id 901DD17E0FDF; Fri, 14 Feb 2025 17:46:59 +0100 (CET) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sebastian Reichel , Alexey Charkov , Cristian Ciocaltea , Niklas Cassel , Dragan Simic , FUKAUMI Naoki , Johan Jonker , Detlev Casanova , Geert Uytterhoeven , Dmitry Baryshkov , Algea Cao , Chen-Yu Tsai , Sugar Zhang , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org, kernel@collabora.com Subject: [PATCH RESEND v6 0/3] Add HDMI audio on the rk3588 SoC Date: Fri, 14 Feb 2025 11:43:59 -0500 Message-ID: <20250214164528.534278-1-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To support HDMI audio on the rk3588 based devices, the generic HDMI Codec framework is used in the dw-hdmi-qp DRM bridge driver. The implementation is mainly based on the downstream driver, ported to the generic HDMI Codec framework [1] recently merged in the master branch. The parameters computation has been kept as is and the data stored in the dw_hdmi_qp struct as been cleaned up. The table for the N values has been edited to reflect N recommended values as well as CTS recommended values. The downstream kernel also implements a machine driver for HDMI audio but it is doing exactly what the simple-audio-card driver does, so use that instead in the RK3588 SoC device tree. Based on Linus' master branch. RESEND because of a network connectivity loss at the wrong time. [1]: https://lore.kernel.org/all/20241224-drm-bridge-hdmi-connector-v10-0-dc89577cd438@linaro.org/ Changes since v5: - Simplify audio math computation for N - Move hdmi0-sound node up with other address-less nodes Changes since v4: - Moved hdmi0_audio node the rk3588-base.dtsi - Enable hdmi0_audio in rk3588-rock-5b.dts Changes since v3: - Renamed function to start with dw_hdmi_qp Changes since v2: - Also clear the audio infoframe - Write AUDI_CONTENTS0 to its default value in case it gets overwritten. - Store tmds_char_rate in the dw_hdmi_qp struct in atomic_enable - Clear tmds_char_rate in atomic_disable and only write registers when tmds_char_rate is not 0. - Do not use connector_state duplicates Changes since v1: - Remove useless audio_mutex (was used downstream for multiple drivers access to audio functions) - Let hdmi_codec build and setup audio infoframes - Only access audio registers when connector is connected - Rebased on master branch Detlev Casanova (2): arm64: dts: rockchip: Add HDMI0 audio output for rk3588 SoC arm64: dts: rockchip: Enable HDMI0 audio output for Rock 5B Sugar Zhang (1): drm/bridge: synopsys: Add audio support for dw-hdmi-qp arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 17 + .../boot/dts/rockchip/rk3588-rock-5b.dts | 8 + drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 489 ++++++++++++++++++ 3 files changed, 514 insertions(+)