From patchwork Fri Jan 31 15:23:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13955453 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BC966C0218F for ; Fri, 31 Jan 2025 15:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=uDsE6V/EzLKygjfsi103+Cqw5B3sCIE/iNovRDbEkzU=; b=ado1KzsNVDfzOT DYH/ZJ37xhf6g7FpEVXnltJ74aRsai8uAD20dsV3gGpwl/Y/lw8qxB8CkB+X9Pm0reb1Eh8t132SN C+9TTCD1ONRSl2cbHVJqCGACINNNC2eZkAiB1QwyNKXa/Y1xOWXvqTANXULtKoERRiH5z3MlfeoUS 13DcnXV4GPQDvZxf25kXElBUukZx2fJGJgGuuNmeLGtuT7mRefOLSu8JufGaqnyp7evnY36mqFkQ/ ABMQynagHKZI8KR3og+ieJfTGatpctpYAE4LtejcBQof9LEuH3hMe7y/p5Mzy0R26QHb772roWJAN hQiq+WK2ywsPE4WyITFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tdsvL-0000000AqDu-001V; Fri, 31 Jan 2025 15:27:15 +0000 Received: from bali.collaboradmins.com ([2a01:4f8:201:9162::2]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tdsu1-0000000Apxn-0V81; Fri, 31 Jan 2025 15:25:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1738337150; bh=Ht4nh+ceSywYcLNTQL84iEYXYJ0KQEw+LSoMn7rFgDk=; h=From:To:Cc:Subject:Date:From; b=LZ3GUwoWr3kPW2fA3CTP18cETdwgHVjVbQ3dl65LVWAiiaKPcprqRAcWHvYMgUM9v D0b7w1Ky4cnhIP9ez8d4aD33p7l+4xRwXcV6GyJCljc0y+yL64QzGmLT9k2uck/wRO ddAbV2kRvsUWxy3Zpztpl+I24kgqHQvqbWPsAnIWL3cbPFVIN/QNp+O7MGv7C3j1i+ gYw5N/Az0Iki5+r0PTy4ndjLrynji+Qj/eBawF3KNMdG91WB8d+f8TBesIoH+z8B0h GGGIvNCPOEcvoQNnrFtbqkmmNo/Aun7oCh70U35BntBcfwOBEsrBlS7OaaNA38kYAT 5jeoyUej1biwA== Received: from trenzalore.hitronhub.home (unknown [23.233.251.139]) (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 3402917E0E99; Fri, 31 Jan 2025 16:25:46 +0100 (CET) From: Detlev Casanova To: linux-kernel@vger.kernel.org Subject: [PATCH v4 0/2] Add HDMI audio on the Radxa ROCK 5B Date: Fri, 31 Jan 2025 10:23:20 -0500 Message-ID: <20250131152438.2891507-1-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250131_072553_337595_DF0BAA1F X-CRM114-Status: GOOD ( 15.54 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Algea Cao , Heiko Stuebner , Geert Uytterhoeven , dri-devel@lists.freedesktop.org, Laurent Pinchart , Andrzej Hajda , kernel@collabora.com, David Airlie , Dragan Simic , Simona Vetter , Rob Herring , Robert Foss , Sebastian Reichel , Jernej Skrabec , Sugar Zhang , linux-rockchip@lists.infradead.org, Alexey Charkov , devicetree@vger.kernel.org, Conor Dooley , Jonas Karlman , Maarten Lankhorst , Maxime Ripard , Dmitry Baryshkov , Johan Jonker , FUKAUMI Naoki , linux-arm-kernel@lists.infradead.org, Neil Armstrong , Jianfeng Liu , Detlev Casanova , Thomas Zimmermann , Krzysztof Kozlowski Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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 ROCK 5B device tree. Based on Linus' master branch. [1]: https://lore.kernel.org/all/20241224-drm-bridge-hdmi-connector-v10-0-dc89577cd438@linaro.org/ 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 (1): arm64: dts: rockchip: Add HDMI0 audio output on rock-5b Sugar Zhang (1): drm/bridge: synopsys: Add audio support for dw-hdmi-qp arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 1 + .../boot/dts/rockchip/rk3588-rock-5b.dts | 19 + drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 497 ++++++++++++++++++ 3 files changed, 517 insertions(+)