Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2270889rdb; Wed, 21 Feb 2024 02:23:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXEIg8qjr9qqatNmc1a1qf2mBnlY7zJsv55jqsVvB6nF9VTtwPKko8Nopx+rl0O5qxTHvf50xNXB1fh+0XRtgaIPp8tyyT0ensfmu6tdw== X-Google-Smtp-Source: AGHT+IE7S+LBKMRlDCEkvJhR4aElAncqWr9RFwFxZQCYcGJiOeVbI5fzDfGyqzQPPA/bP0DFksb9 X-Received: by 2002:ac8:5e11:0:b0:42d:c84f:3af9 with SMTP id h17-20020ac85e11000000b0042dc84f3af9mr23982448qtx.53.1708511000273; Wed, 21 Feb 2024 02:23:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708511000; cv=pass; d=google.com; s=arc-20160816; b=aYAZ1/gPbxTkRZYc6ddxS2WJE/AANLVghV5bnN3iKMZLYdbYa0FI/2q751Zy3Tex0E AweS+OfWz7jdPCQ86RQgfMLGcy/PU+tUYHyFR7fw6hNw4k9BUEIyxq2tIuHjRrp2/vQq Bzfmscu0JZ1ZSsGjxREH+Q4otTXeANrL3hnEbThewRCmK0RqaV3nkqE+KWTxqVVBmxwu 7YGSDEeJvn8YS6oZc+yQCEpP+Cc4xmjlE7rWloJXZf6HqDg/RleO4KBizAP3PNvboWtv 83Y4Op4P/sXPNWvZy8hKIAMNM3s3GhbtLwj1VX/Iy9i2KY34NvtjQmaDOdtr91PoIJET ovSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=c7Q53kbT3bjQcV8xVao/3i3dAchySM+PlajClMKqNFk=; fh=YBpXnBz4z5WTNuRpmEjjmJAYZAysFFiStO3A7cE8DhM=; b=c5MYS37OCfFQBNfZfjfz+caW1kKVc70TOWEmRVBY8I7L7910uRhN4Qe+E2XSNKdwCj JhE5KQPg62x1nXdHHJ7sQURYElTfaypF7EvCzZd9NrMU7WFs0r9kd5lTmzAn9b5LlkT9 Tp6jL2rDb/Kpo+rCzYiS4l3OdFf6bjvR5ais+iIYCNu35AxuFyvjELYY3o4tpCb9MsRx CIhAsZV6KMHCI2xmm7Ci4I7RAfnFQyUVCFmGUyzwZ+PapB5pNmaVo/+PvWBXXP5F4ePN r9Aqd9bgJOy3iaqmCeW/JlAxH67P7nj8U79ubf8R0ctPqFND+GclhVb5nM+TpBYfa3Mg kHSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Z+C7gWTC; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-74517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u18-20020ac87512000000b0042c66974cc3si9910139qtq.713.2024.02.21.02.23.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 02:23:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Z+C7gWTC; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-74517-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DAAE71C22D35 for ; Wed, 21 Feb 2024 10:23:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 933B23E46D; Wed, 21 Feb 2024 10:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Z+C7gWTC" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (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 4D26B3C493; Wed, 21 Feb 2024 10:23:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708510992; cv=none; b=tGODcfk9yy+pnb815/p/dMKTINj4bLn/n8Ywpt9M1EJ+AsZ6pZJV9Zi/w+6iCyUdMKLNy1ThKk3rzMf0xf08anzre14TWbegYl7MpEMUHKHajinfRmgtEXFhWkDVd1+vkufkHvfPpCdmv1xhNwTrDWdI/RBv0XkgtTADdiGDxYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708510992; c=relaxed/simple; bh=IytAcFRRXdFL1b3NOGD/mw27EjHnUb9QOtyz0ZGguz8=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=mIQxnFwkT2HtyhTc6+4sj3dKiXAtxPB367ICRovNOvOXb93SOY6cIYtBokjFBhTSCKi4hpbS68JJb5+KiEqjtFOjQDTe/HnEu01la2KSCdW3j8eEqAC1JEZhSlxFs3f47AS0d5oGU1M8yYdtjCPB58L4IgZokLihDh6CZGAfj0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Z+C7gWTC; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 25C7C240007; Wed, 21 Feb 2024 10:23:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708510987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c7Q53kbT3bjQcV8xVao/3i3dAchySM+PlajClMKqNFk=; b=Z+C7gWTCwj5OYnsG/9n0xIlEKB4Ifk6Fka8R41FN6StbxnGXofHNAlizuI7zZEahLoJGtl HkYdnSkJfREYGwbNBHwqAyHXb212nK7HprNQiGZz9VG3MybFFtdjvY0f5tJ65xnIZErUzn UERW1wX8uGgvDrLZ9ICO0gl0R4F5PaPc6lxwCGkoqMZ/4pakqlw59CLhJ9ymM+5A19LSqb 9PdqyFq+mFYBM+ngEEXvfnFcymrdIQK54coO0Sj0hOJQ++wOSv0MJC3cM3XpmTTdIPWQ0n MSuHg3E4LbNKtKP5Vcxy6+yRXIZfTIQsQa/+fZJ9qP84+o25j9u82Rk1ybJMsg== From: Luca Ceresoli Subject: [PATCH v3 0/7] Add support for the internal RK3308 audio codec Date: Wed, 21 Feb 2024 11:22:44 +0100 Message-Id: <20240221-rk3308-audio-codec-v3-0-dfa34abfcef6@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAPTO1WUC/32NQQ7CIBBFr9LM2jEU2tq68h6mCwpoJypjoBJNw 93FHsDl+/n//RWiC+QiHKsVgksUiX0BtavAzNpfHZItDFJIVct6wHBTSvSoX5YYDVtnULdt20+ 6H5rBQhk+g7vQe5Oex8IzxYXDZ/tI8pf+1SWJAs1BWNGJUmm608S83MnvDT9gzDl/AXuYUoO2A AAA To: Nicolas Frattaroli , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Heiko Stuebner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: Thomas Petazzoni , linux-rockchip@lists.infradead.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.12.4 X-GND-Sasl: luca.ceresoli@bootlin.com This series adds a driver for the internal audio codec of the Rockchip RK3308 SoC, along with some related patches. This codec is internally connected to the I2S peripherals on the same chip, and it has some peculiarities arising from that interconnection. For proper bidirectional operation with the internal codec at any possible combination of sampling rates, the I2S peripheral needs two clock sources (tx and rx), while connection with an external codec commonly needs only one. Since v5.16 there is a driver for the I2S in sound/soc/rockchip/rockchip_i2s_tdm.c, but in some cases it does not configure correctly the clocks, resulting in an unnecessarily inaccurate rate. Patch 1 fixes this. Patches 2-4 adds the codec driver along with the bindings and a new helper macro. Patches 5-7 add to the SoC DT file two I2S controllers (those which are internally connected to the internal codec) and the codec itself and enable the driver in the ARM64 defconfig. Luca Signed-off-by: Luca Ceresoli --- Changes in v3: - Add the I2S clock fix patch and remove a previous fix which is now superseded - Codec driver: fix silent playback until a given amplitude of sigital value, seen at >= 96 kHz rate - various other changes, listed per-patch - Link to v2: https://lore.kernel.org/r/20231219-rk3308-audio-codec-v2-0-c70d06021946@bootlin.com Changes in v2: - largely rewrote the codec driver to use DAPM and lots of improvements and cleanups - removed the RK3308 audio card and related patches - various other changes, listed per-patch - Link to v1: https://lore.kernel.org/all/20220907142124.2532620-1-luca.ceresoli@bootlin.com/ --- Luca Ceresoli (7): ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates ASoC: dt-bindings: Add Rockchip RK3308 internal audio codec ASoC: core: add SOC_DOUBLE_RANGE_TLV() helper macro ASoC: codecs: Add RK3308 internal audio codec driver arm64: defconfig: enable Rockchip RK3308 internal audio codec driver arm64: dts: rockchip: add i2s_8ch_2 and i2s_8ch_3 arm64: dts: rockchip: add the internal audio codec .../bindings/sound/rockchip,rk3308-codec.yaml | 98 ++ MAINTAINERS | 7 + arch/arm64/boot/dts/rockchip/rk3308.dtsi | 56 ++ arch/arm64/configs/defconfig | 1 + include/sound/soc.h | 12 + sound/soc/codecs/Kconfig | 11 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/rk3308_codec.c | 993 +++++++++++++++++++++ sound/soc/codecs/rk3308_codec.h | 579 ++++++++++++ sound/soc/rockchip/rockchip_i2s_tdm.c | 352 +------- 10 files changed, 1765 insertions(+), 346 deletions(-) --- base-commit: 20fb305a716356265e9479719502b5a012e0d869 change-id: 20231219-rk3308-audio-codec-a5558ba8949d Best regards, -- Luca Ceresoli