From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 0CF6C226D17 for ; Thu, 24 Apr 2025 10:25:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490325; cv=none; b=TGsWQwY6Eg019DRxCFMFSGuogJSEGnSyvLFI/PbEVvTfrFCJy96O4IWpwHuKLQlvzmvwAX6smwW+Cl8GDtlRUmQo4n52KOqzvjVM18TdNDE/KgUD0UyJS1BLLj2Q6nn4q/0yQ3eE/j2/yV20JXZqjFNjUWo00EAlM/WWW5NXl8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490325; c=relaxed/simple; bh=XpxdjpHxHeSh/EXxPCLM7FkwIsKFnrwqno5QtZAGXOA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QzbJOV9bggVjRGNI42LEqYg03CHJgT1L35/HBY64uT7As8Rm2UBIJ9lQ3e9OY4mRvSkmhUwtJKY8q90uDYpJtTCLqQc3TyRHovt7uxwXOw8DvQHn0VaDcRMKpaEGooPCc08MIOAI6V+NTPyaT+akoH+Uak0KSaVVaLNSMGfrYgY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=eOeBu2f2; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="eOeBu2f2" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-22401f4d35aso9423545ad.2 for ; Thu, 24 Apr 2025 03:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490323; x=1746095123; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iJlXUyXaSg5/APv08bqYlwg7ApzeLY4Yu8IAGzZsa6I=; b=eOeBu2f2YmRHbdMniu+H+6IvgUObkcZ2+oXEIm8N6HZC53a0JDn5weoGMtb7WwODhh 7XbHylZNQOR+oGl0uKwU3IW/DIVns7AmMuTAJ+Tt3opD+ipaVcjEiFTMebily8424A1h GHjBSQ/eZmtYRRSFWjVaCYXjLtItn4Y7PH4kc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490323; x=1746095123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iJlXUyXaSg5/APv08bqYlwg7ApzeLY4Yu8IAGzZsa6I=; b=Y32j3K4NGqsdBpXA6wenjUySVScVh8uwuZ6dggd8A7t6ASfcCX51kKbXxFofdRsZFM CeE72N7UDkgHKwv64fEAkH/8uHamLr1Mx+8bWWBGuZ9DNJnJ6dAghXEa0iXVOP0nwDap IYLSEX1NJ7PeaK9NgPnWtelnNcBQrQhQ6Zq4+2H9s3ZJFL9W3EXgFx7WAn5ylahdxN8e nQYvIGoBFA1ytUK20PbLnF/oxuHAAqUGt/b1sLpnZ5riuOz+L0wNI8M60wVVN4RTF9OE WID0C7HbOjI9jPo8MDnfoQs4J8CagZ9RVKMzKdX/5XyBlrTTHOapWV81bd0gvVFSUMJe 1rcQ== X-Forwarded-Encrypted: i=1; AJvYcCVEP0aAvWPgrZ13fbymXtZ48UZYypaCNdnsj1lFSpI7MnZWeKj8xbc80NZrspZSRlJ/CoHR4OWZyI3nfhg=@vger.kernel.org X-Gm-Message-State: AOJu0YwVooqfaPChir0yLhEL79hJpB4cDC8cQQ5bNhjszEGscq68lgKz RtDeNhHu20UxpACEyPUR+b2pnFTTYF0asQ8XST5B+MrI6fo2z6Mqem6pK04L+Q== X-Gm-Gg: ASbGncsq7Zp680K4JNxe0iAZ1jLxQKm0V7i1aOor7v+c39Z8y01hHkm5fn3j9o0N79H lY6b/EHcSaQMSPTeDX6rLe6le0BuylHwxFOQhfOV/7NhjZqhmQSB+BuPcoJL5pBEcLCIov/3esU 0sxlhx9uMknKWk9JBkYUzHlRxCOeMOUSTHFQTkgTSZQinSwCOELkQuMS8CUC9E80lMoa4u90Wdg /22+QnNiRabVPyvACSTlF1v5L4YTuHGneRgzV5z4uGBCvBGpxpVDbZfPS+/95bFQqBBNHugLf6j vGz0FLyid43grOFjN3bSc2jHKoLcleC0gU1/DTUSn5KdudC9J9FYMJVK0g== X-Google-Smtp-Source: AGHT+IHzoPXeAj/1Vo9RnY5qRxxsQ+IrUuZpo38gzMRReAUYEIPY7nVtqmt5PXAnUiSLOPEIxc+1ww== X-Received: by 2002:a17:903:32c9:b0:224:216e:332f with SMTP id d9443c01a7336-22db3db1596mr29371075ad.48.1745490323281; Thu, 24 Apr 2025 03:25:23 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:22 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Trevor Wu Subject: [PATCH v2 01/13] ASoC: dt-bindings: Convert MT8173 AFE binding to dt-schema Date: Thu, 24 Apr 2025 18:24:55 +0800 Message-ID: <20250424102509.1083185-2-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Convert the MT8173 AFE (audio frontend) binding from text to dt-schema in YAML. "clocks" is added to the list of required properties to match "clock-names". And the example was slightly fixed up in style. Otherwise everything is as before. A contributer and maintainer for a recently added MediaTek audio binding was chosen instead of the original submitter. Cc: Trevor Wu Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Krzysztof Kozlowski --- .../sound/mediatek,mt8173-afe-pcm.yaml | 87 +++++++++++++++++++ .../devicetree/bindings/sound/mtk-afe-pcm.txt | 45 ---------- 2 files changed, 87 insertions(+), 45 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8173= -afe-pcm.yaml delete mode 100644 Documentation/devicetree/bindings/sound/mtk-afe-pcm.txt diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pc= m.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pcm.ya= ml new file mode 100644 index 000000000000..a95215ba6361 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pcm.yaml @@ -0,0 +1,87 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/mediatek,mt8173-afe-pcm.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek AFE PCM controller for MT8173 + +maintainers: + - Trevor Wu + +properties: + compatible: + const: mediatek,mt8173-afe-pcm + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: audio infra sys clock + - description: audio top mux + - description: audio intbus mux + - description: apll1 clock + - description: apll2 clock + - description: i2s0 mclk mux + - description: i2s1 mclk mux + - description: i2s2 mclk mux + - description: i2s3 mclk mux + - description: i2s3 bclk mux + + clock-names: + items: + - const: infra_sys_audio_clk + - const: top_pdn_audio + - const: top_pdn_aud_intbus + - const: bck0 + - const: bck1 + - const: i2s0_m + - const: i2s1_m + - const: i2s2_m + - const: i2s3_m + - const: i2s3_b + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + +additionalProperties: false + +examples: + - | + #include + #include + #include + + mt8173-afe-pcm@11220000 { + compatible =3D "mediatek,mt8173-afe-pcm"; + reg =3D <0x11220000 0x1000>; + interrupts =3D ; + clocks =3D <&infracfg CLK_INFRA_AUDIO>, + <&topckgen CLK_TOP_AUDIO_SEL>, + <&topckgen CLK_TOP_AUD_INTBUS_SEL>, + <&topckgen CLK_TOP_APLL1_DIV0>, + <&topckgen CLK_TOP_APLL2_DIV0>, + <&topckgen CLK_TOP_I2S0_M_SEL>, + <&topckgen CLK_TOP_I2S1_M_SEL>, + <&topckgen CLK_TOP_I2S2_M_SEL>, + <&topckgen CLK_TOP_I2S3_M_SEL>, + <&topckgen CLK_TOP_I2S3_B_SEL>; + clock-names =3D "infra_sys_audio_clk", + "top_pdn_audio", + "top_pdn_aud_intbus", + "bck0", + "bck1", + "i2s0_m", + "i2s1_m", + "i2s2_m", + "i2s3_m", + "i2s3_b"; + }; diff --git a/Documentation/devicetree/bindings/sound/mtk-afe-pcm.txt b/Docu= mentation/devicetree/bindings/sound/mtk-afe-pcm.txt deleted file mode 100644 index e302c7f43b95..000000000000 --- a/Documentation/devicetree/bindings/sound/mtk-afe-pcm.txt +++ /dev/null @@ -1,45 +0,0 @@ -Mediatek AFE PCM controller - -Required properties: -- compatible =3D "mediatek,mt8173-afe-pcm"; -- reg: register location and size -- interrupts: Should contain AFE interrupt -- clock-names: should have these clock names: - "infra_sys_audio_clk", - "top_pdn_audio", - "top_pdn_aud_intbus", - "bck0", - "bck1", - "i2s0_m", - "i2s1_m", - "i2s2_m", - "i2s3_m", - "i2s3_b"; - -Example: - - afe: mt8173-afe-pcm@11220000 { - compatible =3D "mediatek,mt8173-afe-pcm"; - reg =3D <0 0x11220000 0 0x1000>; - interrupts =3D ; - clocks =3D <&infracfg INFRA_AUDIO>, - <&topckgen TOP_AUDIO_SEL>, - <&topckgen TOP_AUD_INTBUS_SEL>, - <&topckgen TOP_APLL1_DIV0>, - <&topckgen TOP_APLL2_DIV0>, - <&topckgen TOP_I2S0_M_CK_SEL>, - <&topckgen TOP_I2S1_M_CK_SEL>, - <&topckgen TOP_I2S2_M_CK_SEL>, - <&topckgen TOP_I2S3_M_CK_SEL>, - <&topckgen TOP_I2S3_B_CK_SEL>; - clock-names =3D "infra_sys_audio_clk", - "top_pdn_audio", - "top_pdn_aud_intbus", - "bck0", - "bck1", - "i2s0_m", - "i2s1_m", - "i2s2_m", - "i2s3_m", - "i2s3_b"; - }; --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 5C04E22B5B1 for ; Thu, 24 Apr 2025 10:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490328; cv=none; b=lhINa1U+JF6HGtMRRlgOVbfaS7e237kKAiE9YEnF/71pWK3tTrEHrYf7RrxrOWtpxTcRKPn1vvNLIUMy9rOltqd+fIdNLzZXybLd1u9aW61+dE+YdD3jsX7/ZasSpogKJq8ctn3j4T4I34Rg0+1G5ABlXW+W72J7n3CykNh6atU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490328; c=relaxed/simple; bh=LiV5+dbe3T+WgDBltbYE2AK3dTrKP24hFYm02zLoduE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PEIqFnkXaWrHCCeFpYO0T/s+2R/cEt9bqjbYDPr9dIYGZufzzNwODGwUxPz/4CvqkBrE3G4snimKgzrO7yAaliDK6/El1E6AXHx3m4p73n0lJpkVKi+Isf3rJ1CJhc8MhSQnULUXV+/v+u7Ksi6zUStrZM9NTwEwacS/pBr4J98= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=FsasgelO; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="FsasgelO" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-223f4c06e9fso7487545ad.1 for ; Thu, 24 Apr 2025 03:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490326; x=1746095126; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s6fx4MUr4te9jDkTy05iUwkmlLiv1scjMrYy23qe190=; b=FsasgelOkjsI0lOlO9ANUaCe+C8F0Y355M93O1x303XmvZpTzW4N90Noh5jS55XAXN XjRkffI0T3J5Y0L9W19C5YxmE09oGs0F0X+fFi+8ZlP6Rxj0vFNx8+mZYpvmnSt27meo SfGLWGcYV7tV8R0oHYGE0vOaYh0lcm2W2a8PI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490326; x=1746095126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s6fx4MUr4te9jDkTy05iUwkmlLiv1scjMrYy23qe190=; b=jg88ErNet6dmlE4Dup4jHchMC6dMKS0ayJoh0046D8KQgBvgAEsZFh9PLlNZN0mFs+ a2tBlvt3+fWcXNy8ItzVnNbLQqF7ygGSC2Yt9XzSa1o7c24RozSYQMUZQSvFYIcJjWfO WD8gytwvqua95+wQEju2c4exH+SDRHkXY3OxdxfoORJnpDwySYD+1Ikuo3bvh8+Vci9V 7jo6AJKjHh9HFVSYh9nJ2F+iQIhq1Tv+4/BcLmxsF/nLrlTlhwc4vJeU8BKTBzfy+yba zUJboDEaq6AzJv1klavMqOzdUfSzU371jceAgQZTRpl15YU7WRRQZlw78+SlJ44saYY4 OmTA== X-Forwarded-Encrypted: i=1; AJvYcCV4fCGNeNIAkwXc0tuHZLT1FCUN6ILK4Xoq6ulbgdB2AkOcQjU4teoJTd0nkNbgp7b7hA9ADq8awYmiKuc=@vger.kernel.org X-Gm-Message-State: AOJu0YzZp/IjVoDWnZx3btq/IqJ53d63n5JFO5fAqnVacvE5t884jBZe DSEz+pqJbfiUh+l/tMFNpbUPLcUf9/up5cA85LgS4q9CONPLTf/tz6+Yi5j4hw== X-Gm-Gg: ASbGncskjoaaySUpI/kXmsmfmbSzdD91IRLylP7usu6CU2HBftDR8Zjn5qU8U4sXIvI tEz60iFvkkYPN91UaYz3/Ot/Uo0DX1BA/juAjDiln0qqWtVuVW72NVbim13dOQMfSsuJabIBhK7 lRaz3KVOhWO4fSGIAAtb1E5Zq0C4sWa7yAbfF6CSVCAoEY0c4zkreVMvBi0TLhQrAcLW/6ccDaU bVZKVhLKU7uvsEZF3QS9WIbMiAPiWipQWJxcwuWjXf+PYimvlLWl9yT8HmsYNF8c6M5iKZO7hqO c8ri9kdjDsg2zWnvP9SbDqsYSeeNKoNg1XUvv2xRxx0zxlCfvmCIRM4aHg== X-Google-Smtp-Source: AGHT+IFNflA0jQPNmROa9h8mKkta9N2LCXUl+MkxIZxkk1EuSqHoA4OT4/Txgj+BWOug6XhvWUVquw== X-Received: by 2002:a17:902:ec84:b0:220:e91f:4408 with SMTP id d9443c01a7336-22db499755emr24690085ad.22.1745490326648; Thu, 24 Apr 2025 03:25:26 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:25 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 02/13] ASoC: dt-bindings: mt8173-afe-pcm: Add power domain Date: Thu, 24 Apr 2025 18:24:56 +0800 Message-ID: <20250424102509.1083185-3-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The audio subsystem sits under a controllable power domain. Add it to the binding. Signed-off-by: Chen-Yu Tsai Acked-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/sound/mediatek,mt8173-afe-pcm.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pc= m.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pcm.ya= ml index a95215ba6361..666408d32f5c 100644 --- a/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pcm.yaml +++ b/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pcm.yaml @@ -45,12 +45,16 @@ properties: - const: i2s3_m - const: i2s3_b =20 + power-domains: + maxItems: 1 + required: - compatible - reg - interrupts - clocks - clock-names + - power-domains =20 additionalProperties: false =20 @@ -59,11 +63,13 @@ examples: #include #include #include + #include =20 mt8173-afe-pcm@11220000 { compatible =3D "mediatek,mt8173-afe-pcm"; reg =3D <0x11220000 0x1000>; interrupts =3D ; + power-domains =3D <&spm MT8173_POWER_DOMAIN_AUDIO>; clocks =3D <&infracfg CLK_INFRA_AUDIO>, <&topckgen CLK_TOP_AUDIO_SEL>, <&topckgen CLK_TOP_AUD_INTBUS_SEL>, --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 6ACD022DF9E for ; Thu, 24 Apr 2025 10:25:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490331; cv=none; b=Ps2Q9PTqPojvh/fEjM+LqvG/+5cQwHeg7n1Zpywj2x/bIxwUmflw8TJ27W04emQkyQQzVOajHMZDUOoaIYZ7e03AjJd07NTnXKZq5PYfD0AoIbus+kLuN6APbUFFYcbymcyD7XLX1I55e+B85nJqAS58I6s/6yPKJoTjT6gBfHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490331; c=relaxed/simple; bh=ORoBOKClhRWUDm0wMhxb1yzCEXRsVXqohDtvhQ3sE0Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Qdz4LTSNQzM3MEjole9wavHR7dxHK/BzmejLZsKpl/5xr7hC+7cHPXfLIfkLCg9K+LS393gkN05PteYyH5fPucfXgAuuhKUx1iXj5it8PbVB6hWaFviLJMJHNYwhk69pbsezlf6tjac74QuoG242qSIubTdtK6hL5dlSvIhzw4g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=fwBH8mky; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="fwBH8mky" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-227a8cdd241so10321095ad.3 for ; Thu, 24 Apr 2025 03:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490330; x=1746095130; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fhbo3dWwgEK3uRwRq4Xx2zA/jDMc12TYdmm1e2oYkOE=; b=fwBH8mkyo36SXhyXDeHEu68w6Nb+jckvzCx8/mCkFI7HFMNIM8KRXsM6ZVJm8sTE/a 2JKa0QiJvCuIQuvfFm4guDbp3wmHLVJRxgJICIvh7+1BQ4bNKXVvdRhRGB5+dKoqofY7 PpZJpKPxhShgQA/nHN0BoKzofSFLkTmcOWW5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490330; x=1746095130; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fhbo3dWwgEK3uRwRq4Xx2zA/jDMc12TYdmm1e2oYkOE=; b=hQjVs8T+Thes9s+HMXpI+FF8vsf0b/7SOiToU8DJ3CVXj9bx2ASDMXQoNqDgN87Siq nyHNkPzDUTXukob9ccO+yXtZZZGuIiuflt+PtTk3HQMlh33OUHpxVN5yz4csG0tFf0Fn 1vPb3atD4ujqEF30HjvtviZQZBHDWlwdM2VluPSE4CkATnFBYZbIwpAPBoYcwYKczvue al0WDbm8YteOuyDfzSbh1xKb7s6+lbungtpR9rrSWqU18uFI8Yp7NfBZfR9vDxcRuYMT K7a5znEfTXTIjyAJrPBg9JIopYqRFXn4zFmvYxiW9nzMmBUBrAQpGuXOUS0sAS8r8kw6 Fjjg== X-Forwarded-Encrypted: i=1; AJvYcCXV0KIv/LYGfqzq+dGG0m1dTgR+4roopHgV3rM9W0duvnh3FRalNWJgOn2pqdmo+LpY0ZoGMI8vi6rvsrU=@vger.kernel.org X-Gm-Message-State: AOJu0Yywe7FHqI8zNFmxICXJDe9QVBsENjFTpEWnRs3o22EeJbY6gKNl HSCoKOqIwsh/sEQZHlvKzjhgHoZ50CJRo5nfTzQOj2w013rY6GFj0DULan7ieA== X-Gm-Gg: ASbGncvoo6BQEM5xflHg9JCjV3xBVBb2nT6Wrn02Vg7Yji0pGpCHrrkzsYxUm6IG8/o O6P07Znf5OcCz0xgMDbBaT7i6X/fi5sC5qzgXVrClOMlJfR1qlUHc+mDm72crysyJxpcQR/5neQ thyq0ClAfmEWoO+8jaYb4W5W2dN8NMfLAhtc1lyv8fELn87G0s9iilCVLmPQmRlt3rR5Rzf31w2 O2mnY/REPXFbPNo0Z7CH4O4kxwT5ksO8Ax7mjSzpECC2Rto/VfDUskkv9WJI1PRVFWU8j86xqpz +hAN+GhXlZIP/Vgv6C9n1gnZpE0CbRwSx82CDltPkcTlu8Eyn6FAdyfqug== X-Google-Smtp-Source: AGHT+IELSxxaIrlWkT9p38inClLfKF8hG21EugY89NAyG2v2PsTI+Qb1Qw/gECNiLb039w0VJotWQg== X-Received: by 2002:a17:903:90e:b0:223:f408:c3dc with SMTP id d9443c01a7336-22db3bb22c0mr25973895ad.9.1745490329723; Thu, 24 Apr 2025 03:25:29 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:29 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/13] ASoC: dt-bindings: mt8173-afe-pcm: Allow specifying reserved memory region Date: Thu, 24 Apr 2025 18:24:57 +0800 Message-ID: <20250424102509.1083185-4-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It is desirable to reserve memory for the audio frontend. Allow the "memory-region" property, to be used to point to a reserved memory region. Signed-off-by: Chen-Yu Tsai Acked-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/sound/mediatek,mt8173-afe-pcm.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pc= m.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pcm.ya= ml index 666408d32f5c..d8993b5d457a 100644 --- a/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pcm.yaml +++ b/Documentation/devicetree/bindings/sound/mediatek,mt8173-afe-pcm.yaml @@ -48,6 +48,10 @@ properties: power-domains: maxItems: 1 =20 + memory-region: + description: memory region for audio DMA buffers + maxItems: 1 + required: - compatible - reg @@ -90,4 +94,5 @@ examples: "i2s2_m", "i2s3_m", "i2s3_b"; + memory-region =3D <&afe_dma_mem>; }; --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 AE4DC22F76B for ; Thu, 24 Apr 2025 10:25:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490335; cv=none; b=nmZUeR+yqC2FVQoyalgR1k5kRQSY3pTfGFBSs57s90C6xOGIJYgk05sz34L2auR04uH/IzurrDk4QJWWe3VhRr9jxBWmtDdSSHoZ8I14VIoG2SQTDWklA5d/gbyL/vmwgGq2O1oY0kILz6VMVqrxv0WXPCL+MZkeEMoLI7ajwiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490335; c=relaxed/simple; bh=AlCqzDQhKXab0Q+3deb0PZcdtOSYBmwa2tfmkwAzIoE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qQY2cTX9LO2h/oakk9HOwKNaFlbQnLPtUbtiuAEpBSL5YEZq2mSfFNieffUM3UXN7LnmJiU+Q6LkCB4fSLtPDAZK/qMLtFwZriRRVd1tcXq8la4Fyzq2+qV35ipFVfH3gJ0Jxxa0XbgM4df3vRyyAv48f2gh3+wmjY8lDkUtxE0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=KyYlE942; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KyYlE942" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2254e0b4b79so13077045ad.2 for ; Thu, 24 Apr 2025 03:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490333; x=1746095133; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HOVuiI+8mSRH7O/02K1BDgrIMTx/XasOhwMXr41vKIE=; b=KyYlE9426zqbjnZj9SOQq6PvJisAaYgguFQmhsuuMUiRbFPdaWo7dv7cmZz5lm9ZMe I8BZ9biHtYRlTll9tZqHgKfnhMIFB+LOT3zx21MjiUM9D+sKElf4rkbm9G1+8f2dG3Gj +M7SLlHzyUXWkiJXWKpkhpIbsZG7MJ5EMs6+Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490333; x=1746095133; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HOVuiI+8mSRH7O/02K1BDgrIMTx/XasOhwMXr41vKIE=; b=IalakKtzWeFEzenjEKRsldKMaBQubKVE/pt/jquONVpzVECbeXSnReqAWn+ZkubTDO /lQSkjqU33LIbQ9tppWFpLZ0DbaEAEGEcWe4DQwLdCWlhXGOlavv/CPi3mBwidl+glVM ojXvE12X5loF7tX1EsBrKG2MxKGxkPRdbITG5yZW5mjAMbZVhEa9bR++v/m4AFKOHG0b +ki0q6l8XI432zLdDb/THQGLamWXkraKr5Lmxdag+oy0RX3lBcxyldwgDXmNtTvu5JJ6 snJjhG5DH0jqGSusu8Gft4d53/ncAfg9nYG9MOExHsWNZiINKi33g47nWx2bKyBEdB+d /3SQ== X-Forwarded-Encrypted: i=1; AJvYcCV35iJcq63GEAHpGnh/aWcq0s+dixkXLDHeVQHZzLqFIlF9rOZW623V80ZnhCGZan9hxbNhjD2eI58gFHQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6WjG+dBLCxoN+xEOs0fGSES1iYmnapNZOqD49wsuDYdItY/ge TYG8GWYexeg6vZaG9YBCFOIBt1JxFHHKHbCWRk0kYPP3nBqdx7ej/zF6EE+3Uw== X-Gm-Gg: ASbGnct9I+Eo+M+Ar7T5u+pg5kD6o4y5HEjyOnULT5V9ILIQtERwfDkJRcqr5arLXJ+ vzz6bciAXVu2kDEXsR5JUXphY/eHIIRCRIArJDzx36gvju2jM5w6XvfGwfqGuNYQDj5dup/77SZ PzkLKKm0G9UhtCc41KS5E6fLbbAH+OMNUCFOtCEMdwVn6t6p9zM1RcVHgJB3VVYzpIRdKpGLbd4 f5TIZ0sQ+jHx0tqKGE9eoBjR+mmMC/jvKBtx9I/OJhZOIa/LV0jeQvTO1N+0vV9QsWVJhGExQ0a /n6JwA7EejwzuPKU8K8Vckp5fOK2PDWTxVpk/iwZibAtKcMhh0mU2cYsgg== X-Google-Smtp-Source: AGHT+IGD0vIug8Nt9qcP/TU1PZMvFZmtESOf6amtEN+pO0sojtfEbRYqEQc7zpWOQxTNCIuHa8wc2g== X-Received: by 2002:a17:903:24f:b0:220:e655:d77 with SMTP id d9443c01a7336-22db3db14ecmr31506645ad.36.1745490332983; Thu, 24 Apr 2025 03:25:32 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:32 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 04/13] ASoC: dt-bindings: mt8186-afe-pcm: Allow specifying reserved memory region Date: Thu, 24 Apr 2025 18:24:58 +0800 Message-ID: <20250424102509.1083185-5-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It is desirable to reserve memory for the audio frontend. Allow the "memory-region" property, to be used to point to a reserved memory region. Signed-off-by: Chen-Yu Tsai Acked-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/sound/mt8186-afe-pcm.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mt8186-afe-pcm.yaml b/= Documentation/devicetree/bindings/sound/mt8186-afe-pcm.yaml index 7fe85b08f9df..f5af2cf18158 100644 --- a/Documentation/devicetree/bindings/sound/mt8186-afe-pcm.yaml +++ b/Documentation/devicetree/bindings/sound/mt8186-afe-pcm.yaml @@ -25,6 +25,10 @@ properties: reset-names: const: audiosys =20 + memory-region: + description: memory region for audio DMA buffers + maxItems: 1 + mediatek,apmixedsys: $ref: /schemas/types.yaml#/definitions/phandle description: The phandle of the mediatek apmixedsys controller @@ -170,6 +174,7 @@ examples: "top_apll12_div_tdm", "top_mux_audio_h", "top_clk26m_clk"; + memory-region =3D <&afe_dma_mem>; }; =20 ... --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 996CA2309B6 for ; Thu, 24 Apr 2025 10:25:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490338; cv=none; b=igXCv39bGB2udSP+n2uQeFXXIERBviJIEnTE6MQYUnxz/EAlmk0l3dF0HNOkg53HDF6h+kOWcUFIw/HPq6ZZvnXs4xtFUbdfDgwV8nxJZD/IV8tFj0QEkZB5VVGk+/MxReAuEIX7f/3FNZAJhulhcjLh6B5t/eMmyES2CvCo3SU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490338; c=relaxed/simple; bh=SddUH/xqsKCkWdaBB0Rh8l7Fup5QKZ1bZQvIU0QOXGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IT0L9o1bRFfOz0jsZQEdN9oLyTNnfekcfnwV2LvlTS2ewoIdO0ogVurDy7jZ6GIo+jmnkt06UJuVLCzoxbBuvqCONbtOh1ZZMAYwZF3GETmijsHg4xrsi6QLco7fUYGwua+lbVzbCF0ddDvqWeEE1n8/4ghYKHoeUOzXmQP11bI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=HAavX8b+; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="HAavX8b+" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-223fb0f619dso8695525ad.1 for ; Thu, 24 Apr 2025 03:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490336; x=1746095136; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kPI27XPPYRRK0xWqV54WIVswQxSYJsBtgx975xO40PU=; b=HAavX8b+aOd3i4wLFnVYNA/6M4S2WVEZFhdlv/5nEoCrC1wL8Ov+0iw9VcfKiFl4uT Hj2i1YhGh0CXlxZzEi1BbQFbxdd8bNtkIB0TZVjTWDKxcPhzCZAVeCvT5p68c4xelxbK oJ7vw3D4/ZV5JP0B2DIVTMVFjVtpzcBev6ifc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490336; x=1746095136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kPI27XPPYRRK0xWqV54WIVswQxSYJsBtgx975xO40PU=; b=TkZib6PZXdzCRJIUHXMFVizTWMT3m+hl3uiRTXDoO3MozeeP+fNMHrjZOU86JUap1q Ja5gK/cVDuxXeDCu+GKYH46na7gc0O6XHf1osZzBuuwLK3Y+6BvYadr+R7SuMC5+nw/q 6cnxzujM0ATVbeJ/krWhGQwyzCPy6H18sdpho4NpUg2NXbP2dCPZsn8V4BJzjxXKMRh6 dncNBpedrmz9iaPtTcKySLLwybjS3jmm5WSLU70kHRjgS2rBebuxtVu/DL96rlqtKyPt e7iDJ/6xuVDgH/hbQMMg+BoxnmqkIqakjTJDsEg9qTwkj9qK/Ji+d90icbJ3bDxDlTkW i9+Q== X-Forwarded-Encrypted: i=1; AJvYcCVcWUT6q0Hd1XMdrvGqFwwjKXmNWvaJhQfG0/Dhc3Y1en09LdJ83+LbiewgFD29xJ/DOTEypsCM6oE8WCw=@vger.kernel.org X-Gm-Message-State: AOJu0YzW7CgQPB/AxOjxRYUvsWwSwPvK09/jPVzkZmrNzaUckIHybHll SZlOD9CrhqWYqfD2dkP8jLsl9Q6JkYGwzmvNIY9h8uqs4QQBQBoknOWvtAWxnw== X-Gm-Gg: ASbGnctSjKv/53gQpkZJL/4sQ5jFWaurWFwzef8HkytRlrLC7ztX1YsNXpvPRO/sbhD BNmiqDFBZdaQ4MeGGAFC4EkeVtiSluC2mH6jvaq6wzrV+zPwHmsITFj/iHY82qN2317BGIhQl6Y y4xUhx/JTk8Odv+lcPtRYSNj6PdCrUhJ6fuLGKRTajtj43jvmhzMG9wPoMMDQ+fH/HA24wZ7BK2 7jRVCL9M1emmHiI+QndxT51a5HZ5GYJ/fA4mDCzceeAm8Rvjml5WKcESIcgDCO1Z7jBj6wKqJoR z6IkN3fGfsqpqidcdFrxzGfM6Qhr7an9AeWwVjnM6nFvyZ0cqRHoKXgxdA== X-Google-Smtp-Source: AGHT+IFl3f1jhKy5TreVsC3n6Tp6f11IsZEiWWY1AzKzoKnuU1FfQGTVtrsgZqmOG5uoeu4Ajq1oKw== X-Received: by 2002:a17:903:28c:b0:224:76f:9e4a with SMTP id d9443c01a7336-22db3c0c147mr26537035ad.14.1745490335985; Thu, 24 Apr 2025 03:25:35 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:35 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 05/13] ASoC: dt-bindings: mt8192-afe-pcm: Allow specifying reserved memory region Date: Thu, 24 Apr 2025 18:24:59 +0800 Message-ID: <20250424102509.1083185-6-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It is desirable to reserve memory for the audio frontend. Allow the "memory-region" property, to be used to point to a reserved memory region. Signed-off-by: Chen-Yu Tsai Acked-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml b/= Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml index 064ef172bef4..8ddf49b0040d 100644 --- a/Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml +++ b/Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml @@ -23,6 +23,10 @@ properties: reset-names: const: audiosys =20 + memory-region: + description: memory region for audio DMA buffers + maxItems: 1 + mediatek,apmixedsys: $ref: /schemas/types.yaml#/definitions/phandle description: The phandle of the mediatek apmixedsys controller @@ -95,6 +99,7 @@ examples: "aud_dac_predis_clk", "aud_infra_clk", "aud_infra_26m_clk"; + memory-region =3D <&afe_dma_mem>; }; =20 ... --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 D8BB5233129 for ; Thu, 24 Apr 2025 10:25:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490342; cv=none; b=BmNYWqKC3tmeIywhoTWHLRvxfG02Ego6uNK+Jod/t7MWbr1+35IFtotQwY1RFjP6FM3Eflh+Lsahr/1k95zz35rNzbNLQqgNZBotxwV7NJYRy0mrAciV4Hr8Rvx39tcftF2jzrFg7Qi7TteJ1dPA+Lw/3k5qOKYGqFzc1VqL6Gk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490342; c=relaxed/simple; bh=h81QwlW+y5jejd+U3IpRD8yw0U0CSxtyIhPIe9+m1d4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VitzEHqXiTHn0D931RPs4QG7NtU/mnJ81KfZUvgtkRMwzj2UimKk2jLg0zrNiuPP6NNB53UFXAiSEYdrWw0HdIdK9ODD05tsi1fD+rNqi3dvrF5RSEZ7HGCOMl04b0fVFmdfwCw2jfXwXMEqn1vtpbIjk1xs80DYoVBdRwANhCA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=jebe452A; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jebe452A" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-22da3b26532so7810765ad.0 for ; Thu, 24 Apr 2025 03:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490339; x=1746095139; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+dIyzL01cgo+crKLDEZdPmeuX1TlRguSNO13pBQrU7o=; b=jebe452AACQtLmGeFmpH9wWCAZZgxZfSZ1PMWHqG9Ji0bipFwn0/a1wIc8dot1GPje K+G0+PKk3lbwPxUenicrFGenx7Cf8Imotv/oEIz5gocQ1p7Ie5g2DpXCWol4GkeLXAG5 f2+swXbFCjyAsg6gxE9xW1S2NCtEs6EcYUnHY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490339; x=1746095139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+dIyzL01cgo+crKLDEZdPmeuX1TlRguSNO13pBQrU7o=; b=E4K0q2xSkmi+nELpcrb3NhqVrHXtEndAwfRhZFOJ0K1JI9MAvpvYNoKdQuwPxLUHih 05UTRP1cn+ANkWl9oi4IuB8z+ZnxjEnsjcOQGnMnPQpiuacpo3h89P5IgSgRE9V1GVNh OUqA5haa9QLY661ZSXvc5QC7pO2Y45xc/jK6GnUwRCp7Dg6bMysqygcwxT4hNEkQAPg+ soyHhs+S8pIlTPoNGYggPXDE7DpUpo/0aPpKzwDkCUc1WJt6XybCPiIUU8a7Zh6kCDfg yq2BCCazk+QmCadCaqt2xTiUWmljlVlBSsOboN8viNPL0Ko9L5UNc8ioe1JRCv4XBXd2 qnpg== X-Forwarded-Encrypted: i=1; AJvYcCXtXI2fPxuh95B2GCpOSuSMKe0569X5WxML6iHqOi/K0JHv+MLon2+Z+I4HzeEiVDyGeO+DMpoogMBUZHA=@vger.kernel.org X-Gm-Message-State: AOJu0Yxd/hL4VkYPJs0sqBfXP7Nc8D9yqw/lMvrVCWPIoG+jZkt1aD25 1dYyiWMqnYQQzXCVWDb832OmmdlzbutY2rnajH0QWMNh2ekzskAz81aEUHK8uQ== X-Gm-Gg: ASbGncsnNI8n7P0DDYCQrcZvDpJZ0ATpLHqQjqinVxHPbVcuP69z2bpI+rRyBxMXStb o3k7Kz4IWKu1Gz3xg8yJZsXpurWIpn4sqGY5Eh6z3mtdxHB3N92/K4dsVcRz7DzI/KUYlpinldW YoJXQ3lBYQPJc0lrxXnC2k/Bq5rZW2iO5okNzKhvSZz9/ZBkwfewk/xugZIOwZdluUjzTZVCjlj 3CU4O5oUn8nW203zNCKG4Gb0rzchfGxM5naOj9dWOPgkB1XJFfRkD1+7fZbjNECD6n+X51UBwos EntDyT84cRd48fHSyYRp8Q3ltYSboRueBCeKCFwdvEsbgFuwheqZFnu3+Q== X-Google-Smtp-Source: AGHT+IGDFNqCsjcE5GSWvAg3se5R8IwE/tOMMO7jOQeDrhg6ysHM8d1FMTBh96EPdCO+C4822gNnlw== X-Received: by 2002:a17:902:cacc:b0:220:ff3f:6cc0 with SMTP id d9443c01a7336-22db3d777dbmr28370545ad.38.1745490339232; Thu, 24 Apr 2025 03:25:39 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:38 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 06/13] ASoC: mediatek: use reserved memory or enable buffer pre-allocation Date: Thu, 24 Apr 2025 18:25:00 +0800 Message-ID: <20250424102509.1083185-7-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In commit 32c9c06adb5b ("ASoC: mediatek: disable buffer pre-allocation") buffer pre-allocation was disabled to accommodate newer platforms that have a limited reserved memory region for the audio frontend. Turns out disabling pre-allocation across the board impacts platforms that don't have this reserved memory region. Buffer allocation failures have been observed on MT8173 and MT8183 based Chromebooks under low memory conditions, which results in no audio playback for the user. Since some MediaTek platforms already have dedicated reserved memory pools for the audio frontend, the plan is to enable this for all of them. This requires device tree changes. As a fallback, reinstate the original policy of pre-allocating audio buffers at probe time of the reserved memory pool cannot be found or used. This patch covers the MT8173, MT8183, MT8186 and MT8192 platforms for now, the reason being that existing MediaTek platform drivers that supported reserved memory were all platforms that mainly supported ChromeOS, and is also the set of devices that I can verify. Fixes: 32c9c06adb5b ("ASoC: mediatek: disable buffer pre-allocation") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/common/mtk-afe-platform-driver.c | 4 +++- sound/soc/mediatek/common/mtk-base-afe.h | 1 + sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 7 +++++++ sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 7 +++++++ sound/soc/mediatek/mt8186/mt8186-afe-pcm.c | 7 +++++++ sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 7 +++++++ 6 files changed, 32 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/common/mtk-afe-platform-driver.c b/sound/so= c/mediatek/common/mtk-afe-platform-driver.c index 6b6330583941..70fd05d5ff48 100644 --- a/sound/soc/mediatek/common/mtk-afe-platform-driver.c +++ b/sound/soc/mediatek/common/mtk-afe-platform-driver.c @@ -120,7 +120,9 @@ int mtk_afe_pcm_new(struct snd_soc_component *component, struct mtk_base_afe *afe =3D snd_soc_component_get_drvdata(component); =20 size =3D afe->mtk_afe_hardware->buffer_bytes_max; - snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, afe->dev, 0, size= ); + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, afe->dev, + afe->preallocate_buffers ? size : 0, + size); =20 return 0; } diff --git a/sound/soc/mediatek/common/mtk-base-afe.h b/sound/soc/mediatek/= common/mtk-base-afe.h index f51578b6c50a..a406f2e3e7a8 100644 --- a/sound/soc/mediatek/common/mtk-base-afe.h +++ b/sound/soc/mediatek/common/mtk-base-afe.h @@ -117,6 +117,7 @@ struct mtk_base_afe { struct mtk_base_afe_irq *irqs; int irqs_size; int memif_32bit_supported; + bool preallocate_buffers; =20 struct list_head sub_dais; struct snd_soc_dai_driver *dai_drivers; diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediate= k/mt8173/mt8173-afe-pcm.c index 04ed0cfec174..f93d6348fdf8 100644 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -1070,6 +1071,12 @@ static int mt8173_afe_pcm_dev_probe(struct platform_= device *pdev) =20 afe->dev =3D &pdev->dev; =20 + ret =3D of_reserved_mem_device_init(&pdev->dev); + if (ret) { + dev_info(&pdev->dev, "no reserved memory found, pre-allocating buffers i= nstead\n"); + afe->preallocate_buffers =3D true; + } + irq_id =3D platform_get_irq(pdev, 0); if (irq_id <=3D 0) return irq_id < 0 ? irq_id : -ENXIO; diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediate= k/mt8183/mt8183-afe-pcm.c index d083b4bf0f95..e7378bee8e50 100644 --- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c +++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include =20 @@ -1094,6 +1095,12 @@ static int mt8183_afe_pcm_dev_probe(struct platform_= device *pdev) afe->dev =3D &pdev->dev; dev =3D afe->dev; =20 + ret =3D of_reserved_mem_device_init(dev); + if (ret) { + dev_info(dev, "no reserved memory found, pre-allocating buffers instead\= n"); + afe->preallocate_buffers =3D true; + } + /* initial audio related clock */ ret =3D mt8183_init_clock(afe); if (ret) { diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c b/sound/soc/mediate= k/mt8186/mt8186-afe-pcm.c index db7c93401bee..c73b4664e53e 100644 --- a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c +++ b/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -2835,6 +2836,12 @@ static int mt8186_afe_pcm_dev_probe(struct platform_= device *pdev) afe_priv =3D afe->platform_priv; afe->dev =3D &pdev->dev; =20 + ret =3D of_reserved_mem_device_init(dev); + if (ret) { + dev_info(dev, "no reserved memory found, pre-allocating buffers instead\= n"); + afe->preallocate_buffers =3D true; + } + afe->base_addr =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(afe->base_addr)) return PTR_ERR(afe->base_addr); diff --git a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c b/sound/soc/mediate= k/mt8192/mt8192-afe-pcm.c index fd6af74d7995..3d32fe46118e 100644 --- a/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c +++ b/sound/soc/mediatek/mt8192/mt8192-afe-pcm.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -2179,6 +2180,12 @@ static int mt8192_afe_pcm_dev_probe(struct platform_= device *pdev) =20 afe->dev =3D dev; =20 + ret =3D of_reserved_mem_device_init(dev); + if (ret) { + dev_info(dev, "no reserved memory found, pre-allocating buffers instead\= n"); + afe->preallocate_buffers =3D true; + } + /* init audio related clock */ ret =3D mt8192_init_clock(afe); if (ret) { --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 3FCDB233D64 for ; Thu, 24 Apr 2025 10:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490345; cv=none; b=nWVD9CzaKPwlZ/W4pBZMApQKn6CTIFts4PznL7QKEABgDGTw/BVo22fl5H+y+v0ruunBc+lZXVEQ+Z4zG3RPw7UrFNKU+GOIjwMThsMC+vb21aRS52VIKmWPp8Cc60AGqUzRVJXB+4kTUv1a3sIzvL3QPmWi7zacxjk81bHUvU0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490345; c=relaxed/simple; bh=hCepBdzhR3imrEAzE78ikW1DLTohY4AHQ4vBGIcHc+k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FnJluknDHLE0DeuYHioTlOPWfdhGhtGx6jFC9MjxPikmUeX2s0f8L2qGXPO9SKMRpQM9d4mPHgp4pLHfMBhnC5+B68ntxE2pGr6tuyOmwf+l2Cl1ckFGAcDr07Mj6Tp513AXQRvybipzSZ0nQkxJwrLyz8YHKqRSH2zRYzWMSyU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gOt2aRst; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gOt2aRst" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-227cf12df27so7736925ad.0 for ; Thu, 24 Apr 2025 03:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490342; x=1746095142; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XUBFebUvWCybPC7Gr0qjTf4RweTwPSwS4K+KvmFiZN4=; b=gOt2aRstLpgCHD8VX9jseKV3qfm1ja16UJMv5wCmcG4vFJ9kVjoCNF/uh3KndU14u4 1kBkkuyGe5IfnBO3kyJNIa7FiRTAAVxWEXEVuqW4o7SO7Yds739k2J0MgkQX/d3Y/IKX w7U9QLRNH0HCcb1uBHhgbAczwIngCON4aeNN0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490342; x=1746095142; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XUBFebUvWCybPC7Gr0qjTf4RweTwPSwS4K+KvmFiZN4=; b=wBQ+Wa5j/97msVIoGahxa52Zb9KGff6LK1nM8/unUCrUHUNRFLUzfgV3rDiPq8Mmhl DyxpFF6jaongItNBtEvtsNdlvjLpJ8nJi1sY3U1TJ/jScAcZOs3rAC8OGU6SGovMjT6S g/My4bbylzlZg9H/HtPK+Xu6UzcJucj9ivk7Dxyp49YYvC2iLcytJmRiBSBXSCw2ynMS Zy+GUHeqfh9q5tyNX5dAQI36SvO7nmtbs2y0Hm2NE+OiAbkqsTMSIlE3TimEfaD7AHXg pYMDUKv2HIibKcGjLNyPQRCClDCgpPomjHgiUO9ngQvhrx66NxoN/21uo5Yjwkt989tx 2H3g== X-Forwarded-Encrypted: i=1; AJvYcCWU46HHFNRkHAUlFpDrAssaFRDygEFFs+0xi8y15RkS5hmxxkZfUMgdGgT9PgKipefowMI30xUMuoZxS8A=@vger.kernel.org X-Gm-Message-State: AOJu0Yy1pi68Cc5QV6onUiI1nT5mwKYQAkw0R7di0XkpKUWxmBlfjNuD Is91kN5c/xAdoXH6RNFSOtJjsC3XcvcVcZ+BNoEthkFi6LyaeLScOmtNLnHuAw== X-Gm-Gg: ASbGncthFBpwGf5OsIQtDlSM9Hhp129oglVB633BEEDyDBXOnleek5OH7jYVSziyzK6 3CLe7c/ZYq143m8cDE6Rp4v3/zxdyHwSVC+igNTLEORS3dR1Lam5mQKjYom78EjO+7iNN2DYzAv Z8Yh/VU2qg2O0Twfck8h/PpvVXrOD5htyvUYY1wFN7Arh7jXcq33F35wOV/rGn+rNLLtqJvZRTR 2vZOtltHjMMekcmyKIp0H3DopyviVKGYHbhJvfmTvGIlwfcdjAdkngFoFP78NesqBZOUSUhOg/X JvC05UnYUOp46TT4SEwoI9coKAyu9zO+KfIPznDKukKOx5fAuf9aKT5lcg== X-Google-Smtp-Source: AGHT+IElSoZ8SalHQQZjQTWtW0X8U3PTH+55sn5jfmyk6HGUSjVHCZyjfyjm0AvfmBvEv7DCr/VZOA== X-Received: by 2002:a17:902:f544:b0:221:1356:10c5 with SMTP id d9443c01a7336-22db47f4dd0mr24547855ad.9.1745490342486; Thu, 24 Apr 2025 03:25:42 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:41 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/13] ASoC: mediatek: mt8183-afe-pcm: Support >32 bit DMA addresses Date: Thu, 24 Apr 2025 18:25:01 +0800 Message-ID: <20250424102509.1083185-8-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The AFE DMA hardware supports up to 34 bits for DMA addresses. This is missing from the driver and prevents reserved memory regions from working properly when the allocated region is above the 4GB line. Fill in the related register offsets for each DAI, and also set the DMA mask. Also fill in the LSB end register offsets for completeness. Fixes: a94aec035a12 ("ASoC: mediatek: mt8183: add platform driver") Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediate= k/mt8183/mt8183-afe-pcm.c index e7378bee8e50..a3c8054a434f 100644 --- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c +++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c @@ -6,6 +6,7 @@ // Author: KaiChieh Chuang =20 #include +#include #include #include #include @@ -431,6 +432,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_DL1, .reg_ofs_base =3D AFE_DL1_BASE, .reg_ofs_cur =3D AFE_DL1_CUR, + .reg_ofs_end =3D AFE_DL1_END, + .reg_ofs_base_msb =3D AFE_DL1_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_DL1_CUR_MSB, + .reg_ofs_end_msb =3D AFE_DL1_END_MSB, .fs_reg =3D AFE_DAC_CON1, .fs_shift =3D DL1_MODE_SFT, .fs_maskbit =3D DL1_MODE_MASK, @@ -452,6 +457,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_DL2, .reg_ofs_base =3D AFE_DL2_BASE, .reg_ofs_cur =3D AFE_DL2_CUR, + .reg_ofs_end =3D AFE_DL2_END, + .reg_ofs_base_msb =3D AFE_DL2_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_DL2_CUR_MSB, + .reg_ofs_end_msb =3D AFE_DL2_END_MSB, .fs_reg =3D AFE_DAC_CON1, .fs_shift =3D DL2_MODE_SFT, .fs_maskbit =3D DL2_MODE_MASK, @@ -473,6 +482,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_DL3, .reg_ofs_base =3D AFE_DL3_BASE, .reg_ofs_cur =3D AFE_DL3_CUR, + .reg_ofs_end =3D AFE_DL3_END, + .reg_ofs_base_msb =3D AFE_DL3_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_DL3_CUR_MSB, + .reg_ofs_end_msb =3D AFE_DL3_END_MSB, .fs_reg =3D AFE_DAC_CON2, .fs_shift =3D DL3_MODE_SFT, .fs_maskbit =3D DL3_MODE_MASK, @@ -494,6 +507,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_VUL2, .reg_ofs_base =3D AFE_VUL2_BASE, .reg_ofs_cur =3D AFE_VUL2_CUR, + .reg_ofs_end =3D AFE_VUL2_END, + .reg_ofs_base_msb =3D AFE_VUL2_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_VUL2_CUR_MSB, + .reg_ofs_end_msb =3D AFE_VUL2_END_MSB, .fs_reg =3D AFE_DAC_CON2, .fs_shift =3D VUL2_MODE_SFT, .fs_maskbit =3D VUL2_MODE_MASK, @@ -515,6 +532,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_AWB, .reg_ofs_base =3D AFE_AWB_BASE, .reg_ofs_cur =3D AFE_AWB_CUR, + .reg_ofs_end =3D AFE_AWB_END, + .reg_ofs_base_msb =3D AFE_AWB_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_AWB_CUR_MSB, + .reg_ofs_end_msb =3D AFE_AWB_END_MSB, .fs_reg =3D AFE_DAC_CON1, .fs_shift =3D AWB_MODE_SFT, .fs_maskbit =3D AWB_MODE_MASK, @@ -536,6 +557,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_AWB2, .reg_ofs_base =3D AFE_AWB2_BASE, .reg_ofs_cur =3D AFE_AWB2_CUR, + .reg_ofs_end =3D AFE_AWB2_END, + .reg_ofs_base_msb =3D AFE_AWB2_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_AWB2_CUR_MSB, + .reg_ofs_end_msb =3D AFE_AWB2_END_MSB, .fs_reg =3D AFE_DAC_CON2, .fs_shift =3D AWB2_MODE_SFT, .fs_maskbit =3D AWB2_MODE_MASK, @@ -557,6 +582,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_VUL12, .reg_ofs_base =3D AFE_VUL_D2_BASE, .reg_ofs_cur =3D AFE_VUL_D2_CUR, + .reg_ofs_end =3D AFE_VUL_D2_END, + .reg_ofs_base_msb =3D AFE_VUL_D2_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_VUL_D2_CUR_MSB, + .reg_ofs_end_msb =3D AFE_VUL_D2_END_MSB, .fs_reg =3D AFE_DAC_CON0, .fs_shift =3D VUL12_MODE_SFT, .fs_maskbit =3D VUL12_MODE_MASK, @@ -578,6 +607,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_MOD_DAI, .reg_ofs_base =3D AFE_MOD_DAI_BASE, .reg_ofs_cur =3D AFE_MOD_DAI_CUR, + .reg_ofs_end =3D AFE_MOD_DAI_END, + .reg_ofs_base_msb =3D AFE_MOD_DAI_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_MOD_DAI_CUR_MSB, + .reg_ofs_end_msb =3D AFE_MOD_DAI_END_MSB, .fs_reg =3D AFE_DAC_CON1, .fs_shift =3D MOD_DAI_MODE_SFT, .fs_maskbit =3D MOD_DAI_MODE_MASK, @@ -599,6 +632,10 @@ static const struct mtk_base_memif_data memif_data[MT8= 183_MEMIF_NUM] =3D { .id =3D MT8183_MEMIF_HDMI, .reg_ofs_base =3D AFE_HDMI_OUT_BASE, .reg_ofs_cur =3D AFE_HDMI_OUT_CUR, + .reg_ofs_end =3D AFE_HDMI_OUT_END, + .reg_ofs_base_msb =3D AFE_HDMI_OUT_BASE_MSB, + .reg_ofs_cur_msb =3D AFE_HDMI_OUT_CUR_MSB, + .reg_ofs_end_msb =3D AFE_HDMI_OUT_END_MSB, .fs_reg =3D -1, .fs_shift =3D -1, .fs_maskbit =3D -1, @@ -1081,6 +1118,10 @@ static int mt8183_afe_pcm_dev_probe(struct platform_= device *pdev) struct reset_control *rstc; int i, irq_id, ret; =20 + ret =3D dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34)); + if (ret) + return ret; + afe =3D devm_kzalloc(&pdev->dev, sizeof(*afe), GFP_KERNEL); if (!afe) return -ENOMEM; --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (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 5A4FF235BF1 for ; Thu, 24 Apr 2025 10:25:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490348; cv=none; b=NAKHlY9hDrtnSoJaiDnE7QxKNgu2vPhGV75jKgTXiodhGKPMkugZYWXFApv/QFB/EUn07ygbKQpFFeolHS3sqavWyeXu4l4VI52EouFBBfxnPi9M+yeXeDuGT7BzIQfjse/V8qdUJxndBg5eZrqXInwL7rh5yTcrgCWqrjuKG7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490348; c=relaxed/simple; bh=gnsNUIE5fVMgm1yzsatCfzS1CVhAuzl2OFSf1bbgvqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lG6iDj2ISA3Msn6zY45K7IHvNqk2fy8wk2cciVYjngZKHAofKsQlIwM/Sw1zrI/1tOnoa7oMDRrtW/6ZFS5r7R1WguR0l1q/p2cGWMswWjUE6s/3oL6lDEsyQkCpcZWz4bfwWMDSRQsr2dYzYVlu+udVVNVCKfo8b3RSfqOXMbk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=gZwqnAhL; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gZwqnAhL" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2ff6e91cff5so800241a91.2 for ; Thu, 24 Apr 2025 03:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490346; x=1746095146; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IE7aKSxABLvt9Zl1mpyqzpBOR0S+DjSniaX8iFCPAyw=; b=gZwqnAhLXhyO4Xis3QTZdVMCx4pp3/qI8adTIraxc88BY2vZUaUEA/ZFfel+ajb736 7MktRFF5SArRt1a40MLr5wYLub3TteKeSlJhZqw7DG64zcsp2IIUCBy/7TeC9qwtsVY5 IMBpHBQR2wheUkg/flK6P5Dk9gGYiK1S8Fu8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490346; x=1746095146; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IE7aKSxABLvt9Zl1mpyqzpBOR0S+DjSniaX8iFCPAyw=; b=oGcDzNNkGJLf8cpZPYx0HhVoQx6zggt2559QkFHTiT84gVwFQgLZ9it2XBTspfZP0m +mg/LZanCq443RiGg6YIUwJtJ39v1dTUXeDOZO1vYC4qCscjX0qMlnbW/bdh6DGTpjJ6 4+IDcvsFdKu5+ON/TUGc7vcNAHL1qsSTrzZLZSsUkDjj5I0UiqrRUT6O3pus7ytm4rji 7dH2X4Ubc1EpgfhoJCsefyv5UkRXUoYp+ckmpvCMmpxDttjSm8nHlDhWnnhY1zH12pN9 gVxeX0O95on1hlB64LdlyHZ7kDA2O6iJF7HsE2VopQ7pHgGNQOqjgjDPPltzT2u661jH 813A== X-Forwarded-Encrypted: i=1; AJvYcCW03KQP+4TPWk+ur/lAdIw4ziPmWZ5qXmvoomE7vXmGL7XiE9tshCb2ODVv+bns62XAsR456pypgcdJCEc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0YzGyY99Nc83FyrcBdtVI+h0r0B6o3xlTep9tt6DzvIY5efad OOS2JrL7D/rz5f41fEr3tB85OGLnBh7l1eDF7H7AIGT/T5KVbQIZ7n9zG3gX9Q== X-Gm-Gg: ASbGncv+1xOb7Co4sUOm5NQnerwUwYEGJbwxyU5u76YhCko8tu8eATvRbv9ffLLyvuJ qypRPPJ9b3Z0MtpPWvrPL6ZeMuoP9w12ugzbj+dVD7V98WYFqe6EPdetyOf//VZDielkFuBpA1v EPLMUdyRyfQAil1rGtt8fpko55UeqtkLWMR5shiS0bqSeNN7TCDQ2E7yTbbiuqzfyoS+g+vjpI0 y+b3yg9o0mUFAOn0OXAEacf4i3zQoOF5i/wazLXdz5JJxtsGpDZSpX6D7u3DqeVLfgsBjrBN/Nj LPkDjirg2wK3OVOGvOrQ+WNZfX7zNL9qgsjEeySILxBguhsNcYDtv3t1tg== X-Google-Smtp-Source: AGHT+IEXiipgjpnZjo9b641rUil17G3O4+rk2vLeF36iNimZzjzuklvaviqehXQCV3mCF6B2BIqVZg== X-Received: by 2002:a17:90b:224a:b0:2fe:d766:ad8e with SMTP id 98e67ed59e1d1-309ed24bc78mr3343313a91.4.1745490345566; Thu, 24 Apr 2025 03:25:45 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:45 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 08/13] ASoC: mediatek: mt8173-afe-pcm: use local `dev` pointer in driver callbacks Date: Thu, 24 Apr 2025 18:25:02 +0800 Message-ID: <20250424102509.1083185-9-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The probe and remove functions in the mt8183-afe-pcm driver repeatedly uses `&pdev->dev` for |struct device *|, but then assigns this value to `afe->dev` and uses that in other places in the same function. Store `&pdev->dev` in a local pointer and use that exclusively to avoid the numerous dereferences and to make the code more consistent. Lines are reflowed where it makes sense. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 63 +++++++++++----------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediate= k/mt8173/mt8173-afe-pcm.c index f93d6348fdf8..c0fa623e0b17 100644 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c @@ -1054,26 +1054,26 @@ static int mt8173_afe_pcm_dev_probe(struct platform= _device *pdev) struct mtk_base_afe *afe; struct mt8173_afe_private *afe_priv; struct snd_soc_component *comp_pcm, *comp_hdmi; + struct device *dev =3D &pdev->dev; =20 - ret =3D dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(33)); + ret =3D dma_set_mask_and_coherent(dev, DMA_BIT_MASK(33)); if (ret) return ret; =20 - afe =3D devm_kzalloc(&pdev->dev, sizeof(*afe), GFP_KERNEL); + afe =3D devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL); if (!afe) return -ENOMEM; =20 - afe->platform_priv =3D devm_kzalloc(&pdev->dev, sizeof(*afe_priv), - GFP_KERNEL); + afe->platform_priv =3D devm_kzalloc(dev, sizeof(*afe_priv), GFP_KERNEL); afe_priv =3D afe->platform_priv; if (!afe_priv) return -ENOMEM; =20 - afe->dev =3D &pdev->dev; + afe->dev =3D dev; =20 - ret =3D of_reserved_mem_device_init(&pdev->dev); + ret =3D of_reserved_mem_device_init(dev); if (ret) { - dev_info(&pdev->dev, "no reserved memory found, pre-allocating buffers i= nstead\n"); + dev_info(dev, "no reserved memory found, pre-allocating buffers instead\= n"); afe->preallocate_buffers =3D true; } =20 @@ -1085,27 +1085,27 @@ static int mt8173_afe_pcm_dev_probe(struct platform= _device *pdev) if (IS_ERR(afe->base_addr)) return PTR_ERR(afe->base_addr); =20 - afe->regmap =3D devm_regmap_init_mmio(&pdev->dev, afe->base_addr, - &mt8173_afe_regmap_config); + afe->regmap =3D devm_regmap_init_mmio(dev, afe->base_addr, + &mt8173_afe_regmap_config); if (IS_ERR(afe->regmap)) return PTR_ERR(afe->regmap); =20 /* initial audio related clock */ ret =3D mt8173_afe_init_audio_clk(afe); if (ret) { - dev_err(afe->dev, "mt8173_afe_init_audio_clk fail\n"); + dev_err(dev, "mt8173_afe_init_audio_clk fail\n"); return ret; } =20 /* memif % irq initialize*/ afe->memif_size =3D MT8173_AFE_MEMIF_NUM; - afe->memif =3D devm_kcalloc(afe->dev, afe->memif_size, + afe->memif =3D devm_kcalloc(dev, afe->memif_size, sizeof(*afe->memif), GFP_KERNEL); if (!afe->memif) return -ENOMEM; =20 afe->irqs_size =3D MT8173_AFE_IRQ_NUM; - afe->irqs =3D devm_kcalloc(afe->dev, afe->irqs_size, + afe->irqs =3D devm_kcalloc(dev, afe->irqs_size, sizeof(*afe->irqs), GFP_KERNEL); if (!afe->irqs) return -ENOMEM; @@ -1124,9 +1124,9 @@ static int mt8173_afe_pcm_dev_probe(struct platform_d= evice *pdev) =20 platform_set_drvdata(pdev, afe); =20 - pm_runtime_enable(&pdev->dev); - if (!pm_runtime_enabled(&pdev->dev)) { - ret =3D mt8173_afe_runtime_resume(&pdev->dev); + pm_runtime_enable(dev); + if (!pm_runtime_enabled(dev)) { + ret =3D mt8173_afe_runtime_resume(dev); if (ret) goto err_pm_disable; } @@ -1136,13 +1136,12 @@ static int mt8173_afe_pcm_dev_probe(struct platform= _device *pdev) afe->runtime_resume =3D mt8173_afe_runtime_resume; afe->runtime_suspend =3D mt8173_afe_runtime_suspend; =20 - ret =3D devm_snd_soc_register_component(&pdev->dev, - &mtk_afe_pcm_platform, - NULL, 0); + ret =3D devm_snd_soc_register_component(dev, &mtk_afe_pcm_platform, + NULL, 0); if (ret) goto err_pm_disable; =20 - comp_pcm =3D devm_kzalloc(&pdev->dev, sizeof(*comp_pcm), GFP_KERNEL); + comp_pcm =3D devm_kzalloc(dev, sizeof(*comp_pcm), GFP_KERNEL); if (!comp_pcm) { ret =3D -ENOMEM; goto err_pm_disable; @@ -1150,7 +1149,7 @@ static int mt8173_afe_pcm_dev_probe(struct platform_d= evice *pdev) =20 ret =3D snd_soc_component_initialize(comp_pcm, &mt8173_afe_pcm_dai_component, - &pdev->dev); + dev); if (ret) goto err_pm_disable; =20 @@ -1164,7 +1163,7 @@ static int mt8173_afe_pcm_dev_probe(struct platform_d= evice *pdev) if (ret) goto err_pm_disable; =20 - comp_hdmi =3D devm_kzalloc(&pdev->dev, sizeof(*comp_hdmi), GFP_KERNEL); + comp_hdmi =3D devm_kzalloc(dev, sizeof(*comp_hdmi), GFP_KERNEL); if (!comp_hdmi) { ret =3D -ENOMEM; goto err_cleanup_components; @@ -1172,7 +1171,7 @@ static int mt8173_afe_pcm_dev_probe(struct platform_d= evice *pdev) =20 ret =3D snd_soc_component_initialize(comp_hdmi, &mt8173_afe_hdmi_dai_component, - &pdev->dev); + dev); if (ret) goto err_cleanup_components; =20 @@ -1186,30 +1185,32 @@ static int mt8173_afe_pcm_dev_probe(struct platform= _device *pdev) if (ret) goto err_cleanup_components; =20 - ret =3D devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler, + ret =3D devm_request_irq(dev, irq_id, mt8173_afe_irq_handler, 0, "Afe_ISR_Handle", (void *)afe); if (ret) { - dev_err(afe->dev, "could not request_irq\n"); + dev_err(dev, "could not request_irq\n"); goto err_cleanup_components; } =20 - dev_info(&pdev->dev, "MT8173 AFE driver initialized.\n"); + dev_info(dev, "MT8173 AFE driver initialized.\n"); return 0; =20 err_cleanup_components: - snd_soc_unregister_component(&pdev->dev); + snd_soc_unregister_component(dev); err_pm_disable: - pm_runtime_disable(&pdev->dev); + pm_runtime_disable(dev); return ret; } =20 static void mt8173_afe_pcm_dev_remove(struct platform_device *pdev) { - snd_soc_unregister_component(&pdev->dev); + struct device *dev =3D &pdev->dev; =20 - pm_runtime_disable(&pdev->dev); - if (!pm_runtime_status_suspended(&pdev->dev)) - mt8173_afe_runtime_suspend(&pdev->dev); + snd_soc_unregister_component(dev); + + pm_runtime_disable(dev); + if (!pm_runtime_status_suspended(dev)) + mt8173_afe_runtime_suspend(dev); } =20 static const struct of_device_id mt8173_afe_pcm_dt_match[] =3D { --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 6439D2367D3 for ; Thu, 24 Apr 2025 10:25:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490351; cv=none; b=R6NloTZ6uTYfhAWQNHraINWtimEfwElObkj3f3my98PDZAF6p1MIKNdm9HoM+SztE6L375R+AyB7TMjJLnFzUwLFDNSbcp1Q+3d+rR9xM+eECaO5o0lw72OmKNNdvpMWMnl1WFp4U8uoyiIZdyO/141b0EgV3V1sfz2/kFEm+3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490351; c=relaxed/simple; bh=yNzcBctBcltIk7fjKHzagNkU6eRehLtyrLorREA22po=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mVj+YhPckyFOk45MpYKApqZ8iUjkP9fCGQYSzPwcP0nQUdCR/p1BlrDcYhLpb0xVtCJnLTZuFiDMmqgIb9165oV7SAmBgV6VqOJ82OrQYB+OXUyW7ZNFqPCayXJgZOlYPQ9V/wo+r8udw30HirHoF8jh2C48garcMuV4rvBdmCQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=En950whm; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="En950whm" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-22c3407a87aso13021745ad.3 for ; Thu, 24 Apr 2025 03:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490349; x=1746095149; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AyQBxT8N1LOd0tBT65hxZtJpAp/ZMeB2TPzFU7H3X0U=; b=En950whmll4GhabL/ns8fO8k6VSAV4yLyjTKgZrQWULnkYbZTinJ+S2N1ebXqlvUSl mvkInZivgsbL6q7x+IF0A7khK/4vmMQQtJv7n0dDfnJjatkeZ4O4+AH0pWWmFtKS7PjX c0uPEfuAaOESuWkGKmmLLMd123HFOay3oAsRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490349; x=1746095149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AyQBxT8N1LOd0tBT65hxZtJpAp/ZMeB2TPzFU7H3X0U=; b=ePNpKM/qVc7og2vV8WB5cou6+ylL8zdcfCg9XD92xxVkqow5nyv2kENgLsRDkRyV10 7n9Pw1dIlmR9+1UsJ2T1cszVm3Y+5HOzfV9LE+4DI6b7lwOEFXFpxClgvEKI8Cu2FHi9 jc9FiuhUFd1NAQ019n43J2fEdxHDtQmxSoDDyFXiCva6B1vpLCiavo4lblA+Gus9+dQj OdmCk+qRhTxGRdyKLCKePmJLVNnFeB6JKD7qPz762K64gZ9sVaAXEvBDJ7jXiIKCz+Mg ZlCteJzuqilOqkhJ0SW3LlKRsuQkT7wnQjFDJ643eSqCEvOLFwrolwORPGVCEDQYhg7i ABfw== X-Forwarded-Encrypted: i=1; AJvYcCUYEMu4XEjVWCcqLszPeHnOMxiz7GAt6Fg8OGFEMyvFLIXpC9R/ufjmjPyEhh2fUfAZLsHoHJrXvtbdVqk=@vger.kernel.org X-Gm-Message-State: AOJu0YxYoRLplqwjm7sHBPPPQWVwsySI2sv01VvzVktkIpQC/5Dd+c54 sFOItUW/rGdJINnjkiEG1hN6S/yja62v5aO6ABFxDD1fvP3TtC9IoIvQZQ9smw== X-Gm-Gg: ASbGncvLs1nhPTRC8/oTSMtYo2AnolctMYVrKvWLRQVxFU7cprPflKuk2KORg7BmsS4 epqI1C1uj9C0wVfPBMp9cESbvP2WEBSMaxw0ASB0Z/yJSTNuHZdZAvVKxmJGqARVymoQmvt4+zb LfxvOnxeeeIRjvntLpdcchVgoYHoMaP4JfFL2syhXQZRnFvMmlwMO2HD5gkX/h/fpCwZ5Qn6q2J y2TPMDf6Ip9LzLefyYxycb/SxLxESxzKSX+vOdhsUB2/DhdL+UJo41HZApuPyjm3JchwFad2v1M SOQN5OeLNFy1jZJjuULLS21mBWHRWwhyQXroCpzi2YKOaYao7cK/HXbzkQ== X-Google-Smtp-Source: AGHT+IFt0XUOGJk3Ud4+wtbFjwGwTHDAiFvZxN/Xk3zgndqYjVRMpy5Cx4zWYWH17RjjMOdqNLFarQ== X-Received: by 2002:a17:903:183:b0:223:8256:533d with SMTP id d9443c01a7336-22db3dd0a8cmr28683815ad.46.1745490348905; Thu, 24 Apr 2025 03:25:48 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:48 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 09/13] ASoC: mediatek: mt8183-afe-pcm: use local `dev` pointer in driver callbacks Date: Thu, 24 Apr 2025 18:25:03 +0800 Message-ID: <20250424102509.1083185-10-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The probe and remove functions in the mt8183-afe-pcm driver repeatedly uses `&pdev->dev` for |struct device *|, but then assigns this value to `afe->dev` and uses that in other places in the same function. Store `&pdev->dev` in a local pointer and use that exclusively to avoid the numerous dereferences and to make the code more consistent. Lines are reflowed where it makes sense. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 37 ++++++++++------------ 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c b/sound/soc/mediate= k/mt8183/mt8183-afe-pcm.c index a3c8054a434f..d63b7fe19fbf 100644 --- a/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c +++ b/sound/soc/mediatek/mt8183/mt8183-afe-pcm.c @@ -1114,27 +1114,25 @@ static int mt8183_afe_pcm_dev_probe(struct platform= _device *pdev) { struct mtk_base_afe *afe; struct mt8183_afe_private *afe_priv; - struct device *dev; + struct device *dev =3D &pdev->dev; struct reset_control *rstc; int i, irq_id, ret; =20 - ret =3D dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34)); + ret =3D dma_set_mask_and_coherent(dev, DMA_BIT_MASK(34)); if (ret) return ret; =20 - afe =3D devm_kzalloc(&pdev->dev, sizeof(*afe), GFP_KERNEL); + afe =3D devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL); if (!afe) return -ENOMEM; platform_set_drvdata(pdev, afe); =20 - afe->platform_priv =3D devm_kzalloc(&pdev->dev, sizeof(*afe_priv), - GFP_KERNEL); + afe->platform_priv =3D devm_kzalloc(dev, sizeof(*afe_priv), GFP_KERNEL); if (!afe->platform_priv) return -ENOMEM; =20 afe_priv =3D afe->platform_priv; - afe->dev =3D &pdev->dev; - dev =3D afe->dev; + afe->dev =3D dev; =20 ret =3D of_reserved_mem_device_init(dev); if (ret) { @@ -1179,7 +1177,7 @@ static int mt8183_afe_pcm_dev_probe(struct platform_d= evice *pdev) =20 /* enable clock for regcache get default value from hw */ afe_priv->pm_runtime_bypass_reg_ctl =3D true; - pm_runtime_get_sync(&pdev->dev); + pm_runtime_get_sync(dev); =20 ret =3D regmap_reinit_cache(afe->regmap, &mt8183_afe_regmap_config); if (ret) { @@ -1187,7 +1185,7 @@ static int mt8183_afe_pcm_dev_probe(struct platform_d= evice *pdev) goto err_pm_disable; } =20 - pm_runtime_put_sync(&pdev->dev); + pm_runtime_put_sync(dev); afe_priv->pm_runtime_bypass_reg_ctl =3D false; =20 regcache_cache_only(afe->regmap, true); @@ -1245,7 +1243,7 @@ static int mt8183_afe_pcm_dev_probe(struct platform_d= evice *pdev) for (i =3D 0; i < ARRAY_SIZE(dai_register_cbs); i++) { ret =3D dai_register_cbs[i](afe); if (ret) { - dev_warn(afe->dev, "dai register i %d fail, ret %d\n", + dev_warn(dev, "dai register i %d fail, ret %d\n", i, ret); goto err_pm_disable; } @@ -1254,8 +1252,7 @@ static int mt8183_afe_pcm_dev_probe(struct platform_d= evice *pdev) /* init dai_driver and component_driver */ ret =3D mtk_afe_combine_sub_dai(afe); if (ret) { - dev_warn(afe->dev, "mtk_afe_combine_sub_dai fail, ret %d\n", - ret); + dev_warn(dev, "mtk_afe_combine_sub_dai fail, ret %d\n", ret); goto err_pm_disable; } =20 @@ -1267,16 +1264,14 @@ static int mt8183_afe_pcm_dev_probe(struct platform= _device *pdev) afe->runtime_suspend =3D mt8183_afe_runtime_suspend; =20 /* register component */ - ret =3D devm_snd_soc_register_component(&pdev->dev, - &mtk_afe_pcm_platform, + ret =3D devm_snd_soc_register_component(dev, &mtk_afe_pcm_platform, NULL, 0); if (ret) { dev_warn(dev, "err_platform\n"); goto err_pm_disable; } =20 - ret =3D devm_snd_soc_register_component(afe->dev, - &mt8183_afe_pcm_dai_component, + ret =3D devm_snd_soc_register_component(dev, &mt8183_afe_pcm_dai_componen= t, afe->dai_drivers, afe->num_dai_drivers); if (ret) { @@ -1287,15 +1282,17 @@ static int mt8183_afe_pcm_dev_probe(struct platform= _device *pdev) return ret; =20 err_pm_disable: - pm_runtime_disable(&pdev->dev); + pm_runtime_disable(dev); return ret; } =20 static void mt8183_afe_pcm_dev_remove(struct platform_device *pdev) { - pm_runtime_disable(&pdev->dev); - if (!pm_runtime_status_suspended(&pdev->dev)) - mt8183_afe_runtime_suspend(&pdev->dev); + struct device *dev =3D &pdev->dev; + + pm_runtime_disable(dev); + if (!pm_runtime_status_suspended(dev)) + mt8183_afe_runtime_suspend(dev); } =20 static const struct of_device_id mt8183_afe_pcm_dt_match[] =3D { --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 CE8C9227B95 for ; Thu, 24 Apr 2025 10:25:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490354; cv=none; b=FJTtbYYfKXKHquyu37/Mlhi2MtXaM6LiyHglFbXoec0w6Il957coIpE6B0AlN724exjPt3i06HFy0aQqdqK5jPEu1P2HK41n9xt9Owf+2Yskj2itcvZ1nt70vu7IKn4tLh/jmRtRxomnYKHA1ABJeXLY2nRMfHJLeasKaoRgOJg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490354; c=relaxed/simple; bh=7YFjDN0OC4OQWm2AzcQtsFeXGcmPqh68xKdJuDgu7gc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oa3LvH1tKQhhygLhdMV8uUeAKM35uefDg120ODbI2VJGZwGFH77ioaXR+QQLeMd7AP25APXEj0WWd8p91AZu0/DVmBQseLwXQG3iba2XzNdTq7vRxE/LnGEbnSPjcAl/fbf2bwQQpSto2SSjXigGD8SqMIP/ra7WD0CwqQwXCuo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=R1zBfBkK; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="R1zBfBkK" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2255003f4c6so8513355ad.0 for ; Thu, 24 Apr 2025 03:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490352; x=1746095152; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LtKFI70vqNjYLe7XjAp0V0B8UZZFpuIExlA3OQYSr8Q=; b=R1zBfBkKnAYp2zb1BcfKWQHK+EMp6bydiGVi8t3/SPc8nMsCQpg+4oTI096j0dJdhU c5eiChZgBS+QPfZG6rDYJhbJxKnXplamaJCgUd5RGZIfNnJwbRbHLv2gSOVLlx4C/yw4 XW09CTjAKh1yV4uX2rdoo7CXnuEkaEx905CR4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490352; x=1746095152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LtKFI70vqNjYLe7XjAp0V0B8UZZFpuIExlA3OQYSr8Q=; b=MNfsFcWV+ZPb25VR7kKUKAn/xMCSTFs0bjj3+jAB0Ace8kD0C7eUEuO+W9RAaXPDnZ EOJnQwX/6qUeHaX112BqWvHAKfPWoddvjHlQxZWBbShRohUZxOC0VQ9YDqsemEcsIYgY brBmXnojIikWdMSPTrLwGpTyAYyb7WRw76EZm8jrLxkDUOldsGqhJZsPcX5ytXUaaotJ Po15MiSWQ+8PMBpUAjaPehKm47w+fTLMQ/cDqq/OvTaxOG6mfAMXgrVDnt3janQ+4scL nO3dKG2pGhoByKVgwZWBIRqsUtHB9rPrli5Z5nmnE+zGHyKdJcBYW9GkdOY/wK5fKLoG xR5w== X-Forwarded-Encrypted: i=1; AJvYcCVo6oEastgB7osMKG61Rhk9jxbx6uM29c/pMSO79pjlWMlHwChVwjAosaJ01cfPaCvSA5r0TM04aV14u9g=@vger.kernel.org X-Gm-Message-State: AOJu0YxuCR1rNYdEUpuxTBaaJZeEomg69pS5V8ha0dq20pT8gYcotDSw 9V6S2UlDbaxG5vT7TsLXm2b8/iQHrPHu0xJjYRnLrjenjiIStBd1GvWE/6gNSQ== X-Gm-Gg: ASbGncs6WIT5OleedZFiCrr1Xu1bbFaKkjdNuyx/ivdXYik1pdMIeb9Ri4aJpJDYuvA i18J3URg4vS/GbdGThu5tLt5XAGApnmg+m+ykosRWHNWw4ot9YWKxV7G4WHFWzb2n2cwW/qef1N s5IL68F7xsVCXSd+hAf2zAL3Q532q6eoc7q0R0qdL30iMOplwLrneZ8wJRxF0auH3ReTZ+TimZZ FvdTpAWdMVa/yvyEHjOSfPQWoTWfCx2/dBFx5V7BtkJql3P2dv02bkWwZSqBCUGldHcIvb3HMiv KcXKewwg7BDtkOVp9mYBq2FtMGf37VqsBGD2H/A2LubTtOpo5aBjyjK0fA== X-Google-Smtp-Source: AGHT+IGm/ZrqIrNFBVlNQkQXFmEbsCxSPSPhkPOsiViZpp856F8SPbm8k/eEXqIbJDBfdIBpftEJlg== X-Received: by 2002:a17:902:d48a:b0:221:78a1:27fb with SMTP id d9443c01a7336-22db3bd1a15mr27098975ad.11.1745490351983; Thu, 24 Apr 2025 03:25:51 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:51 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 10/13] arm64: dts: mediatek: mt8173: Reserve memory for audio frontend Date: Thu, 24 Apr 2025 18:25:04 +0800 Message-ID: <20250424102509.1083185-11-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some MediaTek platforms already reserve a small block of memory for the audio frontend. These platforms reserve it at a fixed address, though it is unclear if that is due to hardware access restrictions or simply compacting the reserved memory blocks together. Reserve the same size of memory on the MT8173 as well, to align with the other platforms. This also helps with memory starvation as these devices commonly end up in low memory conditions. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts= /mediatek/mt8173.dtsi index 6d1d8877b43f..122a57c3780b 100644 --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi @@ -318,6 +318,14 @@ reserved-memory { #address-cells =3D <2>; #size-cells =3D <2>; ranges; + + afe_dma_mem: audio-dma-pool { + compatible =3D "shared-dma-pool"; + size =3D <0 0x100000>; + alignment =3D <0 0x10>; + no-map; + }; + vpu_dma_reserved: vpu-dma-mem@b7000000 { compatible =3D "shared-dma-pool"; reg =3D <0 0xb7000000 0 0x500000>; @@ -887,6 +895,7 @@ afe: audio-controller@11220000 { <&topckgen CLK_TOP_AUD_2_SEL>; assigned-clock-parents =3D <&topckgen CLK_TOP_APLL1>, <&topckgen CLK_TOP_APLL2>; + memory-region =3D <&afe_dma_mem>; }; =20 mmc0: mmc@11230000 { --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 CB44423ED74 for ; Thu, 24 Apr 2025 10:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490357; cv=none; b=Aw15ZSQmo09Cfi6ZnmFqa++zFyMzoXCwN3Wzw8EgYv85pvuhRzW9LooylBxdrZXIxkCitjCnxfhHjYMlQ7qy5sBFhG8kzPjv/PW23dlPH2gub9LRYGte36eYBaXxB0IJiBnrPcpCG4on+ugCxPgvF03N8vbdaiPh3hxI3CCJZgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490357; c=relaxed/simple; bh=v4fkIWZlRlBlwcudSsMGRFd1gy1KN6jxgz3zZ2PYfv0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KbatVnoLPJaRxHkaigrb2lil2iMt5EOlaV+soIVWpxtbn5EM+F1K/1Uc0e+KqMUjaW9F6wR/nHglo4KFJoC3RfUHj7OfY1SbeiexqO5m3Jig+W19p6/bUZCEehaxzdTyhemyUIBAm1gu8dxnJPFr9f/PFWrwWNfUElbh1Arx+YE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=EL6uNv5m; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="EL6uNv5m" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-227b828de00so8282915ad.1 for ; Thu, 24 Apr 2025 03:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490355; x=1746095155; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aSScOVwhUO+K0/3KqN7maXbkfUTR6/cC4fz9TlS9l30=; b=EL6uNv5m3QW1X/b7SX9m4M4lIslDnX9Y+xejcBfq+KqM24ImmxwfKeUABLnxl50UZF QZN2TR5j7p9j3XzWAJiQvxuGTjWqGiMKgMHNuKxxgwvdfBiSMN2s1ZptGv68RGvt8VcZ lQTp4E3fjxN//eSjSAoLN8xQJs/gSmlSDhL2w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490355; x=1746095155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aSScOVwhUO+K0/3KqN7maXbkfUTR6/cC4fz9TlS9l30=; b=gsNEOLpk4ssPl/p0DorjtpCjvAialR0zs8kkhhqIKpXtxJ5n9BzFaCiF5yNXV0kzn3 whb7Btu1nA3H4W4FunDR2ej4yNl9xHBXl+MUBkuh+fq9hcfIzCYCCVKAG3tr3U3brsy8 EkW6I10ws6TdHEYia6zX0J6X9qdMOAXbMwM3GjvmWL/UwkZLVncFXMAeXNTMOaojXs6C UlpO7M5r75st3SQRyl+WtrydJoPSSLOQAuH0WhDC2Nb9mskqV4FTODNrgF4+qmUfw5+m LQ1CIwHpZKx0Sp+CO3XlGBq7qeTvOSuTUCHM2XuIXT+nEA1+0oXtu6Y0GbNIiuPWn5uC bkoQ== X-Forwarded-Encrypted: i=1; AJvYcCVraBL2XOc+7WhQBZl3I3W+X08ieNufhEdDi8bb0PjrPo+4+4S5cgz0WKWW6TQ8eJ3T5+SJd42hL0LnAx8=@vger.kernel.org X-Gm-Message-State: AOJu0YyvYN3YaLC2wDQMpkTOUGeQ5wug1niZCOs1ikCrB6UAIFt8Yq2S D2AcZIgxB3crZaqS1vTaRKcBfTnN5nDGcKGtQNSVB0WFWypAkx2Lav607DcV+w== X-Gm-Gg: ASbGncs6jqHdRWZp4/8BiT+BKQnWpJnG6ZTyD9pf1+68NL1p9tg/9L71665SOoU8+iG 96cBWeS7FK8Wu54ha7NE8QHsbi5vZo5N8PcPC0wFmXX/0+1zpWTnaAspNEuoi9gt9t+Eyty3XXi xMWIogl06VIv2csPs3MTb/9VAfIdfd+KdxOXoCXm0jtvIsEZpBJe2Qvjr7EG1S9HohijNlamMsu QnYijHtUHzwVUDzbC8WXNOpxQSzwvBPiwg00hOMieY7DHV0Y5noLMy1DsXcfNxMTS7XNYPqh3uX Q4xLEzNHENwJlLJDfvOFvVv6EceGSVwyshssP5Xhb8wnOqiUsbixuVmTZA== X-Google-Smtp-Source: AGHT+IGVWgP+9f44cPO1R7mfB5z1uFUey5yQnac/oTnGNxfAaOr9FFOdDrHbUFBI3ie8mEMC8Jfp1w== X-Received: by 2002:a17:903:17ce:b0:223:5e76:637a with SMTP id d9443c01a7336-22db3c0e722mr27960035ad.23.1745490355124; Thu, 24 Apr 2025 03:25:55 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:54 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 11/13] arm64: dts: mediatek: mt8183-kukui: Reserve memory for audio frontend Date: Thu, 24 Apr 2025 18:25:05 +0800 Message-ID: <20250424102509.1083185-12-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some MediaTek platforms already reserve a small block of memory for the audio frontend. These platforms reserve it at a fixed address, though it is unclear if that is due to hardware access restrictions or simply compacting the reserved memory blocks together. Reserve the same size of memory on the MT8183 Kukui & Jacuzzi families as well, to align with the other MediaTek-based ChromeOS platforms. This also helps with memory starvation as these devices commonly end up in low memory conditions. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/bo= ot/dts/mediatek/mt8183-kukui.dtsi index 0fe9f2d1b912..00b97cfa0eec 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi @@ -85,6 +85,13 @@ reserved_memory: reserved-memory { #size-cells =3D <2>; ranges; =20 + afe_dma_mem: audio-dma-pool { + compatible =3D "shared-dma-pool"; + size =3D <0 0x100000>; + alignment =3D <0 0x10>; + no-map; + }; + scp_mem_reserved: memory@50000000 { compatible =3D "shared-dma-pool"; reg =3D <0 0x50000000 0 0x2900000>; @@ -198,6 +205,10 @@ tboard_thermistor2: thermal-sensor2 { }; }; =20 +&afe { + memory-region =3D <&afe_dma_mem>; +}; + &auxadc { status =3D "okay"; }; --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 49D27242D62 for ; Thu, 24 Apr 2025 10:25:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490360; cv=none; b=WjllBd7mn85cPwcQNrxSWJ+dK4xOmL/C0CYcCxfipXlMGTAq8hRjBBISRPnm6HhLKyaBA/rDXaFNQt5aLBHbHWD8g2g5/4x+t+kTSeke5d6ChU1H0ue5EZMjbwsu/xxLcqbKxjc4h5FeFhN/iIGKKjamvIRoyJLWnGTcvGWmnCg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490360; c=relaxed/simple; bh=amw58+Xn4jL5+0UqqZ24GKZxtkpLJLo2j7rkb2+VAu4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s9Lh0k1WwlNEQ5XGw8b5Q5RekDz9PigyPbzc4iNaRIUzC0dJM0n/xH2xOs5v8F/R9wGBrD7pBDThkJvONcm2izcuE25k/IC36mBavlU453V6F5vzSNwcf8BCJmSxLNl7VdvChE0DltZ7qqa+b2O+4vxvk63K+TQRqwBVQ/jmtBE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=UQFlFv33; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UQFlFv33" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-224191d92e4so8017025ad.3 for ; Thu, 24 Apr 2025 03:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490358; x=1746095158; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FmVpDCANpDWXjfc77hOC3nlqo3wLCB+cB+2xYUcVaDA=; b=UQFlFv33CuuL+I0ybw8YKAeiP3RwTi/JzKw76wo/1ev/K1zz+haQ0bFx5+LSU+A9EN 9aFBNJyel41G1aBpq2GKCQbPPRJKFkNpkdZXQOryUskmr+ON+tpP7jQ0MkSRdby8MlXJ Xzd/9gw9Bd9SlQK+s7mlI9ctLnjnqdEzhMzvc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490358; x=1746095158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FmVpDCANpDWXjfc77hOC3nlqo3wLCB+cB+2xYUcVaDA=; b=ugZpo5Dj3ExgMpGvEYylgeRir7L4bnrSbzwOLnLRLSGmS1T6uDNCCLH4sD1eoBSv/w V3hYU55UyGWrZ6/U02qiqmLCh5TAk7F5FBcZCILhmXONUtKq6Ym9kgmCTjWyf/Ja+MC7 D/NgQYpqcUEyNaTFsL1GfPp5oWR5bTON56dKgXJC/YCEZUukzQSyT4bcURqmk5GBs0IK OWD17OGaVRWWuIoaFwj2ymFIJUtbCoiAXMJZpgTIuO/x9XSu45VKGTVLECXACOQBh1HC sowcBtQngbGm5MW80SFRjN+D+AUvch0Rv34pnoC+Ho8QNmQUI7kL20zy8lebdEJztoA8 +EDA== X-Forwarded-Encrypted: i=1; AJvYcCU9is4z6qksf8Sj7h1VsKSAdp8Rg6RWBaAqPRDk1LXHlB8MvG74mlhsFbpPFHCsNhZOcRdP9Kra4e7tsNM=@vger.kernel.org X-Gm-Message-State: AOJu0YwKHGbcMB8aERlnZ1d8lzaSxfa0SByc0sKMRZtQCTZ4uLNvjvyq uf7qazb5bHUHxo+ycx0ZRYMPufVP3d6iJ+M1SuQIGNsJSwcJ06tSI/PWuP2pxg== X-Gm-Gg: ASbGncsiVH241tfZ29CdBn7ZmgdUSv4E6hokCzASA/fRJL3NTX6jani5ZcEUfOt5AKt 7/AkXECJYuEpgz6DzNKCwaR0xdek1CB0ownwYv/zsSoHxiLtliJb5z5M075/LmlVHRG2h2BgvXe ZzXGJDvcqa+3ECSQMdgRFgpyL9Df1RpbcHI9mxalyQXH6kcSQbuov7MJxKSSdSRf6nHRwCOqSY/ OZC4F7NrOVhar9ywUYXg20W7updyfjk15MJzcG5szg83J48JKq0NTZJiZdTRHLJvx3XQnOvL+dG YRlmiQQHcDKsmqU75m2c71/BwfWnxV/o3w1tqbsjgNPve1gjyKQ2O94QAw== X-Google-Smtp-Source: AGHT+IFNUWW8GiZ4JqKUF9pP/L7lY/ZM2afy9ZsZUC4Qoy35aYMkl4OZHCBcklsXj7mBYosm+Ajr0Q== X-Received: by 2002:a17:903:3c48:b0:229:1717:882a with SMTP id d9443c01a7336-22db3bae48bmr32665265ad.4.1745490358416; Thu, 24 Apr 2025 03:25:58 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:25:57 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 12/13] arm64: dts: mediatek: mt8186-corsola: Reserve memory for audio frontend Date: Thu, 24 Apr 2025 18:25:06 +0800 Message-ID: <20250424102509.1083185-13-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some MediaTek platforms already reserve a small block of memory for the audio frontend. These platforms reserve it at a fixed address, though it is unclear if that is due to hardware access restrictions or simply compacting the reserved memory blocks together. Reserve the same size of memory on the MT8186 Corsola family as well, to align with the other MediaTek-based ChromeOS platforms. This also helps with memory starvation as these devices sometimes end up in low memory conditions. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi b/arch/arm64/= boot/dts/mediatek/mt8186-corsola.dtsi index c864ed495702..b139588ae246 100644 --- a/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8186-corsola.dtsi @@ -161,6 +161,13 @@ reserved_memory: reserved-memory { #size-cells =3D <2>; ranges; =20 + afe_dma_mem: audio-dma-pool { + compatible =3D "shared-dma-pool"; + size =3D <0 0x100000>; + alignment =3D <0 0x10>; + no-map; + }; + adsp_dma_mem: memory@61000000 { compatible =3D "shared-dma-pool"; reg =3D <0 0x61000000 0 0x100000>; @@ -310,6 +317,7 @@ &adsp { }; =20 &afe { + memory-region =3D <&afe_dma_mem>; status =3D "okay"; }; =20 --=20 2.49.0.805.g082f7c87e0-goog From nobody Fri Dec 19 17:25:10 2025 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 2BF74242D9D for ; Thu, 24 Apr 2025 10:26:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490363; cv=none; b=H8SlSF2b0cWQyuIZwoZVWs0KC79fCzGKu/QAtstphcDJZA8axw0vIVXqzrZKJ5z3mK4XJdPW/XI2ueJfrSeJU7twjClzwVDlEo9FQtOmePyqWoX8JrALyGIhyGO/Q1wGIMtn8dsLGzj0AQwFg0wiu6ghKiBWRL7dR7pD/7T2Ngw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745490363; c=relaxed/simple; bh=1AP5rv5hz9Rs5QHv/2ZGUfum6cSdggllp0xp0DoZ+js=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A1DP+Jb8GX3UcD6l9VUfraeC6I9N+9HNymxhcBdfQn4q0ekK3QHma2FJyoSwvfiExv0hakOwI0V9u0onKMFyzZPuUOhY9xV5d4j5fKXP6mztHFqNL69NH/oY3/UsvrAwDFBD0O+R1lUddgEmqeICBr5rpiF8C/kmV0/hrzIwGFU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=XiKgYo4R; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="XiKgYo4R" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-22423adf751so8519655ad.2 for ; Thu, 24 Apr 2025 03:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1745490361; x=1746095161; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a6nLuv544CgGW21n1DbIuZxhKW3jrit2HZOkiVGCAv4=; b=XiKgYo4RIJW/vzXR9mTVYdsHCVzGLmGHmtdsiEeFK09XqqwJJNQC4gz+65ZxFsKMd4 mCRnEoL4x0hYJjsz7xyC/AHHGWBzkVMgr4rH2ziP9q89vY4pnf0/Is0PfVeYYAKcEmhE FDCfgX9ZQeFijcBmlDXES9iYCj8gMYqzN4LYk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745490361; x=1746095161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a6nLuv544CgGW21n1DbIuZxhKW3jrit2HZOkiVGCAv4=; b=BZmSzqwz8Orst/AqND/hSPyB1oBNdmx40xrk1+jfkMil6IwvyXS+aFHz3J5ddX0DMc 8XEH4KuPrHLt0DpJcOrbykKlXkjzvGak3aQYGFQWCnl9v3oUQTnOgtRCxbDultEOsuDx YV24uH1fwEBNrr3qOBQwzakZQT/4ZbcXi+PSiyLkYsNkhM89USodDVpLzUz00fpVozaU 3oZcAx9lUz44TmIOo+3ZFdsO+p4jIe0fZXCWVqDGdbzyV1bJOYYuLnr9Rx7ZKmuM/P1/ 0FY7wj67jjKKTnalmpfGtkQrQ7MJnlHX3NlFFJW1VTmw/utjFl2MG5v1Cj+s7ssAhwKZ lp1A== X-Forwarded-Encrypted: i=1; AJvYcCX+TUJk4tUacde3TeRtE9MOyhMe8P+4BHDOZGXlP/7QWsPNRvufcC5pddnafnNdQFjfOBHqqlMYzq6j5q0=@vger.kernel.org X-Gm-Message-State: AOJu0YwJGZNpBhpCCWyCy2r/yEK6CaGxBanVHowFUoGdf1Qv4b8p0+Ir EC9DCTrxnpaJLUg97ssqOlC6IKAsnttT1tehoaBwQyZMwr+aYFTUi3o4sTDm7g== X-Gm-Gg: ASbGnctPJhOQMcNOTo5onz/Z5zKEWiYA1XQcKu9fbQiCBWiGdtzSgoYKWjxcnCMLtaf BSXsn4990QJWEKCquwcN27IRG7TIN3JSUQej9S5uQTtWdEviZWF4T6SlxDO3Tu9apeAbRoBQu/3 kvoVEjwgEt2F+qX9m2blBGdqP99ZmZzy8JaAmSsJt2nUX8ll2+cYuDyhOE19DC36L7F3m4iKy23 YMvdkuAybhgdqODMhQ0BpVjm6UbmURlMCpMpKY0PhvkSfsKOqdr47z94efqxLr5SLQGF28uBRIi aQ0Tuqx9U4csBDgyEJX0Ng6UGvXKlpT3Cuq4iBz7MNrFq0L2IsEfzdwmtg== X-Google-Smtp-Source: AGHT+IEelhbgbGZri6Py80kdsIiPuav90J0vW3iMX5g3fAzfa3TjO84nP2ENhMsx6DVzKWavR3GEDw== X-Received: by 2002:a17:903:2311:b0:220:e9ac:e746 with SMTP id d9443c01a7336-22db3ded901mr33410315ad.53.1745490361492; Thu, 24 Apr 2025 03:26:01 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:fa13:e633:684b:257]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22db4dda40fsm9680305ad.104.2025.04.24.03.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Apr 2025 03:26:01 -0700 (PDT) From: Chen-Yu Tsai To: Liam Girdwood , Mark Brown , Matthias Brugger , AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Chen-Yu Tsai , Jaroslav Kysela , Takashi Iwai , Jiaxin Yu , linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 13/13] arm64: dts: mediatek: mt8192-asurada: Reserve memory for audio frontend Date: Thu, 24 Apr 2025 18:25:07 +0800 Message-ID: <20250424102509.1083185-14-wenst@chromium.org> X-Mailer: git-send-email 2.49.0.805.g082f7c87e0-goog In-Reply-To: <20250424102509.1083185-1-wenst@chromium.org> References: <20250424102509.1083185-1-wenst@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some MediaTek platforms already reserve a small block of memory for the audio frontend. These platforms reserve it at a fixed address, though it is unclear if that is due to hardware access restrictions or simply compacting the reserved memory blocks together. Reserve the same size of memory on the MT8192 Asurada family as well, to align with the other MediaTek-based ChromeOS platforms. Signed-off-by: Chen-Yu Tsai Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/= boot/dts/mediatek/mt8192-asurada.dtsi index 516fba9b3c6d..0574fe50468f 100644 --- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi @@ -199,6 +199,13 @@ reserved_memory: reserved-memory { #size-cells =3D <2>; ranges; =20 + afe_dma_mem: audio-dma-pool { + compatible =3D "shared-dma-pool"; + size =3D <0 0x100000>; + alignment =3D <0 0x10>; + no-map; + }; + scp_mem_reserved: scp@50000000 { compatible =3D "shared-dma-pool"; reg =3D <0 0x50000000 0 0x2900000>; @@ -277,6 +284,10 @@ sound: sound { }; }; =20 +&afe { + memory-region =3D <&afe_dma_mem>; +}; + &dpi0 { pinctrl-names =3D "sleep", "default"; pinctrl-0 =3D <&dpi_pin_default>; --=20 2.49.0.805.g082f7c87e0-goog