Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp552472rdh; Tue, 19 Dec 2023 06:58:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7QB8T2ojUnx6MJdxm17mes5Rq1wjbo9aHHO+3T5c0svq02YsXEC1nA71d+M8OcY9N6bly X-Received: by 2002:a05:6358:6f09:b0:170:70c5:3d57 with SMTP id r9-20020a0563586f0900b0017070c53d57mr22536830rwn.53.1702997926346; Tue, 19 Dec 2023 06:58:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702997926; cv=none; d=google.com; s=arc-20160816; b=SRBVfYwdxurEGDnprg5nyVqLXr6mbJbUiWYDjS8R7ZAmfkLqB4owmxdBEmZ3q/BTJt +7mPhl7d/qutbSueLpaUgjK9SwD/T1WQLTzte8y/mqpnp0Cv20eMwmSJTnGWcwUrvW0/ MWyRBGlHPxAcP0P0kR8/Dm4P1X194nc8/N5TuH0urj8JqAgVBAboDRrH8SWN85x/6Wnx zW/bwDCeEnfNAgH/00s1sJZoBATsu7gEqTVJ4/cv5F6jGfvv1E63WO40PiT0uhqZesE4 e36JC7fzF263o/us6YL62T+vypM9DuzpKeQnpmuReQ0VCWazJshlvzgUnFQXLwK/s2v+ LBUA== ARC-Message-Signature: i=1; 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=s/kiy+EyoHiEM1ZV0AcyGmIqSBGfNRYrAo9pwLUdKJo=; fh=YBpXnBz4z5WTNuRpmEjjmJAYZAysFFiStO3A7cE8DhM=; b=YJYvzri/io0SX7ndU8nrDu0UVOl3m6oEAJPE5oi48GVVfPfaFtHATcbyTglV60yG04 zY6e36lZl4RSpPtW4XJ68nEUYCGrMGHk2fJo1I75BdCc9Hv3LRsn+HnxUVRx8a4yPlWa o2oKEPImptCDlK8GxeW74TwwEwF/fUnHj2KiHi+h0jKiBSw2nb1Fe5kDwfm8Uv952Pc2 c7eitIHHzACsB2hGR+3Ot2AVp46DNrNb4gnL9QpoIMfy6kyPObqZitLhbvTcP6cTgSiA Vnb3yDOPAyc2gAqITL2eSmOQeRtphXBDmPJdNFekZFixATN+ZlagyxgBG/8H91s7BAXS /yZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=eR0TgaFv; spf=pass (google.com: domain of linux-kernel+bounces-5431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5431-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e15-20020a05622a110f00b00425f146bdb7si15424740qty.613.2023.12.19.06.58.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:58:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=eR0TgaFv; spf=pass (google.com: domain of linux-kernel+bounces-5431-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5431-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 F06CD1C20FA9 for ; Tue, 19 Dec 2023 14:58:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28822374FB; Tue, 19 Dec 2023 14:54:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="eR0TgaFv" X-Original-To: linux-kernel@vger.kernel.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 B205E374EC; Tue, 19 Dec 2023 14:54:47 +0000 (UTC) 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 6F93940008; Tue, 19 Dec 2023 14:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702997685; 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=s/kiy+EyoHiEM1ZV0AcyGmIqSBGfNRYrAo9pwLUdKJo=; b=eR0TgaFv74SLX0l5Cita7+vpYSlCMvCJaQ9tObGKdHHAJA5hsBg6vthhimj+cRldwreQym rZaisRyMrMktg+0PHFV0Vsb0JQgbqaAnqQnz/7fnGO/a4i8wKOgDkC7T/uhbf43bj9b5rB 5d8kRsnvwxhDmhBy4xwfdxtX5vDUrxpTvzYrOkF/6XlYwG64ISTIZKokRm7BIlUa9j+RV/ IyFT2h5WRWJArYi4nlbG+EvVCjSuIFwivplFC4Flgt3zx3GDLCL0cj3sSWDD40RmOUV1BS zNuN2JEYcPbgN7ip5QD24wiQY7Do5g9pOeQMafrWiCQcGP6AKSOyCVObSp6f3w== From: Luca Ceresoli Subject: [PATCH v2 0/6] Add support for the internal RK3308 audio codec Date: Tue, 19 Dec 2023 15:54:15 +0100 Message-Id: <20231219-rk3308-audio-codec-v2-0-c70d06021946@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=H4sIAJeugWUC/x3MQQqAIBBA0avIrBtITdCuEi1MpxqCDKUIorsnL d/i/wcKZaYCvXgg08WF016hGgFh9ftCyLEaVKu0VNJh3rRuLfozcsKQIgX0xhg7ees6F6GGR6a Z7386jO/7ASkiTjpkAAAA 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 of patches adds support to use the internal audio codec of the Rockchip RK3308 SoC. 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, 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 it does not correctly handle receiving those two clocks via the .set_sysclk op. Patch 1 fixes that. Patches 2-4 adds the codec driver along with the bindings and a new helper macro. Patches 5-6 add to the SoC DT file two I2S controllers (those which are internally connected to the internal codec) and the codec itself. Luca Signed-off-by: Luca Ceresoli --- Changed in v2: - largely rewrote the codec driver to use DAPM and lots of improvements and cleanups - removed the RK3308 audio card and related patches, will be sent later - various other changes, listed per-patch --- Luca Ceresoli (6): ASoC: rockchip: i2s-tdm: Fix clk_id usage in .set_sysclk() 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: 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 | 68 ++ include/sound/soc.h | 12 + sound/soc/codecs/Kconfig | 11 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/rk3308_codec.c | 1012 ++++++++++++++++++++ sound/soc/codecs/rk3308_codec.h | 593 ++++++++++++ sound/soc/rockchip/rockchip_i2s_tdm.c | 22 +- 9 files changed, 1819 insertions(+), 6 deletions(-) --- base-commit: f89a0253ea1f519e6866689f0e83857ca276a2e9 change-id: 20231219-rk3308-audio-codec-a5558ba8949d Best regards, -- Luca Ceresoli