Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp637379lqs; Fri, 14 Jun 2024 00:31:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPUq5QNVpP7gAuyYkOxyLOxlAkEwm1Ij3L3N7pG5szYsD0Eg1/JB0RRjpICzvSNAIx1+IqokQxmuLV2Fd+osMDDswWZB7hAOFHHsdkig== X-Google-Smtp-Source: AGHT+IF9F/w6mw8hfYHKMIP+5zbItNhXxGmOOe060P1fO8s6u3Y8EmsVpxciV8rCJDHWvehP+4fa X-Received: by 2002:a50:c05e:0:b0:57c:74fb:6e31 with SMTP id 4fb4d7f45d1cf-57cbd9066bdmr1162330a12.35.1718350262821; Fri, 14 Jun 2024 00:31:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718350262; cv=pass; d=google.com; s=arc-20160816; b=w0JllbrwEffPFl77ud1mgVVy2uF0EcQJff/Y/1yWU+RfV41uHuun2+Qn3pILIbt+G3 Gyx69bPo+A+jc2ggx49MNn5L80IBonL8aIt0JLye8qgICKJBS+klVZy9hZjmDRtVexaR h64L4AJChqEQzjqaTVeGmIITIJjC7SdVd38eKxF1IXDJzLnZGqOeVkc1O+l1GB2yOh9X zF9oHB97hm9Qnh3zHk+19cdfaLpXbj4F4M8oxJTOsZx++ELG5vI/KamXLsk30e9DVucB zBuEl5+nM6i7r0fTx0YbBEeILuVmx3/t0z0bRw2Ly7n5i3euFbYK0yq912jgwFvOr8Y/ 6R9w== 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=s9IoM7ubfwjCRGp2OqRR9/s+nq5WA6taakqxn5di/mM=; fh=f3iIihc7rrDt4sB9vjHp+ZQ8+ZE+ASnAPyp/xHMJJdA=; b=PVyMvUBDgvTgKNKU4G9Ps9v66tutuYEOJzC0nvVQuAP5g6n9PGLrQfNFTfH0UB/puS 0H9c1Y8+QV36KNRmkBKaKAgsRHC+KVlfYIxObgFfu/V2Qq/jFwcayS75JRysQFd7JXmc AuOswSHT3P8qoTGFxHB20pM1FV+wbPqdQVl1uWdt2JhPGXmLDQF5dv1k5ZBE7cX080Ek 5OF7u4KEUrwa8kO4MZXXn3hgTjiFRuJu3U3By7FD2wCqN/F1STI1aoCcARceGPdU+Ium 87jje+FfGByyDp+nqjJRDJNq6Kr81I1fNkoKktDDy1g5sQ6NEZpAZE777ooZ3E+Yr3Ji uZNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=GFvDZvoA; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-214448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214448-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb7447ae5si1564153a12.473.2024.06.14.00.31.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 00:31:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=GFvDZvoA; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-214448-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214448-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6CC3B1F254A1 for ; Fri, 14 Jun 2024 07:28:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0AAA6149DEF; Fri, 14 Jun 2024 07:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="GFvDZvoA" Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6AF814884E for ; Fri, 14 Jun 2024 07:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718350084; cv=none; b=oMS2e4ZykB6C2Kx1bpU0glxN7/PqWa+IDFWT81FGQqDHEumI/F0DdpJG65c+wfRnCC6aguyYcN2HycPvVlxOLHMaWoO6uUT0f1SIurKoGVp6Z2rIu0s6rwmjMyEaOe3iFP1qIAnpUx5+JQH0rUoZ5oTwkGBFstDOY2zWUpZ4piA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718350084; c=relaxed/simple; bh=6mA9w0EQq5o6RRMrcQA5mF6HTvpiguhhgrxdASPo2e0=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=Ax+hhgbritTC3S7eO2mxKLfBI+R/rbOmbANpnQkn+tkuof0yljZOZrHwSBP7r1jmUVO70/hkcVzxOU2H0q9YZQl6XjFaObpJBHiHiWEpzRW200b6JpS/Y27sZVpkkQLCX2BF1vGs1z2LKTZh5FPVTdjq0FtydL9T3JjQ9UnjV1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=GFvDZvoA; arc=none smtp.client-ip=209.85.167.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5295e488248so2061894e87.2 for ; Fri, 14 Jun 2024 00:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718350081; x=1718954881; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=s9IoM7ubfwjCRGp2OqRR9/s+nq5WA6taakqxn5di/mM=; b=GFvDZvoAn5F3RLwJI0MtbIQ+XL0v1Emt9g3ucSbchPlmMJsx68h+56qMtWXRiM6k/C 3pEb3YV05s/9PwC1Zc8k4s+spqiFasHMTbchWTRUa5brPll2lWmfl1GBpZL+uT/1Wqy3 5KV6Y61LcA6RsPIwtGJhpjvMpYNd7DL5GVQgTz42ZZg8Pv8YdxmmCtnSdlt2lc5kjlfd R4Av/4a6qEs07//AJ4iYJHnCZVpgsE/qO0/PL3Bne66sFZd4oddMDRXHhkljF1T+3m62 0FbnQUPz97Oe9V9AmzaAnZ5F0Dd1ehN41k/TZgrDAmPMY7cjCHgffGViKVJEXPW7gpEy Fphw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718350081; x=1718954881; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s9IoM7ubfwjCRGp2OqRR9/s+nq5WA6taakqxn5di/mM=; b=PX9Zo30i2azevrb/rA9inqcOXg5yTyUV3DdwKxI+w9NWYohFsR7J3hJcViVjP6ftTs f1QISiE/bKVBkASbN6VlpN7Wda3r+NZWNg0r9hAoDnzQZatfV+oUH8rmn+hdXw8K+74L yVcHt9A/y6cVaE3cTsA2lSH6lnrdeIDqv8034kKqvl9nDFKXa2z3U1XX4tDynHgYukXd EN4QHxQdbMVpiJuJaftTHH/KZ7V9w5Ht6JozJ1iWA1xWn0vwowWCU8wHb4AFcvSMSSJu o5+kxWvoTQlTTjv+QY7v1F8ccQDuX9s+rBGT+dw4rUweCBie76QlQWX485/i128tbCfE 14Xg== X-Forwarded-Encrypted: i=1; AJvYcCVK+s+k6vH3OUf05p0n6kpgxSigCM4T2sv+KhdGncKeYw2J+ACosUsnzUtXoMIr7DuAQx9jftoQXmESKIItEAqUprwIFhdTZQYVk6O9 X-Gm-Message-State: AOJu0YxIS5ar5tnkux+vrLATjcaa019txNX09SbM1bVAg5cDCQPH7eyk AZPYMCBjB+VPJBzUylGgPAvNK5uGtLbTfdroABNhS7oUq84+XecGp77Jqnz2mK8= X-Received: by 2002:ac2:5e79:0:b0:529:b632:ae4e with SMTP id 2adb3069b0e04-52ca6e55cf9mr1142689e87.2.1718350080874; Fri, 14 Jun 2024 00:28:00 -0700 (PDT) Received: from [127.0.1.1] ([93.5.22.158]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-36075104b2esm3535773f8f.101.2024.06.14.00.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 00:28:00 -0700 (PDT) From: Alexandre Mergnat Subject: [PATCH RESEND v5 00/16] Add audio support for the MediaTek Genio 350-evk board Date: Fri, 14 Jun 2024 09:27:43 +0200 Message-Id: <20240226-audio-i350-v5-0-54827318b453@baylibre.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 To: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Lee Jones , Flora Fu , Jaroslav Kysela , Takashi Iwai , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Catalin Marinas , Will Deacon , Rob Herring , Krzysztof Kozlowski Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Alexandre Mergnat , Krzysztof Kozlowski , Nicolas Belin X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5809; i=amergnat@baylibre.com; h=from:subject:message-id; bh=6mA9w0EQq5o6RRMrcQA5mF6HTvpiguhhgrxdASPo2e0=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBma/D+4o7mUCLHzgUTyyTd19/m/OIX5wyM35S6Ro6f vyCUjcCJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCZmvw/gAKCRArRkmdfjHURYrrD/ 46Bl7UukNdZ1mmx9xyLzjuAGddTGNxhqBafqECIuekGVdt3+Zt5+FAqnrETRS3r/RYb9sUf+bQ+Hhh Yp0tDYgZFt/M4gTmOJaobXz9V/gckgfnUCrhrPjdjdQwNUANF2LaLtmmao0m6H9uq6EZ3F6AvWtO7k NQTdMhnno1qKPbYP75nDdpH60vNQiNEOE66FHWXbYlXGTfvv+7nkF8ourvZ8CJ9T2ufQTBeHmXijai NYEmOlMWvcYUtlgQUj9YV4W+4nA6qwmKrt5UI3MCgBZUc6+F1nGuymtIH2kOijwy52T29OmefzSDlc iTfdiY/jdXwAkSu9l/5FJ+M/rZHcol4YhQYAcaRU/sicl/3XxWSEkHIbBAIFCl3GzS6np0csxNzpwV IEkIYjS2vuzpY57x4F+1YB/xbm/6X6PIQ++QUB2nMkgjVf5UNvNwxWxrwUTF8PZ1HnWvZuqTzrK4hs rpM3OcWGIZ6YOTbBoPnBPlSTq3JMsPkEh0VOJZpzyEA8VZnlrvqTShwwZXjtfXXsOY7kJIB3gtV/1q fgyvIJD58sdPhmJvjZqcSfo0hiUqk0FGGe33KY00USqRTrPaH85YV23ckIkMrKxDnMDA8e6/zc3f/5 LdKWGIMkjKzKTIKhB5fMMGpSSGGxw4xDXJH8qDZ867TtTWsNwUVtJO+rYGlA== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 This serie aim to add the following audio support for the Genio 350-evk: - Playback - 2ch Headset Jack (Earphone) - 1ch Line-out Jack (Speaker) - 8ch HDMI Tx - Capture - 1ch DMIC (On-board Digital Microphone) - 1ch AMIC (On-board Analogic Microphone) - 1ch Headset Jack (External Analogic Microphone) Of course, HDMI playback need the MT8365 display patches [1] and a DTS change documented in "mediatek,mt8365-mt6357.yaml". Applied patch: - mfd: mt6397-core: register mt6357 sound codec Test passed: - mixer-test log: [3] - pcm-test log: [4] [1]: https://lore.kernel.org/all/20231023-display-support-v1-0-5c860ed5c33b@baylibre.com/ [2]: https://lore.kernel.org/all/20240313110147.1267793-1-angelogioacchino.delregno@collabora.com/ [3]: https://pastebin.com/pc43AVrT [4]: https://pastebin.com/cCtGhDpg [5]: https://gitlab.baylibre.com/baylibre/mediatek/bsp/linux/-/commits/sound/for-next/add-i350-audio-support Signed-off-by: Alexandre Mergnat --- Changes in v5: - Rebase to "next-20240523" branch. - bindings: power supply property moved to the parent node - Replace "SoC" by "ASoC" in the patch title (5/16) - Move and rename DAI I2S's defines - Improve code readability and cleanup - Link to v4: https://lore.kernel.org/r/20240226-audio-i350-v4-0-082b22186d4c@baylibre.com Changes in v4: - Rebase to "next-20240422" branch. - Re-pass dt_binding_check, functionnal tests, mixer test and pcm test. - Remove copyright changes. - Move mt6357 audio codec documention from mt6357.yaml to mediatek,mt6357.yaml - Fix broken indentation in mt8365-evk.dts - Remove empty node. - Add more dai link name according to the HW capability. - Remove spurious property (mediatek,topckgen) from mediatek,mt8365-afe.yaml - Rename "afe" to "audio-controller" in the documentation. - Link to v3: https://lore.kernel.org/r/20240226-audio-i350-v3-0-16bb2c974c55@baylibre.com Changes in v3: - Re-order documentation commit to fix dt_binding_check error. - Remove $ref and add "mediatek," prefix to vaud28-supply property. - Link to v2: https://lore.kernel.org/r/20240226-audio-i350-v2-0-3043d483de0d@baylibre.com Changes in v2: - Documentation fixed: - Remove spurious description. - Change property order to fit with dts coding style rules. - micbias property: use microvolt value instead of index. - mediatek,i2s-shared-clock property removed. - mediatek,dmic-iir-on property removed. - mediatek,dmic-irr-mode property removed. - Change dmic-two-wire-mode => dmic-mode to be aligned with another SoC - Remove the spurious 2nd reg of the afe. - Manage IIR filter feature using audio controls. - Fix audio controls to pass mixer-test and pcm-test. - Refactor some const name according to feedbacks. - Rework the codec to remove spurious driver data. - Use the new common MTK probe functions for AFE PCM and sound card. - Rework pinctrl probe in the soundcard driver. - Remove spurious "const" variables in all files. - Link to v1: https://lore.kernel.org/r/20240226-audio-i350-v1-0-4fa1cea1667f@baylibre.com --- Alexandre Mergnat (14): ASoC: dt-bindings: mediatek,mt8365-afe: Add audio afe document ASoC: dt-bindings: mediatek,mt8365-mt6357: Add audio sound card document dt-bindings: mfd: mediatek: Add codec property for MT6357 PMIC ASoC: mediatek: mt8365: Add common header ASoC: mediatek: mt8365: Add audio clock control support ASoC: mediatek: mt8365: Add I2S DAI support ASoC: mediatek: mt8365: Add ADDA DAI support ASoC: mediatek: mt8365: Add DMIC DAI support ASoC: mediatek: mt8365: Add PCM DAI support ASoC: mediatek: mt8365: Add the AFE driver support ASoC: mediatek: Add MT8365 support arm64: defconfig: enable mt8365 sound arm64: dts: mediatek: add afe support for mt8365 SoC arm64: dts: mediatek: add audio support for mt8365-evk Nicolas Belin (2): ASoc: mediatek: mt8365: Add a specific soundcard for EVK ASoC: codecs: add MT6357 support .../devicetree/bindings/mfd/mediatek,mt6357.yaml | 33 + .../bindings/sound/mediatek,mt8365-afe.yaml | 130 ++ .../bindings/sound/mediatek,mt8365-mt6357.yaml | 107 + arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 89 + arch/arm64/boot/dts/mediatek/mt8365.dtsi | 43 +- arch/arm64/configs/defconfig | 2 + sound/soc/codecs/Kconfig | 7 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/mt6357.c | 1898 ++++++++++++++++ sound/soc/codecs/mt6357.h | 662 ++++++ sound/soc/mediatek/Kconfig | 20 + sound/soc/mediatek/Makefile | 1 + sound/soc/mediatek/mt8365/Makefile | 15 + sound/soc/mediatek/mt8365/mt8365-afe-clk.c | 429 ++++ sound/soc/mediatek/mt8365/mt8365-afe-clk.h | 32 + sound/soc/mediatek/mt8365/mt8365-afe-common.h | 491 +++++ sound/soc/mediatek/mt8365/mt8365-afe-pcm.c | 2275 ++++++++++++++++++++ sound/soc/mediatek/mt8365/mt8365-dai-adda.c | 311 +++ sound/soc/mediatek/mt8365/mt8365-dai-dmic.c | 340 +++ sound/soc/mediatek/mt8365/mt8365-dai-i2s.c | 850 ++++++++ sound/soc/mediatek/mt8365/mt8365-dai-pcm.c | 293 +++ sound/soc/mediatek/mt8365/mt8365-mt6357.c | 345 +++ sound/soc/mediatek/mt8365/mt8365-reg.h | 991 +++++++++ 23 files changed, 9364 insertions(+), 2 deletions(-) --- base-commit: 3689b0ef08b70e4e03b82ebd37730a03a672853a change-id: 20240226-audio-i350-4e11da088e55 Best regards, -- Alexandre Mergnat