From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 3D1ED3A6F04 for ; Mon, 20 Apr 2026 17:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706812; cv=none; b=u3mSMb57HRtjtbsYu8R2LvtUGBEnqWvRzaeOkx9cKYrtugFgagRsYkUuY7lKTno/UHRF5YbJ9slpYhV/MKoHOPX9ZhFo+rUasDNs4ou7Tb/bG0p7Ui4RWYQnWO/DeeGfvh/3fQKF3CuaTlZ6cWI7OKmZkzvy4rtNsvo6oWxawk8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706812; c=relaxed/simple; bh=OdFNZphZZrwzkL602uRB/9fZndrRswg6kWPWUQ83lLA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bX1tp+yx+xH7oWcV2/ZsY3gKvr2owXYWWAV43kt8Secrr4v1a9jSZ0H8bWR5Rar6ujINrGCB/Z2IM0jJ2h19+imBS4rKXWe7QZvehJ06qD0Jx7Yy6vd5iVBeqjbF/DY/PT3n33sw1DSNlqKww21YOZg9gKDlpaPB0YVVxKHF898= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rrHDxo2i; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rrHDxo2i" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-488ad135063so26874845e9.0 for ; Mon, 20 Apr 2026 10:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706806; x=1777311606; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IGpK86HdMgvrqoy2bj1skBfpkVmo7qxsIa2pqonJJOg=; b=rrHDxo2ibJheWrNlXOa8K13O9NAB8XL2VWxMTCrNbL62sxlPga/v2DAtbxCmp98V0+ 5A6NYV4qPA4MPfwWBaBXRMBK9LLyF5iVBpj+0Q5hMOtXFI/xXNBmO264FASSCgBHDJwQ +lAy+5pDB5z2pmvASGUaO2RaiONXMaZ1zNut5XROVCpySMZOvosLreVRx/I7MwXBbTAK BbIHNSi9DkLxZ5NtWCME8VIbbKuoRMnUfoBNAGVpNeYGkr8dgCU0DjCCikRKvtGT5v7y NA8gLbeBdN51K9Ge7ZlaA8F/zxQ63Y2L6P5TlH2oXJWwzgtf1nJHGdFiD0Oe7bvYbhoZ Wnhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706806; x=1777311606; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=IGpK86HdMgvrqoy2bj1skBfpkVmo7qxsIa2pqonJJOg=; b=fMPhrYBeP/NgHvBuYwQB080W0JVycO81oXp5tRYi4t0Y+luQWlVmJ443w0RMoCxWpP wd2TF5NHxnqjjAszRlUVnyLmVmZMLjGIrbKvQYPE2YUI73VqJte7N+4AafrbJHZtvO3E U/ke/RuzVWruZCt6+w8MPClt2JJ+/DtSwEoBAiNnj2aPo4p5X/7Iymh9JQNb6mkuW7P1 nKp3xHA5flD1NONXZCH6GYB0eZHpOAFCcY8QanLBkuhpjUFib18kRnaNLHFOHPn5x6rZ mLG8c+jk7df/8P/mWGt1y0hbiezLiBa3OTWRzRVZi/VE6GhDk1kTWL916tUbKxfg0SVX VQag== X-Forwarded-Encrypted: i=1; AFNElJ/MsSHL8p59/CSzmLioqtkxSXw19k0QGk4+9k9uqY3L+diapTnd8d05JEsN3HhZ/Ic2cT7fagEZLqtuhbk=@vger.kernel.org X-Gm-Message-State: AOJu0YzonT6jWeHeg+hTEZ+WpspjOIrh/0VbhhwffXZnXJ8Pue83fsaR +rByPXAuOLYfI6q63BA593/ufqjPY3GOAV9aBvjzB7EPGTADqBrv5L9kflSyw2Gq2R8= X-Gm-Gg: AeBDies6cO5ycunpAlKd8wn8hUZS3tb4GLRYUP4KB1C0tYaQHLsI41He1AsVfEyx3zb +ZAxa7QAsWMDCbFaGZrFrDfjdy7DTDtss6OWNrq9VrbdvFYMo9ahV+X28Z+I9TC1kPUdkohv1Zy SugH+kkAl6Jfh190UZyZ/AyhxikfwUYJF3/4X5iGm5AjgGYYqsC2dURs8ahvXoMQyPNTGQLqsPA 2fO8KPVfX5beBbVH642LoPPPMIsib9UJUY3MoJQg/xpo1ZgVhrt+U6JwQQnxPoeVNpqqcBOFLc0 Uyf+A5HWaGlHFtRv5JBn6T/03h6KpOuEtzThRbAEgnVn7SUBplP9dbMBnjldfwzCKx/X3/qF1ks BICBF9tnOKJcdc8wp4g0LV7+KMb7U1uGypMqkjpCszZqiN4wVmFjsqK3QAKdBaOPCe6BoOEsVPC 5hOlMs19OMUU1vexTAjBmaFYE3n9tyr087NHsEloIwXAfe8T9aWGbmEKlTGE5iDbju19RekR9W+ tFwdqZo4GoVFPBxkQ== X-Received: by 2002:a05:600c:8909:b0:489:1b10:d896 with SMTP id 5b1f17b1804b1-4891b10dd45mr72554725e9.0.1776706806302; Mon, 20 Apr 2026 10:40:06 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:06 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:47 +0000 Subject: [PATCH v3 01/10] dt-bindings: thermal: Add Google GS101 TMU Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-1-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=3375; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=OdFNZphZZrwzkL602uRB/9fZndrRswg6kWPWUQ83lLA=; b=uZ84z6z+wMUZD2LCmSNxpX7ypI6Ejebtkx9zuWyST/FHfavxQRwvKlK/M3o6Jibkuo6d1IFzP x5ezYFuf3VqDvSctkQKRqUQGVi6aa9K5voFayeO/0pDlk6S9qRr9GXu X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Document the Thermal Management Unit (TMU) found on the Google GS101 SoC. The GS101 TMU utilizes a hybrid control model shared between the Application Processor (AP) and the ACPM (Alive Clock and Power Manager) firmware. This hybrid ACPM TMU architecture is also present on other Samsung Exynos SoCs (e.g., AutoV920, Exynos850). While the TMU is a standard memory-mapped IP block, on this platform the AP's direct register access is restricted to the interrupt pending (INTPEND) registers for event identification. High-level functional tasks, such as sensor initialization, threshold programming, and temperature reads, are delegated to the ACPM firmware. Signed-off-by: Tudor Ambarus Reviewed-by: Krzysztof Kozlowski --- .../bindings/thermal/google,gs101-tmu-top.yaml | 68 ++++++++++++++++++= ++++ 1 file changed, 68 insertions(+) diff --git a/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top= .yaml b/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml new file mode 100644 index 000000000000..d0eb2393d581 --- /dev/null +++ b/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/google,gs101-tmu-top.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung Exynos ACPM Thermal Management Unit (TMU) + +maintainers: + - Tudor Ambarus + +description: + The Samsung Exynos ACPM TMU is a thermal sensor block found on Exynos + based platforms (such as Google GS101 and Exynos850). It supports + both direct register-level access and firmware-mediated management + via the ACPM (Alive Clock and Power Manager) firmware. + + On these platforms, the hardware is managed in a hybrid fashion. The + Application Processor (AP) maintains direct memory-mapped access + exclusively to the interrupt pending registers to identify thermal + events. All other functional aspects - including sensor + initialization, threshold configuration, and temperature acquisition + - are handled by the ACPM firmware. The AP coordinates these + operations through the ACPM IPC protocol. + +properties: + compatible: + const: google,gs101-tmu-top + + reg: + maxItems: 1 + + clocks: + items: + - description: APB peripheral clock (PCLK) for TMU register access. + + interrupts: + maxItems: 1 + + "#thermal-sensor-cells": + const: 1 + + samsung,acpm-ipc: + $ref: /schemas/types.yaml#/definitions/phandle + description: Phandle to the ACPM IPC node. + +required: + - compatible + - reg + - clocks + - interrupts + - "#thermal-sensor-cells" + +additionalProperties: false + +examples: + - | + #include + #include + + thermal-sensor@100a0000 { + compatible =3D "google,gs101-tmu-top"; + reg =3D <0x100a0000 0x800>; + clocks =3D <&cmu_misc CLK_GOUT_MISC_TMU_TOP_PCLK>; + interrupts =3D ; + #thermal-sensor-cells =3D <1>; + samsung,acpm-ipc =3D <&acpm_ipc>; + }; --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 A41D23A758C for ; Mon, 20 Apr 2026 17:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706813; cv=none; b=LtOSHgDHcX/tGWpIs5igv/Zo68ZjBtJ2vocW8/MNbZk0IOJwWsqpgVepfIr2oNa6SimS7jUeoCvs+YrDaNbgpeGGhAssNeMa6tSq2yCJR94v0l+oQmpWMcxSdK3wgdTZlahauV4hd+3PW90+JjcPrNVdmAyihLvyqortYNeshvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706813; c=relaxed/simple; bh=WKLGUtHcCNyB75a/mIe0Fi5jZUq9xL1obF/iPOKGPO0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ATy21ZxlzsofwDlYHF5hmICXEq+oSvPjTXdrUNNfPYcNTEtdoisbs1weQBdNwnvdigtDcF1q60J6CnbFJhVpCGnUVG7Uyn/252wymG78th2JEIdIfGcHMp00pZ1m5emhiPtD55d9feh5skRTC3D9nKgNy1E8wUNTz3ONYiUEQRU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=pHQxB6IQ; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pHQxB6IQ" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4891c0620bcso10358815e9.1 for ; Mon, 20 Apr 2026 10:40:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706807; x=1777311607; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=UQZMf3eIsjFVRWF3sE9lpUJLt72fcFn9iR6RKZYiOCs=; b=pHQxB6IQCIrDn+3pfFpg/Jcabfmo/j2yJ+1pmIcj4QHNjvlaYXBU6Qr5yL2/hgrvdm sDJ0dRDMvVvy/cd/xc8VkvMaKc9synXKZ147S1EOH6mxQQpOU6o8am5CBRfzBsjAV9Rz Dpg9tiZDepiQNzq5Jd5qOUEsowTwfMfguKRhjBunjIOlXSbrLEfwLvleSJpgssx85VGm fGgyMAiScZBJt2luYFTtv5iQFuA6SpEMhjHAhptyE5C/+rs+G5acrAKsFObe1FuQL0V2 BgxJCoRs+PrQYYm3DGYRIk7En5F/t4rlIMAiBcX7KDzJ0KYLGZOqk28WDvWqATJPyCJo zd+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706807; x=1777311607; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=UQZMf3eIsjFVRWF3sE9lpUJLt72fcFn9iR6RKZYiOCs=; b=AZApDZXLql0JUks5VQS50fljMDfnYVushUIV+cfQlNHSw1lWTYjV2CG49c/9Bu2vYa Cq36O9I2rBKF29rq2U1tU6PvewA1LpQJ5Y2wpQwcAK0YQFQKDOTj2E6KKlpkQXGG6SpR r4IjfCD9cmZnvH/sKS1PKCx2U23a2rpCkPYHC6oRkdeUIF3kVND03Ff+g9FXhdfD84Wn fAt3104+sHFHjovoHSdZadJbWKJ3ypfFOUJb9hKcKb07ZGU7PvSJacKsCnYdwvwYWK3I ah9Z33Mt1GSp9GyuBNvE7wmGDhdGxlokfyz/SwQeUhMl3h5GnxH1/nA1X13TLSMS/aVM c10w== X-Forwarded-Encrypted: i=1; AFNElJ8O4elhKNVmEKr0gxCnBIVB/oveB/WAaVpNV9jgAMoCFcbpCYx8zTlk6gFgegWohH2yQRwJtKtMklUtJ6Y=@vger.kernel.org X-Gm-Message-State: AOJu0YwILBsWzcPZBbPLF3zFNZGl1R+Skgaxsnd6kLM1/TINhBDSZuIn h+BrByoQj5tI0EnadsQO9HYREM06tB1ZOUv9G+gQlH9jcKfUSFTCDNzH/txjAAN2RuQ= X-Gm-Gg: AeBDiesTQYh0+N+zArjMzutJsbfowS4g+WIYEi4niFeO7H6bqAzBDynAfqlV7TxI6JC eftl1ksrBPYKhh8UBurY6Ojb0jGjWhFQaDTxI76MxUYGZfhIYO+i9il+2zIziQZSnqBAmiEAe6e P9SNPmalgo1RkslTWCfs9V5amVr9Cxyg+eqeDZPSU7qkuasvl3FDxfemNI4ZuaXXPbqcYGuX0oE dIbm/VW+dLOauquzyyIBvZhmRu3wDNjhQonphg8iLE1Aq4xyarBz1HYDued6Vi2wF8N1zjCyjUC QAYYRBx/EORj1GnCGLZHSZ9CbwmwLaRIK9OBPU7d89R6xyLhacufJBqBkSC5C6lExOWyyyBWnTk 32G6ko0XU+P9vEchZjLVwGkP+uALHTlZurjlYxG0XatJb+zBxqbl8acSwrZ4kU6xWwZW9UM6KJy oiovuuVN2M8SfzMsfLBozI1g4YEu7aG9FU9/eZc4m7mZKnofSPoYSJf6tbvqTC6YLNVlVpbwQKG tl2FgcibskN3xRruA== X-Received: by 2002:a05:600c:8b38:b0:485:39b2:a47c with SMTP id 5b1f17b1804b1-488fb796fa0mr194800345e9.25.1776706806875; Mon, 20 Apr 2026 10:40:06 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:06 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:48 +0000 Subject: [PATCH v3 02/10] firmware: samsung: acpm: Consolidate transfer initialization helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-2-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=6621; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=WKLGUtHcCNyB75a/mIe0Fi5jZUq9xL1obF/iPOKGPO0=; b=ytLvdkH0V8xD4mIf4tcLZpXLnSbLl/4UU3zbh5ud7q3fmPRkdRuj8JAUqTQnvZ4eRLJtHyGFE 59M1NRPpitpBmHv1QMuyFz62NbxsoDC/uwHQG7F+8TLWYZIAMDziI7M X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Both the DVFS and PMIC ACPM sub-drivers implement their own identical local helper functions (acpm_dvfs_set_xfer and acpm_pmic_set_xfer) to initialize the acpm_xfer structure before sending an IPC message. Move this logic into a single centralized helper, acpm_set_xfer(), in the core ACPM driver to reduce boilerplate and code duplication. In addition to cleaning up the DVFS and PMIC implementations, this centralized method will also be utilized by the upcoming Exynos ACPM Thermal Management Unit (TMU) driver. Signed-off-by: Tudor Ambarus --- drivers/firmware/samsung/exynos-acpm-dvfs.c | 17 ++--------------- drivers/firmware/samsung/exynos-acpm-pmic.c | 20 +++++--------------- drivers/firmware/samsung/exynos-acpm.c | 23 +++++++++++++++++++++++ drivers/firmware/samsung/exynos-acpm.h | 2 ++ 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/drivers/firmware/samsung/exynos-acpm-dvfs.c b/drivers/firmware= /samsung/exynos-acpm-dvfs.c index 06bdf62dea1f..7266312ef5a6 100644 --- a/drivers/firmware/samsung/exynos-acpm-dvfs.c +++ b/drivers/firmware/samsung/exynos-acpm-dvfs.c @@ -21,19 +21,6 @@ #define ACPM_DVFS_FREQ_REQ 0 #define ACPM_DVFS_FREQ_GET 1 =20 -static void acpm_dvfs_set_xfer(struct acpm_xfer *xfer, u32 *cmd, size_t cm= dlen, - unsigned int acpm_chan_id, bool response) -{ - xfer->acpm_chan_id =3D acpm_chan_id; - xfer->txcnt =3D cmdlen; - xfer->txd =3D cmd; - - if (response) { - xfer->rxcnt =3D cmdlen; - xfer->rxd =3D cmd; - } -} - static void acpm_dvfs_init_set_rate_cmd(u32 cmd[4], unsigned int clk_id, unsigned long rate) { @@ -51,7 +38,7 @@ int acpm_dvfs_set_rate(struct acpm_handle *handle, u32 cmd[4]; =20 acpm_dvfs_init_set_rate_cmd(cmd, clk_id, rate); - acpm_dvfs_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, false); + acpm_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, false); =20 return acpm_do_xfer(handle, &xfer); } @@ -71,7 +58,7 @@ unsigned long acpm_dvfs_get_rate(struct acpm_handle *hand= le, int ret; =20 acpm_dvfs_init_get_rate_cmd(cmd, clk_id); - acpm_dvfs_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, true); + acpm_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, true); =20 ret =3D acpm_do_xfer(handle, &xfer); if (ret) diff --git a/drivers/firmware/samsung/exynos-acpm-pmic.c b/drivers/firmware= /samsung/exynos-acpm-pmic.c index 0c50993cc9a8..f032f2c69685 100644 --- a/drivers/firmware/samsung/exynos-acpm-pmic.c +++ b/drivers/firmware/samsung/exynos-acpm-pmic.c @@ -58,16 +58,6 @@ static inline u32 acpm_pmic_get_bulk(u32 data, unsigned = int i) return (data >> (ACPM_PMIC_BULK_SHIFT * i)) & ACPM_PMIC_BULK_MASK; } =20 -static void acpm_pmic_set_xfer(struct acpm_xfer *xfer, u32 *cmd, size_t cm= dlen, - unsigned int acpm_chan_id) -{ - xfer->txd =3D cmd; - xfer->rxd =3D cmd; - xfer->txcnt =3D cmdlen; - xfer->rxcnt =3D cmdlen; - xfer->acpm_chan_id =3D acpm_chan_id; -} - static void acpm_pmic_init_read_cmd(u32 cmd[4], u8 type, u8 reg, u8 chan) { cmd[0] =3D FIELD_PREP(ACPM_PMIC_TYPE, type) | @@ -86,7 +76,7 @@ int acpm_pmic_read_reg(struct acpm_handle *handle, int ret; =20 acpm_pmic_init_read_cmd(cmd, type, reg, chan); - acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); + acpm_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, true); =20 ret =3D acpm_do_xfer(handle, &xfer); if (ret) @@ -119,7 +109,7 @@ int acpm_pmic_bulk_read(struct acpm_handle *handle, return -EINVAL; =20 acpm_pmic_init_bulk_read_cmd(cmd, type, reg, chan, count); - acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); + acpm_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, true); =20 ret =3D acpm_do_xfer(handle, &xfer); if (ret) @@ -159,7 +149,7 @@ int acpm_pmic_write_reg(struct acpm_handle *handle, int ret; =20 acpm_pmic_init_write_cmd(cmd, type, reg, chan, value); - acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); + acpm_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, true); =20 ret =3D acpm_do_xfer(handle, &xfer); if (ret) @@ -199,7 +189,7 @@ int acpm_pmic_bulk_write(struct acpm_handle *handle, return -EINVAL; =20 acpm_pmic_init_bulk_write_cmd(cmd, type, reg, chan, count, buf); - acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); + acpm_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, true); =20 ret =3D acpm_do_xfer(handle, &xfer); if (ret) @@ -229,7 +219,7 @@ int acpm_pmic_update_reg(struct acpm_handle *handle, int ret; =20 acpm_pmic_init_update_cmd(cmd, type, reg, chan, value, mask); - acpm_pmic_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id); + acpm_set_xfer(&xfer, cmd, ARRAY_SIZE(cmd), acpm_chan_id, true); =20 ret =3D acpm_do_xfer(handle, &xfer); if (ret) diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/sams= ung/exynos-acpm.c index 16c46ed60837..8b2529e50328 100644 --- a/drivers/firmware/samsung/exynos-acpm.c +++ b/drivers/firmware/samsung/exynos-acpm.c @@ -463,6 +463,29 @@ int acpm_do_xfer(struct acpm_handle *handle, const str= uct acpm_xfer *xfer) return acpm_wait_for_message_response(achan, xfer); } =20 +/** + * acpm_set_xfer() - initialize an ACPM IPC transfer structure. + * @xfer: pointer to the ACPM transfer structure that is being initialized. + * @cmd: pointer to the buffer containing the command to be transmitted + * to the ACPM firmware. + * @cmdlen: size (count) of the command. + * @acpm_chan_id: mailbox channel identifier. + * @response: boolean flag indicating whether the kernel expects the ACPM + * firmware to send a reply to this specific command. + */ +void acpm_set_xfer(struct acpm_xfer *xfer, u32 *cmd, size_t cmdlen, + unsigned int acpm_chan_id, bool response) +{ + xfer->acpm_chan_id =3D acpm_chan_id; + xfer->txcnt =3D cmdlen; + xfer->txd =3D cmd; + + if (response) { + xfer->rxcnt =3D cmdlen; + xfer->rxd =3D cmd; + } +} + /** * acpm_chan_shmem_get_params() - get channel parameters and addresses of = the * TX/RX queues. diff --git a/drivers/firmware/samsung/exynos-acpm.h b/drivers/firmware/sams= ung/exynos-acpm.h index 5df8354dc96c..3d8e33040444 100644 --- a/drivers/firmware/samsung/exynos-acpm.h +++ b/drivers/firmware/samsung/exynos-acpm.h @@ -17,6 +17,8 @@ struct acpm_xfer { =20 struct acpm_handle; =20 +void acpm_set_xfer(struct acpm_xfer *xfer, u32 *cmd, size_t cmdlen, + unsigned int acpm_chan_id, bool response); int acpm_do_xfer(struct acpm_handle *handle, const struct acpm_xfer *xfer); =20 --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 9D92C3A7587 for ; Mon, 20 Apr 2026 17:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706813; cv=none; b=pJKgl+QgCEPAP3IaQ5ESokNK9b71anCKzUA6CDE3NyeSzR7TpVxmjWAS3K1jP2UbCnNjuQUTXMZc76fbYBitggYBnx5/PXu7Fv3OafzUdsF5XhXFzRwZ9dWltIqgtnNAgwP8OeYgDfGJvho/qv2NiEfpF3xeIN4DJJNbmGLHZlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706813; c=relaxed/simple; bh=49BtV4liclRnJ5e6tUfHwtwQp6Rtyy5+WI8PtQcjUpM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ck0XG1W/2Bsgn/UBJkslqCxk6MQ+W0TKfevwCfTsDRF45nlwQXnyRynGNWVHUnX/RTnREobgyLsBAqqfKRooyn0HBhD03FsvZsmN3rJCEXmnW77dKhEjn8jRxghEc1wFGq0vP3F4SJlRH4GWYdR1QmD05DxQK5EBrS51IA9eCtw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=pu2puW6w; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pu2puW6w" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4891e5b9c1fso11238485e9.2 for ; Mon, 20 Apr 2026 10:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706807; x=1777311607; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=kIQGoy6fl4lhGyxodk/fSO9eXPaG/yS/b0aAUL+PrPk=; b=pu2puW6wiYhIQyvZ6Bv69jrBzkXu9fblMWyeUCZtxjjX0nVhoCrk6h7vWzfXcxaGBi /6VHvJDfMQTZ0vHjD2iNjly+XL9yAYF582FCduP8c9vbJehXi9jHZWLGDBDO2IuT7bfP xG2Zw6N/DZSjbl0TOEYdpQVtWSg4qhLL7qFYRpTc7lVvRbQ8QSLtSrX9uWy9NJY2Njbb KJijcabD1ruK3zh84hdh8Mi79RFYYdy40LuWt2I91abMLVUV5W7mhcUl4f+LzkQkS4Qb K7mFzDtV+ry5UF1qN54siF6hMlu6VYMbelQYlPX1qG41hKQEevCTFT6lvuZxVHO5sJ2i LK1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706807; x=1777311607; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=kIQGoy6fl4lhGyxodk/fSO9eXPaG/yS/b0aAUL+PrPk=; b=mbh09FbJfvHR8NyUtA7mVk9NfoClBeBlhbkDrpQJMRa9h08osaLSMDq1dkmbC+bdl5 1497fhsc7wP+01tLOUTL4BM1dEl/Q0y2qEAiuTLtwPiGZB9pQqQAGWqP76lNLNZiX98r bGjAp711bZPJ6/wloyDNTR7+zlhbYophsXjqGIGp7iPG7gGxSqD1c7BFD6n8u8skKC2N EG+Dqx7MBBp+yx5XuW6Q0/zW1dr99DxGoTfyhNBKn6/hWOK0eiOHs9CSAmv4DWVJMXtp QBQZyy7I4AFaVHtMK9Ux39LT26IM43eTPQkhUqKgSkjiGReXNBOJPdMUz9KgGqJpy4TC SB9w== X-Forwarded-Encrypted: i=1; AFNElJ9ZvM2Z9QbIBSs0cx3O+BrRcenDnsKOpuF+gdMQgN2xv4JGDRtNM6HZBLSdO8+HfhBSZZDUl8/kS1m/Ny4=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4F/tcoBnZFbBw08AN5GI31PrIjjgOSpWtQDuS3JpbVjopFNTv p4dncnUW1/j3V8IHxOfKkoe/IvyTTiaVkTO2GJXF1en0cBPNO3vxBeT3UEDqabkT1m8= X-Gm-Gg: AeBDievPPIuKXvJ8Lu0fVAPovMP12lnG/0rqGHcE32NXDxP1xxoyl1He8Cj4PYIVeka mHbpOqglIAcLpVfMj+a5LiRiSQJolyMXojmktGubJxEUXZATUCuOkxg39T3kno0w0atbW7O7wns AtBQkhDxMoZE539lVETI3pvbSGdQvR7d3Fc69ECWnJDQna6JQVtOx/HTJ0aWx/KcCTWnRxfWILY TtrrDqhngGt1j4YVBic9B66SF/OJm01SCsVrcEhRM2DII6Q867pAHA/Y4euzP8vetx0lWW/cRNr Cqx1oWQXDb1zbYE2dhQL9oUpGBDMid0HnwkyIXtGw23QeXJ1YKkAjRcfW4Ui5cNhzwwkZmXeAvx IkLE2C+ycPu+Yj8YG8d0rqcTnQDuncKnTScVjPSkB0e88QaJHIhbhhFz8PxhwfEk3OcyJ0V7Vbf /Xlrg8uuUpD4qJMPXjQgS3TuUDp4L54uekxZrTrIkwxFnRDQ36Od49xKIK1yw9vFr/PN6twRnOZ PdiDy7gYY0OvzrkMQ== X-Received: by 2002:a05:600c:c0c8:b0:488:a824:fe04 with SMTP id 5b1f17b1804b1-488fb787bfdmr160240165e9.26.1776706807433; Mon, 20 Apr 2026 10:40:07 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:07 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:49 +0000 Subject: [PATCH v3 03/10] firmware: samsung: acpm: Drop redundant _ops suffix in acpm_ops members Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-3-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=4439; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=49BtV4liclRnJ5e6tUfHwtwQp6Rtyy5+WI8PtQcjUpM=; b=Pb4Ofrj7eCzqfvbfC4jlUZiTiFA9g6OyHFVOMPAZ6LNGAdtEXvx8niESMIV34rfDTzWwZ5BSc ToF6YjPTTDyBqda5yHWVBCS1dGST4FFpBxbq6/jLClzYXE6tQ6i/abx X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Rename the `dvfs_ops` and `pmic_ops` members of `struct acpm_ops` to `dvfs` and `pmic` respectively. Since these members are housed within the `acpm_ops` structure and utilize the `acpm_*_ops` types, the `_ops` suffix on the variable names creates unnecessary redundancy (e.g., `handle.ops.dvfs_ops`). This cleanup removes the stuttering, leading to cleaner consumer code. Signed-off-by: Tudor Ambarus Acked-by: Lee Jones --- drivers/clk/samsung/clk-acpm.c | 8 ++++---- drivers/firmware/samsung/exynos-acpm.c | 4 ++-- drivers/mfd/sec-acpm.c | 6 +++--- include/linux/firmware/samsung/exynos-acpm-protocol.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c index d8944160793a..93667777094c 100644 --- a/drivers/clk/samsung/clk-acpm.c +++ b/drivers/clk/samsung/clk-acpm.c @@ -68,8 +68,8 @@ static unsigned long acpm_clk_recalc_rate(struct clk_hw *= hw, { struct acpm_clk *clk =3D to_acpm_clk(hw); =20 - return clk->handle->ops.dvfs_ops.get_rate(clk->handle, - clk->mbox_chan_id, clk->id); + return clk->handle->ops.dvfs.get_rate(clk->handle, clk->mbox_chan_id, + clk->id); } =20 static int acpm_clk_determine_rate(struct clk_hw *hw, @@ -89,8 +89,8 @@ static int acpm_clk_set_rate(struct clk_hw *hw, unsigned = long rate, { struct acpm_clk *clk =3D to_acpm_clk(hw); =20 - return clk->handle->ops.dvfs_ops.set_rate(clk->handle, - clk->mbox_chan_id, clk->id, rate); + return clk->handle->ops.dvfs.set_rate(clk->handle, clk->mbox_chan_id, + clk->id, rate); } =20 static const struct clk_ops acpm_clk_ops =3D { diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/sams= ung/exynos-acpm.c index 8b2529e50328..39d3d2317659 100644 --- a/drivers/firmware/samsung/exynos-acpm.c +++ b/drivers/firmware/samsung/exynos-acpm.c @@ -616,8 +616,8 @@ static int acpm_channels_init(struct acpm_info *acpm) */ static void acpm_setup_ops(struct acpm_info *acpm) { - struct acpm_dvfs_ops *dvfs_ops =3D &acpm->handle.ops.dvfs_ops; - struct acpm_pmic_ops *pmic_ops =3D &acpm->handle.ops.pmic_ops; + struct acpm_dvfs_ops *dvfs_ops =3D &acpm->handle.ops.dvfs; + struct acpm_pmic_ops *pmic_ops =3D &acpm->handle.ops.pmic; =20 dvfs_ops->set_rate =3D acpm_dvfs_set_rate; dvfs_ops->get_rate =3D acpm_dvfs_get_rate; diff --git a/drivers/mfd/sec-acpm.c b/drivers/mfd/sec-acpm.c index 0e23b9d9f7ee..9e15b260b8df 100644 --- a/drivers/mfd/sec-acpm.c +++ b/drivers/mfd/sec-acpm.c @@ -391,7 +391,7 @@ static int sec_pmic_acpm_bus_write(void *context, const= void *data, { struct sec_pmic_acpm_bus_context *ctx =3D context; struct acpm_handle *acpm =3D ctx->shared->acpm; - const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic_ops; + const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic; size_t val_count =3D count - BITS_TO_BYTES(ACPM_ADDR_BITS); const u8 *d =3D data; const u8 *vals =3D &d[BITS_TO_BYTES(ACPM_ADDR_BITS)]; @@ -411,7 +411,7 @@ static int sec_pmic_acpm_bus_read(void *context, const = void *reg_buf, size_t reg { struct sec_pmic_acpm_bus_context *ctx =3D context; struct acpm_handle *acpm =3D ctx->shared->acpm; - const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic_ops; + const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic; const u8 *r =3D reg_buf; u8 reg; =20 @@ -430,7 +430,7 @@ static int sec_pmic_acpm_bus_reg_update_bits(void *cont= ext, unsigned int reg, un { struct sec_pmic_acpm_bus_context *ctx =3D context; struct acpm_handle *acpm =3D ctx->shared->acpm; - const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic_ops; + const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic; =20 return pmic_ops->update_reg(acpm, ctx->shared->acpm_chan_id, ctx->type, r= eg & 0xff, ctx->shared->speedy_channel, val, mask); diff --git a/include/linux/firmware/samsung/exynos-acpm-protocol.h b/includ= e/linux/firmware/samsung/exynos-acpm-protocol.h index 13f17dc4443b..62a3eb450067 100644 --- a/include/linux/firmware/samsung/exynos-acpm-protocol.h +++ b/include/linux/firmware/samsung/exynos-acpm-protocol.h @@ -35,8 +35,8 @@ struct acpm_pmic_ops { }; =20 struct acpm_ops { - struct acpm_dvfs_ops dvfs_ops; - struct acpm_pmic_ops pmic_ops; + struct acpm_dvfs_ops dvfs; + struct acpm_pmic_ops pmic; }; =20 /** --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 72E293A7820 for ; Mon, 20 Apr 2026 17:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; cv=none; b=d8txx3IaIyKP62HAI0rObEMHNyAq+/o2U73Tw/FgUKPrEjJSps7lRbvXw8QX9b3iHyFD8Vf5y9R0HnZsIrSPv40iZygGR9ruyQ6AEj9/7GRCRwWFL+wZTa+NBRxCN01ZASu1Sg78hlnH1zCoUUzcfEWSgYDYwU56CRexAUObl+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; c=relaxed/simple; bh=TKfgOUvv2UcX7X0tyk1IsalC6JmJHiID4ANvKVR4gGI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EXjbiLxnpilBLyIHr7lMG2rr9UZ/xNtWAztIfk5NBTtzFGTJMpCjrt/KpjtXcysRFk8iK3NWQ+PUERv/WhIOB4rCMwX3RD3EbbF4R1olCiMYy8+yxdss4CBjz6s3zRfsIof49jNKbnAeXkd9qZjJtFQ8j5Qtb5dB87yAKYOOwIY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=GiX7I7HB; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GiX7I7HB" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4891cd41959so13184925e9.3 for ; Mon, 20 Apr 2026 10:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706808; x=1777311608; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=vxBc/M4G+txQiEXs+oWY+3uh4E2qPUY9zSyWwwZhU0Q=; b=GiX7I7HBKiBuzrFsItzQKeknAEBgGUs4GzGywYgVSVNMXUEzClxEXCwvARkAb2ZuBh 9JzD03x2ljAIjHOvpRPK/+V4ApLBMq1cz8YFbbon0LK8pnqeY0fROMLCMlodEMlufOb6 daXhEyDTbbc44lqj2Z87bP/ZSsGL6LKutKgGzUIqUWxeJU8HLuzhG62b/fQVN5tRT9YP nVQbGSg2bWc6e9TO3L3GmLYfjT1n6SbI/6mWjHOU+ZvyNwXyecmBQTJzdCVt7GFPcGBj 3EdO6fNKCZroKN9q1erd4uBRllE+JBKFBxiHcee7XHSF7/Ok7oQVUQDVRMotfSOLJ1FP M4dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706808; x=1777311608; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=vxBc/M4G+txQiEXs+oWY+3uh4E2qPUY9zSyWwwZhU0Q=; b=lWhB8UYYGcDWuCQPExtyPHpEwmszfhYs6uEOWuFZpEQQybou+LChPc/vEDXjrkWY49 UJ6ATdSegiN6LZ4uDHxIcQfD2TInosHcyqYoCEbh3KHNLOfCUjmbGIEHD2gtIx/3bZHh Z3//ejXv43XFkRwsRLw+PXeLqtVBWIiVcYJx9wJdiv4qwXP7iZO6sXCkJIsR5/PspC6R dmjWN03kYa3oZ+F3uY/fyvUTiq5+tjyVnKcvJwZUZf5ZvwG+HxlkOU9eUVaWymt/pzMe 8JEKWeqLYxu8WpL8yqn3lj7+Fd283rgY8QoZLniigHI8BzaCTP0WF87KfWCKxrEWf+IC zFcQ== X-Forwarded-Encrypted: i=1; AFNElJ+dhk27HQeC3vuTTWABM30285DW4Mem4oCUVAaVJe840X2b9Wyq6eBp0I/x+s3+NnviwUlb2WxxtVyzapM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx8Q+dqX6Jx2sUelQQw+P2uD+23EeNBS+1gMtSZ9uD82ObOsWBL /N9g3VKGsFzh3ngqXBZOlq0yhZq27/uolvGEHK3yCpxMPqL23/02q9gVsN3pt7kOltk= X-Gm-Gg: AeBDieulpkWHzVPF/zz2TGKgtAQfymttjjVmtp+w5CZsK6WGehOdEBLF+PdHM0ourOP Mve7TtUj+ZF3oO9BTRK4GAFOjKnrK5DyzsqhaXyLklDhD+frNodNCCpiIdbbrLPJ1kl0qhvxubG r+Ylzj5IReSvaKlkDLbJAkYFb0XwMi3l32cwe8DLrESDm89XSje6gE3ociWAb/rXSVlcZV157IZ Deo3IbXO0DI3pYPfWD5ln0QDM2t8rbe8sEuW9ej0mgCIXYybvZkWTRoea0NNkFeOYpzddopMSl1 CjKma7OTJne3NGrohq331oMgfE+9wZoTyPWS89h8QT1CAxAzAmZEp8MCWcFYBrenGFDD18AEI4T lXFZPJGFgRuO9jdR4RN6IDrTo8+6Vkd3smwupDuE1fPXveWD8GLj8PE/uuovZck/BQE9lY6NoG0 m9AW2tBoiLYdT0yfdlL0QLyJyNNOSFaG6evX3AHozwCL/rJ5waqrZtPICHjnEpSFzVgCaVVHKps d8/Bw45zfh/hXzPVQ== X-Received: by 2002:a05:600c:154e:b0:488:9ed3:1492 with SMTP id 5b1f17b1804b1-488fb74fc02mr205225595e9.10.1776706807908; Mon, 20 Apr 2026 10:40:07 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:07 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:50 +0000 Subject: [PATCH v3 04/10] firmware: samsung: acpm: Make acpm_ops const and access via pointer Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-4-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=6069; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=TKfgOUvv2UcX7X0tyk1IsalC6JmJHiID4ANvKVR4gGI=; b=yPHNYBxf7QnMWUXaEk9LWCsOzM8jHb2VsWtybvDRQxbO69Xt+rNMUJo0MncsB/iNRhmSVWg67 oAcDAwgi6d0A7mvuDSXLbfmXaFZoou+EEXxq9wDSnbLCykXmuPaYAB6 X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Replace the embedded `struct acpm_ops` inside `struct acpm_handle` with a pointer to a `const struct acpm_ops`. Previously, the operations structure was embedded directly within the handle and populated dynamically at runtime via `acpm_setup_ops()`. This resulted in mutable function pointers and unnecessary per-instance memory overhead. By defining `exynos_acpm_driver_ops` statically as a `const` structure, the function pointers are now safely housed in the read-only `.rodata` section. This improves security by preventing function pointer overwrites, saves memory, and slightly reduces initialization overhead in `acpm_probe()`. Consequently, update all consumer drivers (clk, mfd) to access the operations via the new pointer indirection (`->ops->`). Finally, fix the previously empty kernel-doc description for the ops member to reflect its new pointer nature. Signed-off-by: Tudor Ambarus --- drivers/clk/samsung/clk-acpm.c | 8 ++--- drivers/firmware/samsung/exynos-acpm.c | 36 ++++++++++--------= ---- drivers/mfd/sec-acpm.c | 6 ++-- .../linux/firmware/samsung/exynos-acpm-protocol.h | 4 +-- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c index 93667777094c..953ca8d5720a 100644 --- a/drivers/clk/samsung/clk-acpm.c +++ b/drivers/clk/samsung/clk-acpm.c @@ -68,8 +68,8 @@ static unsigned long acpm_clk_recalc_rate(struct clk_hw *= hw, { struct acpm_clk *clk =3D to_acpm_clk(hw); =20 - return clk->handle->ops.dvfs.get_rate(clk->handle, clk->mbox_chan_id, - clk->id); + return clk->handle->ops->dvfs.get_rate(clk->handle, clk->mbox_chan_id, + clk->id); } =20 static int acpm_clk_determine_rate(struct clk_hw *hw, @@ -89,8 +89,8 @@ static int acpm_clk_set_rate(struct clk_hw *hw, unsigned = long rate, { struct acpm_clk *clk =3D to_acpm_clk(hw); =20 - return clk->handle->ops.dvfs.set_rate(clk->handle, clk->mbox_chan_id, - clk->id, rate); + return clk->handle->ops->dvfs.set_rate(clk->handle, clk->mbox_chan_id, + clk->id, rate); } =20 static const struct clk_ops acpm_clk_ops =3D { diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/sams= ung/exynos-acpm.c index 39d3d2317659..4f2ad84cd783 100644 --- a/drivers/firmware/samsung/exynos-acpm.c +++ b/drivers/firmware/samsung/exynos-acpm.c @@ -610,30 +610,26 @@ static int acpm_channels_init(struct acpm_info *acpm) return 0; } =20 -/** - * acpm_setup_ops() - setup the operations structures. - * @acpm: pointer to the driver data. - */ -static void acpm_setup_ops(struct acpm_info *acpm) -{ - struct acpm_dvfs_ops *dvfs_ops =3D &acpm->handle.ops.dvfs; - struct acpm_pmic_ops *pmic_ops =3D &acpm->handle.ops.pmic; - - dvfs_ops->set_rate =3D acpm_dvfs_set_rate; - dvfs_ops->get_rate =3D acpm_dvfs_get_rate; - - pmic_ops->read_reg =3D acpm_pmic_read_reg; - pmic_ops->bulk_read =3D acpm_pmic_bulk_read; - pmic_ops->write_reg =3D acpm_pmic_write_reg; - pmic_ops->bulk_write =3D acpm_pmic_bulk_write; - pmic_ops->update_reg =3D acpm_pmic_update_reg; -} - static void acpm_clk_pdev_unregister(void *data) { platform_device_unregister(data); } =20 +static const struct acpm_ops exynos_acpm_driver_ops =3D { + .dvfs =3D { + .set_rate =3D acpm_dvfs_set_rate, + .get_rate =3D acpm_dvfs_get_rate, + }, + + .pmic =3D { + .read_reg =3D acpm_pmic_read_reg, + .bulk_read =3D acpm_pmic_bulk_read, + .write_reg =3D acpm_pmic_write_reg, + .bulk_write =3D acpm_pmic_bulk_write, + .update_reg =3D acpm_pmic_update_reg, + }, +}; + static int acpm_probe(struct platform_device *pdev) { const struct acpm_match_data *match_data; @@ -674,7 +670,7 @@ static int acpm_probe(struct platform_device *pdev) if (ret) return ret; =20 - acpm_setup_ops(acpm); + acpm->handle.ops =3D &exynos_acpm_driver_ops; =20 platform_set_drvdata(pdev, acpm); =20 diff --git a/drivers/mfd/sec-acpm.c b/drivers/mfd/sec-acpm.c index 9e15b260b8df..3397d13d3b7f 100644 --- a/drivers/mfd/sec-acpm.c +++ b/drivers/mfd/sec-acpm.c @@ -391,7 +391,7 @@ static int sec_pmic_acpm_bus_write(void *context, const= void *data, { struct sec_pmic_acpm_bus_context *ctx =3D context; struct acpm_handle *acpm =3D ctx->shared->acpm; - const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic; + const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops->pmic; size_t val_count =3D count - BITS_TO_BYTES(ACPM_ADDR_BITS); const u8 *d =3D data; const u8 *vals =3D &d[BITS_TO_BYTES(ACPM_ADDR_BITS)]; @@ -411,7 +411,7 @@ static int sec_pmic_acpm_bus_read(void *context, const = void *reg_buf, size_t reg { struct sec_pmic_acpm_bus_context *ctx =3D context; struct acpm_handle *acpm =3D ctx->shared->acpm; - const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic; + const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops->pmic; const u8 *r =3D reg_buf; u8 reg; =20 @@ -430,7 +430,7 @@ static int sec_pmic_acpm_bus_reg_update_bits(void *cont= ext, unsigned int reg, un { struct sec_pmic_acpm_bus_context *ctx =3D context; struct acpm_handle *acpm =3D ctx->shared->acpm; - const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops.pmic; + const struct acpm_pmic_ops *pmic_ops =3D &acpm->ops->pmic; =20 return pmic_ops->update_reg(acpm, ctx->shared->acpm_chan_id, ctx->type, r= eg & 0xff, ctx->shared->speedy_channel, val, mask); diff --git a/include/linux/firmware/samsung/exynos-acpm-protocol.h b/includ= e/linux/firmware/samsung/exynos-acpm-protocol.h index 62a3eb450067..e13d9ac73ff6 100644 --- a/include/linux/firmware/samsung/exynos-acpm-protocol.h +++ b/include/linux/firmware/samsung/exynos-acpm-protocol.h @@ -41,10 +41,10 @@ struct acpm_ops { =20 /** * struct acpm_handle - Reference to an initialized protocol instance - * @ops: + * @ops: pointer to the constant ACPM protocol operations. */ struct acpm_handle { - struct acpm_ops ops; + const struct acpm_ops *ops; }; =20 struct device; --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 6C16C3A7824 for ; Mon, 20 Apr 2026 17:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706817; cv=none; b=Q9fQWUVhIfzCQW4I3TzVJ7hHyxn9IKINmsxlQocpZgnkMjE6zaJ+FEOBq4Nhq+pyVNobN/DGgBC8AolbWpzlIjfZqksXyc+HbL1DvFC6ziNlvO9bTtyWjsJzANLNk4oDmAJ2DsKqSdK/dXr+lbld/EE6v3fhnTOiyY1+NGt/oUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706817; c=relaxed/simple; bh=XgjX75TxGPBIIGi2Hhu42Ahw08X3bo7nmsKdvF7AL6M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MN2V+Dn3hvTG8nCmJFeNT79vEnmBiPR/J6Guo0Ip4b0lbBkWuz3BNqQihUXsy7J0IG3CSwfGECU8nTbWb8Fcja/olqWMgmmmX2Q8OPsF83xmjv/DW2mqLEgMqNnhgsKzq54v28U+yl8qIjgzB7qtASGhTBMTv0ZVou+ST+I+PD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nNrGQ+2i; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nNrGQ+2i" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-48a3e9862f0so5746585e9.1 for ; Mon, 20 Apr 2026 10:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706809; x=1777311609; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=iXQeutTdiOf3MiN68CFIsH/5AMU+Gi3Xza1Pm9hWMrM=; b=nNrGQ+2iKR2umzvi2FRLaJvrr1arBIBND0+BJbNWMNaCrDyoDIxzkcLJYxJKNhrYyx jfWoeTYM+WmSItsFuA7H035mQwYw0zoYeRzpcuu4+tIp3mH0/Xfr2ZaBnqxwZCP5x1qO QBbDrP0RZf33vNeglajstq0YQHrkndAQAyD5FZjyEKeSCZ+XgBdUd3Q0c7gjNfdMROOa CqFmWZl/DIFOM3oQCVeZhEOO/9ZHNQmIxCrkNCsNO32QouhgMk+v0FXci0QkdbxPjM71 x3IAr6s5V3sCwyX+QPsz57zcfi8SOjAZ7KpkTKYuNbzk1j62bsvnOJ4FMljKxHhPO/8Z LBOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706809; x=1777311609; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iXQeutTdiOf3MiN68CFIsH/5AMU+Gi3Xza1Pm9hWMrM=; b=nTpTgVU2OXxLO+Wxz/G7uy9NrFp6MJFrbWM7yIS2IdKcFgIgj6K39Px+yP7FVsBoow sk9uXxROZlZ7j+405V8zkcJ3+nb8b/afWMpB4lCdT8721UA/qXsYDDvoBQe15MxT17IT iC8GydqhhF6KuazBeF8wElmYlQ3r924xVJDy83Wv6D740PlY+3Cb8bb88aJIyLhzPuXj HEFw6+i0c7jd2lrq3R+5vTEq2bLcjpdGksIY4s1GhIMe3xX015WWHwZ8LfK07kreyuls SAScvbMsqcnKpFY6MgJ/QpigsrlD7FE/ZCXMuv6enpkrWjfy4md80iseevN+z7l/sx3Y A3Sg== X-Forwarded-Encrypted: i=1; AFNElJ8gxJ1XZNgR9w8XceRL+n/hFGV2BE5TZPGfySmzu05toqzbwtDUhQYaxOY79UYMd5ibOUCI0c8CXaWHY28=@vger.kernel.org X-Gm-Message-State: AOJu0YwClNFy2k6xJHlF/qJgFwYJMZLHfnDw6WXEnPtlA+ApePy05u+b 4gXq2Tkctcfhn8syrHpQGW++YCrQsd+17kW+e26c0u2mGN06O/TEtbQj+Lrkaau7tOg= X-Gm-Gg: AeBDievRgtZ3FkHU+FaUGZZyApc5Le1YAYBKhn2TxfRhRBuO9UvbcnqPUXVUr58/FiT 9k2hql4P37/XbmqcxYtkppqCgQ95iNaZ/pCDLPyRi9Pxk/oV07TxJdX57uyx3F9jo2Zd43vXOnQ RQccg74Bh8aHuF2Fuh1d27NbM2cOiNzqpVtdaWqRJnRKxs586qwCOP/nV10R559F53LFncKWxtW 4cJVeG4/vxwSkCULgvQtA/sCFUn4KMX+5kDXtQr62EDsLS+n8FIUm2jru/sAfZEaFcs0TS+CY/v d4bXqcf17UGasvFkCQ0MUinoy08ceDuRlCQ8H7GxZyfcvD9gPitkCpRufyn4lBbwhA0piGlQtZW JDOhAjgv0Y13m8PHE4ykYCC2KyPTg+N1sCik+o0JLNZgyuqX3FB/IYX6u6LPrPn0Ly5t7a6XP6g gdiagG7Q03YLgNZUhZ39PuuHdvcvegmsMZjrtG4eFn7s68vS7MjpLzlbF0lhDZ1b4IcJLB9quw9 ivyNKgQpl83/Mec2OWCivZb20Wa X-Received: by 2002:a05:600c:3150:b0:485:3cef:d6ea with SMTP id 5b1f17b1804b1-488fb8b9deamr170689135e9.13.1776706808472; Mon, 20 Apr 2026 10:40:08 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:08 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:51 +0000 Subject: [PATCH v3 05/10] firmware: samsung: acpm: Add TMU protocol support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-5-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=10630; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=XgjX75TxGPBIIGi2Hhu42Ahw08X3bo7nmsKdvF7AL6M=; b=Swl0FsxHcW7bEIva8PyDAcVFMYGfTkOlsx6yEWdPI2PrBvg0dIfxccivkesvLNQ/Jk5ZN6KxS 48cBUk8LDVGBz5YFlIZbx7DYc5wX5DyCZkHqlPeeaugGlfcdWDXl0+W X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= The Thermal Management Unit (TMU) on the Google GS101 SoC is managed through a hybrid model shared between the kernel and the Alive Clock and Power Manager (ACPM) firmware. Add the protocol helpers required to communicate with the ACPM for thermal operations, including initialization, threshold configuration, temperature reading, and system suspend/resume handshakes. Signed-off-by: Tudor Ambarus Reviewed-by: Krzysztof Kozlowski --- drivers/firmware/samsung/Makefile | 1 + drivers/firmware/samsung/exynos-acpm-tmu.c | 240 +++++++++++++++++= ++++ drivers/firmware/samsung/exynos-acpm-tmu.h | 28 +++ drivers/firmware/samsung/exynos-acpm.c | 12 ++ .../linux/firmware/samsung/exynos-acpm-protocol.h | 18 ++ 5 files changed, 299 insertions(+) diff --git a/drivers/firmware/samsung/Makefile b/drivers/firmware/samsung/M= akefile index 80d4f89b33a9..5a6f72bececf 100644 --- a/drivers/firmware/samsung/Makefile +++ b/drivers/firmware/samsung/Makefile @@ -3,4 +3,5 @@ acpm-protocol-objs :=3D exynos-acpm.o acpm-protocol-objs +=3D exynos-acpm-pmic.o acpm-protocol-objs +=3D exynos-acpm-dvfs.o +acpm-protocol-objs +=3D exynos-acpm-tmu.o obj-$(CONFIG_EXYNOS_ACPM_PROTOCOL) +=3D acpm-protocol.o diff --git a/drivers/firmware/samsung/exynos-acpm-tmu.c b/drivers/firmware/= samsung/exynos-acpm-tmu.c new file mode 100644 index 000000000000..d1ebe2472ed9 --- /dev/null +++ b/drivers/firmware/samsung/exynos-acpm-tmu.c @@ -0,0 +1,240 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2020 Samsung Electronics Co., Ltd. + * Copyright 2020 Google LLC. + * Copyright 2026 Linaro Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "exynos-acpm.h" +#include "exynos-acpm-tmu.h" + +/* IPC Request Types */ +#define ACPM_TMU_INIT 0x01 +#define ACPM_TMU_READ_TEMP 0x02 +#define ACPM_TMU_SUSPEND 0x04 +#define ACPM_TMU_RESUME 0x10 +#define ACPM_TMU_THRESHOLD 0x11 +#define ACPM_TMU_INTEN 0x12 +#define ACPM_TMU_CONTROL 0x13 +#define ACPM_TMU_IRQ_CLEAR 0x14 + +#define ACPM_TMU_TX_DATA_LEN 8 +#define ACPM_TMU_RX_DATA_LEN 7 + +struct acpm_tmu_tx { + u16 ctx; + u16 fw_use; + u8 type; + u8 rsvd0; + u8 tzid; + u8 rsvd1; + u8 data[ACPM_TMU_TX_DATA_LEN]; +} __packed; + +struct acpm_tmu_rx { + u16 ctx; + u16 fw_use; + u8 type; + s8 ret; + u8 tzid; + s8 temp; + u8 rsvd; + u8 data[ACPM_TMU_RX_DATA_LEN]; +} __packed; + +union acpm_tmu_msg { + u32 data[4]; + struct acpm_tmu_tx tx; + struct acpm_tmu_rx rx; +} __packed; + +static int acpm_tmu_to_linux_err(s8 fw_err) +{ + /* + * ACPM_TMU_INIT uses BIT(0) and BIT(1) of msg.rx.ret to flag APM + * capabilities. Treat zero and all positive values as success. + */ + if (fw_err >=3D 0) + return 0; + + if (fw_err =3D=3D -1) + return -EACCES; + + return -EIO; +} + +int acpm_tmu_init(struct acpm_handle *handle, unsigned int acpm_chan_id) +{ + union acpm_tmu_msg msg =3D {0}; + struct acpm_xfer xfer; + int ret; + + msg.tx.type =3D ACPM_TMU_INIT; + acpm_set_xfer(&xfer, msg.data, ARRAY_SIZE(msg.data), acpm_chan_id, + true); + + ret =3D acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return acpm_tmu_to_linux_err(msg.rx.ret); +} + +int acpm_tmu_read_temp(struct acpm_handle *handle, unsigned int acpm_chan_= id, + u8 tz, int *temp) +{ + union acpm_tmu_msg msg =3D {0}; + struct acpm_xfer xfer; + int ret; + + msg.tx.type =3D ACPM_TMU_READ_TEMP; + msg.tx.tzid =3D tz; + + acpm_set_xfer(&xfer, msg.data, ARRAY_SIZE(msg.data), acpm_chan_id, + true); + + ret =3D acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + ret =3D acpm_tmu_to_linux_err(msg.rx.ret); + if (ret) + return ret; + + *temp =3D msg.rx.temp; + + return 0; +} + +int acpm_tmu_set_threshold(struct acpm_handle *handle, + unsigned int acpm_chan_id, u8 tz, + const u8 temperature[8], size_t tlen) +{ + union acpm_tmu_msg msg =3D {0}; + struct acpm_xfer xfer; + int i, ret; + + if (tlen > ACPM_TMU_TX_DATA_LEN) + return -EINVAL; + + msg.tx.type =3D ACPM_TMU_THRESHOLD; + msg.tx.tzid =3D tz; + + for (i =3D 0; i < tlen; i++) + msg.tx.data[i] =3D temperature[i]; + + acpm_set_xfer(&xfer, msg.data, ARRAY_SIZE(msg.data), acpm_chan_id, + true); + + ret =3D acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return acpm_tmu_to_linux_err(msg.rx.ret); +} + +int acpm_tmu_set_interrupt_enable(struct acpm_handle *handle, + unsigned int acpm_chan_id, u8 tz, u8 inten) +{ + union acpm_tmu_msg msg =3D {0}; + struct acpm_xfer xfer; + int ret; + + msg.tx.type =3D ACPM_TMU_INTEN; + msg.tx.tzid =3D tz; + msg.tx.data[0] =3D inten; + + acpm_set_xfer(&xfer, msg.data, ARRAY_SIZE(msg.data), acpm_chan_id, + true); + + ret =3D acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return acpm_tmu_to_linux_err(msg.rx.ret); +} + +int acpm_tmu_tz_control(struct acpm_handle *handle, unsigned int acpm_chan= _id, + u8 tz, bool enable) +{ + union acpm_tmu_msg msg =3D {0}; + struct acpm_xfer xfer; + int ret; + + msg.tx.type =3D ACPM_TMU_CONTROL; + msg.tx.tzid =3D tz; + msg.tx.data[0] =3D enable ? 1 : 0; + + acpm_set_xfer(&xfer, msg.data, ARRAY_SIZE(msg.data), acpm_chan_id, + true); + + ret =3D acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return acpm_tmu_to_linux_err(msg.rx.ret); +} + +int acpm_tmu_clear_tz_irq(struct acpm_handle *handle, unsigned int acpm_ch= an_id, + u8 tz) +{ + union acpm_tmu_msg msg =3D {0}; + struct acpm_xfer xfer; + int ret; + + msg.tx.type =3D ACPM_TMU_IRQ_CLEAR; + msg.tx.tzid =3D tz; + + acpm_set_xfer(&xfer, msg.data, ARRAY_SIZE(msg.data), acpm_chan_id, + true); + + ret =3D acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return acpm_tmu_to_linux_err(msg.rx.ret); +} + +int acpm_tmu_suspend(struct acpm_handle *handle, unsigned int acpm_chan_id) +{ + union acpm_tmu_msg msg =3D {0}; + struct acpm_xfer xfer; + int ret; + + msg.tx.type =3D ACPM_TMU_SUSPEND; + + acpm_set_xfer(&xfer, msg.data, ARRAY_SIZE(msg.data), acpm_chan_id, + true); + + ret =3D acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return acpm_tmu_to_linux_err(msg.rx.ret); +} + +int acpm_tmu_resume(struct acpm_handle *handle, unsigned int acpm_chan_id) +{ + union acpm_tmu_msg msg =3D {0}; + struct acpm_xfer xfer; + int ret; + + msg.tx.type =3D ACPM_TMU_RESUME; + + acpm_set_xfer(&xfer, msg.data, ARRAY_SIZE(msg.data), acpm_chan_id, + true); + + ret =3D acpm_do_xfer(handle, &xfer); + if (ret) + return ret; + + return acpm_tmu_to_linux_err(msg.rx.ret); +} diff --git a/drivers/firmware/samsung/exynos-acpm-tmu.h b/drivers/firmware/= samsung/exynos-acpm-tmu.h new file mode 100644 index 000000000000..8b89f29fda67 --- /dev/null +++ b/drivers/firmware/samsung/exynos-acpm-tmu.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright 2020 Samsung Electronics Co., Ltd. + * Copyright 2020 Google LLC. + * Copyright 2026 Linaro Ltd. + */ +#ifndef __EXYNOS_ACPM_TMU_H__ +#define __EXYNOS_ACPM_TMU_H__ + +#include + +struct acpm_handle; + +int acpm_tmu_init(struct acpm_handle *handle, unsigned int acpm_chan_id); +int acpm_tmu_read_temp(struct acpm_handle *handle, unsigned int acpm_chan_= id, + u8 tz, int *temp); +int acpm_tmu_set_threshold(struct acpm_handle *handle, + unsigned int acpm_chan_id, u8 tz, + const u8 temperature[8], size_t tlen); +int acpm_tmu_set_interrupt_enable(struct acpm_handle *handle, + unsigned int acpm_chan_id, u8 tz, u8 inten); +int acpm_tmu_tz_control(struct acpm_handle *handle, unsigned int acpm_chan= _id, + u8 tz, bool enable); +int acpm_tmu_clear_tz_irq(struct acpm_handle *handle, unsigned int acpm_ch= an_id, + u8 tz); +int acpm_tmu_suspend(struct acpm_handle *handle, unsigned int acpm_chan_id= ); +int acpm_tmu_resume(struct acpm_handle *handle, unsigned int acpm_chan_id); +#endif /* __EXYNOS_ACPM_TMU_H__ */ diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/sams= ung/exynos-acpm.c index 4f2ad84cd783..d4afd6b535e4 100644 --- a/drivers/firmware/samsung/exynos-acpm.c +++ b/drivers/firmware/samsung/exynos-acpm.c @@ -31,6 +31,7 @@ #include "exynos-acpm.h" #include "exynos-acpm-dvfs.h" #include "exynos-acpm-pmic.h" +#include "exynos-acpm-tmu.h" =20 #define ACPM_PROTOCOL_SEQNUM GENMASK(21, 16) =20 @@ -628,6 +629,17 @@ static const struct acpm_ops exynos_acpm_driver_ops = =3D { .bulk_write =3D acpm_pmic_bulk_write, .update_reg =3D acpm_pmic_update_reg, }, + + .tmu =3D { + .init =3D acpm_tmu_init, + .read_temp =3D acpm_tmu_read_temp, + .set_threshold =3D acpm_tmu_set_threshold, + .set_interrupt_enable =3D acpm_tmu_set_interrupt_enable, + .tz_control =3D acpm_tmu_tz_control, + .clear_tz_irq =3D acpm_tmu_clear_tz_irq, + .suspend =3D acpm_tmu_suspend, + .resume =3D acpm_tmu_resume, + }, }; =20 static int acpm_probe(struct platform_device *pdev) diff --git a/include/linux/firmware/samsung/exynos-acpm-protocol.h b/includ= e/linux/firmware/samsung/exynos-acpm-protocol.h index e13d9ac73ff6..8511c3c3983b 100644 --- a/include/linux/firmware/samsung/exynos-acpm-protocol.h +++ b/include/linux/firmware/samsung/exynos-acpm-protocol.h @@ -34,9 +34,27 @@ struct acpm_pmic_ops { u8 type, u8 reg, u8 chan, u8 value, u8 mask); }; =20 +struct acpm_tmu_ops { + int (*init)(struct acpm_handle *handle, unsigned int acpm_chan_id); + int (*read_temp)(struct acpm_handle *handle, unsigned int acpm_chan_id, + u8 tz, int *temp); + int (*set_threshold)(struct acpm_handle *handle, + unsigned int acpm_chan_id, u8 tz, + const u8 temperature[8], size_t tlen); + int (*set_interrupt_enable)(struct acpm_handle *handle, + unsigned int acpm_chan_id, u8 tz, u8 inten); + int (*tz_control)(struct acpm_handle *handle, unsigned int acpm_chan_id, + u8 tz, bool enable); + int (*clear_tz_irq)(struct acpm_handle *handle, + unsigned int acpm_chan_id, u8 tz); + int (*suspend)(struct acpm_handle *handle, unsigned int acpm_chan_id); + int (*resume)(struct acpm_handle *handle, unsigned int acpm_chan_id); +}; + struct acpm_ops { struct acpm_dvfs_ops dvfs; struct acpm_pmic_ops pmic; + struct acpm_tmu_ops tmu; }; =20 /** --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 4956A3A7585 for ; Mon, 20 Apr 2026 17:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706816; cv=none; b=lDfF5V8LTxve9h5FVUizxXAPKHH1hlB1JduH6+cyc3Txpbb1972UeRLJfhPwygVcORMjdWMQgPfzZc4S1OpuFKOW9R2/0XwQuXzS90I68Mwkg/DFa17sGEbuR26S9DUliRvUOHWTd6+2EW3r28Ge98QCFPpZEdMvKECaUJ/KUCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706816; c=relaxed/simple; bh=dBg2F8BGZZ9Mm5Km26Z5eGMyUNSTN1VtnuTwvVrkrps=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lhDgq8FWIDWO/hcPkWsoo6w0RE0FA0O6kzUxDKNgbaSVua6FnUWeBFD2mGkwhhhl5UQD4pX8khUt0ezrroCptWTaYb5qUGcVAa858mFpLreGyP619YUpsfq5PpzR/eb+nge+paQuuBeigwk2Y5mf4QR4IsNdkCiPji9Kkk6oT+w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XoutfUF9; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XoutfUF9" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-48896199cbaso35033925e9.1 for ; Mon, 20 Apr 2026 10:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706809; x=1777311609; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=O67orx5DZUm8BgsTcl5AUXZvqqdjzW17WuxDEAybQAY=; b=XoutfUF9J0q0jx7CLg5db6DEsZ2d/oVy4JiJR4vNcDcq/DW6bCfsGHf6j/8jaB1TZd eBXMWIQ0zNdCdg64Uz3gxpfPfvDGi3mN5ta6U8lvfhJJB+rHcwaHqpZIxEotoMXhGx4y nQTf7XawgQubFT5jcEm0DxA5wCBpQUhujRQCv5X6bMyExDst9+QmHIgB4tq2TEpQEDWg bclh3KHnMEGAU4Lt3xR0rg9Lal+jo8+vJkLu5eBGM1hOPnlQdG99tTqj+WiKkY8aanjU 2tWZDwd6UNHXLgFC+Iz82s4wtbJQTqRBiJ08ypIAzK8HbPvGGk+XG9/sNKrUlJYdS9RA +1bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706809; x=1777311609; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=O67orx5DZUm8BgsTcl5AUXZvqqdjzW17WuxDEAybQAY=; b=kaFzfcZaQp3lnHk+bW+DTx4mrVYk39P364O01Tov+xLPPkMj/MzQMXdd/7oBFKbbI2 p4r1m41bz4wWt9D6NKoqTm1ApmyjYUdR34THtLMqWYpW1tPlleF9yO4Xxi22ISTN6I0n 3X5KaM0phcXdi85zxl35ldgV0FNAJVtZqVQvoajf0aJ6jRdAy0aKN0zPH9812LjLIc1B v3LI4E47GVoNw2g7MqUcZzbihjPaT1LaZCIVudkkHGd9pM2a6J7FmWyg5t1664deELTb +gQCrBm2QGgxZqIEjoltHGlGEZmJDDniEGMBBRzRijtWvXIa65p+v5gIH2o3GQizsL69 TOJQ== X-Forwarded-Encrypted: i=1; AFNElJ857L5+uYeix/RsEyTt3lItt9lJJlrVVa60ck3Fdk6nHgu2zqMW4hyj5pjEq3X2wK8AAywT7o7k+JzmZ3E=@vger.kernel.org X-Gm-Message-State: AOJu0YxNM3SOwAIaa5vJHzU/gQPAr+1vjTimYENFvN0I1Byk064ftEme CZe2SwQWKjYz7d+37QIoe4TbyJzttXhOVcPGN05OjvLgLwl8O+K9rjoNalh2bBy53iQ= X-Gm-Gg: AeBDievvIidswKZDXsFl4ByHA30asE4xAFHFIyU5hLYBumQGrb4jesuMUWWgOxSs4we OGyfx69jMRwWTj63y+kudv+qFM01C4U4WOVWeY5QgDeAXZGEdQI7Q6wQKWTd7qDJvZkilLLGNGu rlKD3MdLsbIhEJ3aT5aMH48siBUItdXf3eVhc8eIfjc3gijCcFHB/gDnz4qII0TVNtmrXATH3ie cE5p6+TQItFlvYwuOzbG8M6Yiekm9N1ZEllkbIYorvm7mY5quXqRXF64MVfDhgubXD2SF4iS+aJ QbeLSuk0q0m+9zZa3Mnwi0YxUntXjlPEIm6vi61F1fPuuWkobXYlQ8A9fqqcWz8/0fVdBy9BQaK DSIIHyilF3IFBrCzSi4BBxrLQh9SsOhDmCcwfkmoQESGbwMKmzTp8ANx758KR+7m86rTegfDjLj oc+LE0A9seIDE4tK1f3kQ/WHDIYwCpAMq1m1YkwwKCPA63HyJVifkrLPilqKowNM7fejPgtgk7F STBFDpE0wKPwvQm6A== X-Received: by 2002:a05:600c:4f92:b0:48a:f18:ece4 with SMTP id 5b1f17b1804b1-48a0f18edf7mr39490595e9.24.1776706809215; Mon, 20 Apr 2026 10:40:09 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:08 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:52 +0000 Subject: [PATCH v3 06/10] firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-6-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=3004; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=dBg2F8BGZZ9Mm5Km26Z5eGMyUNSTN1VtnuTwvVrkrps=; b=UOAj8gd0XgQFhm1iCBDvFWh9DJ+oBh0oq0XfmalIeylHgCDrLUj+FnH+1NXZyoFoKkD5UBjgB DQ3XgDUmwZzDRFlKtsI8+P4vVI/i2hj8MZGg/O8O5oANp006hjIzhqw X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Introduce devm_acpm_get_by_phandle() to standardize how consumer drivers acquire a handle to the ACPM IPC interface. Enforce the use of the "samsung,acpm-ipc" property name across the SoC and simplify the boilerplate code in client drivers. The first consumer of this helper is the Exynos ACPM Thermal Management Unit (TMU) driver. The TMU utilizes a hybrid management approach: direct register access from the Application Processor (AP) is restricted to the interrupt pending (INTPEND) registers for event identification. High-level functional tasks, such as sensor initialization, threshold programming, and temperature reads, are delegated to the ACPM firmware via this IPC interface. Signed-off-by: Tudor Ambarus --- drivers/firmware/samsung/exynos-acpm.c | 23 ++++++++++++++++++= ++++ .../linux/firmware/samsung/exynos-acpm-protocol.h | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/sams= ung/exynos-acpm.c index d4afd6b535e4..15c10fbb2920 100644 --- a/drivers/firmware/samsung/exynos-acpm.c +++ b/drivers/firmware/samsung/exynos-acpm.c @@ -797,6 +797,29 @@ struct acpm_handle *devm_acpm_get_by_node(struct devic= e *dev, } EXPORT_SYMBOL_GPL(devm_acpm_get_by_node); =20 +/** + * devm_acpm_get_by_phandle - Resource managed lookup of the standardized + * "samsung,acpm-ipc" handle. + * @dev: consumer device + * + * Returns a pointer to the acpm_handle on success, or an ERR_PTR on failu= re. + */ +struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev) +{ + struct acpm_handle *handle; + struct device_node *np; + + np =3D of_parse_phandle(dev->of_node, "samsung,acpm-ipc", 0); + if (!np) + return ERR_PTR(-ENODEV); + + handle =3D devm_acpm_get_by_node(dev, np); + of_node_put(np); + + return handle; +} +EXPORT_SYMBOL_GPL(devm_acpm_get_by_phandle); + static const struct acpm_match_data acpm_gs101 =3D { .initdata_base =3D ACPM_GS101_INITDATA_BASE, .acpm_clk_dev_name =3D "gs101-acpm-clk", diff --git a/include/linux/firmware/samsung/exynos-acpm-protocol.h b/includ= e/linux/firmware/samsung/exynos-acpm-protocol.h index 8511c3c3983b..9df4c514ebde 100644 --- a/include/linux/firmware/samsung/exynos-acpm-protocol.h +++ b/include/linux/firmware/samsung/exynos-acpm-protocol.h @@ -70,6 +70,7 @@ struct device; #if IS_ENABLED(CONFIG_EXYNOS_ACPM_PROTOCOL) struct acpm_handle *devm_acpm_get_by_node(struct device *dev, struct device_node *np); +struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev); #else =20 static inline struct acpm_handle *devm_acpm_get_by_node(struct device *dev, @@ -77,6 +78,11 @@ static inline struct acpm_handle *devm_acpm_get_by_node(= struct device *dev, { return NULL; } + +static inline struct acpm_handle *devm_acpm_get_by_phandle(struct device *= dev) +{ + return NULL; +} #endif =20 #endif /* __EXYNOS_ACPM_PROTOCOL_H */ --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.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 3E5603A782B for ; Mon, 20 Apr 2026 17:40:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; cv=none; b=ZQOs6qTpJFcxYo8XdBtWSgaIbWT+4eT8WIxzKaCj//AlvfjOEQ2nYumthts0zvikqDBL3MZE7jT3tpNDDy5fbz2NYn+G0B2SMtSQ8ZmcNiI8L1H7k9FQ6LD+vRw60QIaCqVVqclbCIdG2Q8g6QHD4rF6pqGavl+1TBmzqo9d6yk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; c=relaxed/simple; bh=FWmZ0QyqKWY3bmSKa397E69GArpbrh7kFJR/AkPo1D4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aKHoGOM4gVXdZmvUfdJ/5A3qHzWDbDL0lo2e3d4lQdmI43cVnysbTcn8C0Yh9ufuv8T9OAhvhkUCmEafJo0vWMcY47JYYkjyDYtYLs/HRFqhFZ8OuGAQirXadek6jSCOt61DHxMz1Ezlerva3ddSlzrCRCl3o+Ag4nCWpFXqzJY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Vp2htx10; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Vp2htx10" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-488b0046078so31419055e9.1 for ; Mon, 20 Apr 2026 10:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706810; x=1777311610; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KA0/N7602tgkmSh9aNlmsTpINesUezp+zdJUoHd7Y4w=; b=Vp2htx10d6er3RRNGyd4UMz071cXmRcyvI4s9YDsxbZAgLWucJW2IQAeN2FkSnoPEv R3NMPG6lu7uEpmyzb4N8Wd4fCtas+2mDLnOnQp10eUZVQ1BdmNMcsNnj6lTCSjhWl8Fl yzsj3L69cF9ArUk/lE/W3JJg5Z9khOkcWlLE5a1yVX88n5gzBCoJ3bgrdiv+FFAz3ULr /rBn5yxwb8wKpdGz0Zc0VEL1klQfItMyxi4cP/65YKKGyv/qvqSrXxI7lJbKdrLMOla/ mkjo80GDHNy7Pv3J+5zzrsdp2qu1ZKdpwBE2NcnN4bHZq6XUFC2fZ8/b08VqtwQ28QSe LRqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706810; x=1777311610; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=KA0/N7602tgkmSh9aNlmsTpINesUezp+zdJUoHd7Y4w=; b=FSJxkGqmCkVJ8ypiqvT20se0gPJug9ncH5xzULBNXxk4hAL9raoOZs9vRdzNzWRAeL myWqIvk5G5gzUcpw2RKQSMEDNcb2CrGotU+52N3/bMz5a714WvYogYwFrWEalNggPiRz EoCWIT3gZAJo5PHclaylAnw/X82QL1HL9JOVJQxcq0Ms6mr3ShlYqjc9BmobCdLWB+lR WFAD2zRcVAn6tboccQ+Aya9TNm0QRKnopYNgDAb1ymjqe91IYZgGEKtrCAv1buIJOgaX 8l1bLAWASigM8XdEdHxg54IPVBRM2dTYcHIea4HjvaAfsgGGbVnVFg3tGih6C7qproYe eV/Q== X-Forwarded-Encrypted: i=1; AFNElJ8NWp8dICOHijRIPSu8Z83h1D/ZysyyoE1d5HJyihv3zXV5s8JYA7WUyhNwPlx8RRdDIhDtEWNBO76DSQA=@vger.kernel.org X-Gm-Message-State: AOJu0YwsJEQMjWjdu4rty38ZDN3fML8xc9OOrCHi8RX9FZwS7vLze0Au sPYv2fMTFHw8RHiePQ9S4G7o23Owqbm999vjbxMNqVb6jDxOIQg9T2x706kiZDb1wYY= X-Gm-Gg: AeBDieuqDGRl873BPAq+rvCgqU8PLCqEDk59VSnt8N3KfrhLPFTCbhf6ac/F75SR7jx HvQawdn34NbyMtEqmI8Y0fWi7GIyvY7YKOirS2gSJzH7phemq0aL13BN3AKUVQkg4JmQLo5/Eod 8/qwfcLdBr+NhQyT98q0MM6y3Et50K55dsFZEy9XURpUU8gEgVSvHQkOjDXfewfWrQBDhtbdgQT 9k8pMx72p1TnmM1w006JGAwiPRD7IJp5hkj3ojQ4UGepyMn3/AN2qzYBO8oDiVQhVmGSJ8KR5ql 1b9YUaIXS84nXO/Q1q3286zc+JdLec0iGQbdyO8memqJYTw6uorhUTY7d6saVmp8G40V1yhiWgw 1T749PRtzoeCR/AhYyvYWanvR6XGz+L7MKYJfmk3hsPHcD3wC/6eJ3imnbuCsbd5+xEANaD29/g kUNH/dLmeYTxo8ihVil2Oq1I94ATzJsE4y3fxczsTZRPadM+aMdjau5hJT+fNCcFpDRKarr5rfC QQbFN1HYDMvyLsuKw== X-Received: by 2002:a05:600c:5299:b0:48a:5342:36b5 with SMTP id 5b1f17b1804b1-48a54514646mr14507205e9.21.1776706810146; Mon, 20 Apr 2026 10:40:10 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:09 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:53 +0000 Subject: [PATCH v3 07/10] thermal: samsung: Add Exynos ACPM TMU driver GS101 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-7-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=17487; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=FWmZ0QyqKWY3bmSKa397E69GArpbrh7kFJR/AkPo1D4=; b=mDa1RzOA5fq8vQR30Ko0fVyBRnY2UIu8+BbdyNCTvy1XLVM8P0f1YMUaPL4jzQnWYVpYMeJYw FHjmdkdqQHrBiADo36Jw/SoEUitMWRpd8HtR2LuHnO4sXkDwagdWcRh X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Add driver for the Thermal Management Unit (TMU) managed via the Alive Clock and Power Manager (ACPM), found on Samsung Exynos SoCs such as Google GS101 (and Exynos850, autov920, etc.). The TMU on utilizes a hybrid management model shared between the Application Processor (AP) and the ACPM firmware. The driver maintains direct memory-mapped access to the TMU interrupt pending registers to identify thermal events, while delegating functional tasks - such as sensor initialization, threshold configuration, and temperature acquisition - to the ACPM firmware via the ACPM IPC protocol. Signed-off-by: Tudor Ambarus Acked-by: Krzysztof Kozlowski --- drivers/thermal/samsung/Kconfig | 17 ++ drivers/thermal/samsung/Makefile | 2 + drivers/thermal/samsung/acpm-tmu.c | 539 +++++++++++++++++++++++++++++++++= ++++ 3 files changed, 558 insertions(+) diff --git a/drivers/thermal/samsung/Kconfig b/drivers/thermal/samsung/Kcon= fig index f4eff5a41a84..0d3ffbdc66f0 100644 --- a/drivers/thermal/samsung/Kconfig +++ b/drivers/thermal/samsung/Kconfig @@ -9,3 +9,20 @@ config EXYNOS_THERMAL the TMU, reports temperature and handles cooling action if defined. This driver uses the Exynos core thermal APIs and TMU configuration data from the supported SoCs. + +config EXYNOS_ACPM_THERMAL + tristate "Exynos ACPM thermal management unit driver" + depends on THERMAL_OF + depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL) + help + Support for the Thermal Management Unit (TMU) on Samsung Exynos SoCs + (such as Google GS101 and Exynos850). + + The TMU on these platforms is managed through a hybrid architecture. + This driver handles direct register access for thermal interrupt status + monitoring and communicates with the Alive Clock and Power Manager + (ACPM) firmware via the ACPM IPC protocol for functional sensor control + and configuration. + + Select this if you want to monitor device temperature and enable + thermal mitigation on Samsung Exynos ACPM based devices. diff --git a/drivers/thermal/samsung/Makefile b/drivers/thermal/samsung/Mak= efile index f139407150d2..daed80647c34 100644 --- a/drivers/thermal/samsung/Makefile +++ b/drivers/thermal/samsung/Makefile @@ -4,3 +4,5 @@ # obj-$(CONFIG_EXYNOS_THERMAL) +=3D exynos_thermal.o exynos_thermal-y :=3D exynos_tmu.o +obj-$(CONFIG_EXYNOS_ACPM_THERMAL) +=3D exynos_acpm_thermal.o +exynos_acpm_thermal-y :=3D acpm-tmu.o diff --git a/drivers/thermal/samsung/acpm-tmu.c b/drivers/thermal/samsung/a= cpm-tmu.c new file mode 100644 index 000000000000..942d8caa78f5 --- /dev/null +++ b/drivers/thermal/samsung/acpm-tmu.c @@ -0,0 +1,539 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright 2019 Samsung Electronics Co., Ltd. + * Copyright 2025 Google LLC. + * Copyright 2026 Linaro Ltd. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../thermal_hwmon.h" + +#define EXYNOS_TMU_SENSOR(i) BIT(i) +#define EXYNOS_TMU_SENSORS_MAX_COUNT 16 + +#define GS101_CPUCL2_SENSOR_MASK (EXYNOS_TMU_SENSOR(0) | \ + EXYNOS_TMU_SENSOR(6) | \ + EXYNOS_TMU_SENSOR(7) | \ + EXYNOS_TMU_SENSOR(8) | \ + EXYNOS_TMU_SENSOR(9)) +#define GS101_CPUCL1_SENSOR_MASK (EXYNOS_TMU_SENSOR(4) | \ + EXYNOS_TMU_SENSOR(5)) +#define GS101_CPUCL0_SENSOR_MASK (EXYNOS_TMU_SENSOR(1) | \ + EXYNOS_TMU_SENSOR(2)) + +#define GS101_REG_INTPEND(i) ((i) * 0x50 + 0xf8) + +enum { + P0_INTPEND, + P1_INTPEND, + P2_INTPEND, + P3_INTPEND, + P4_INTPEND, + P5_INTPEND, + P6_INTPEND, + P7_INTPEND, + P8_INTPEND, + P9_INTPEND, + P10_INTPEND, + P11_INTPEND, + P12_INTPEND, + P13_INTPEND, + P14_INTPEND, + P15_INTPEND, + REG_INTPEND_COUNT, +}; + +struct acpm_tmu_sensor_group { + u16 mask; + u8 id; +}; + +struct acpm_tmu_sensor { + const struct acpm_tmu_sensor_group *group; + struct thermal_zone_device *tzd; + struct acpm_tmu_priv *priv; + struct mutex lock; /* protects sensor state */ + bool enabled; +}; + +struct acpm_tmu_priv { + struct regmap_field *regmap_fields[REG_INTPEND_COUNT]; + struct acpm_handle *handle; + struct device *dev; + struct clk *clk; + unsigned int mbox_chan_id; + unsigned int num_sensors; + int irq; + struct acpm_tmu_sensor sensors[] __counted_by(num_sensors); +}; + +struct acpm_tmu_driver_data { + const struct reg_field *reg_fields; + const struct acpm_tmu_sensor_group *sensor_groups; + unsigned int num_sensor_groups; + unsigned int mbox_chan_id; +}; + +#define ACPM_TMU_SENSOR_GROUP(_mask, _id) \ + { \ + .mask =3D _mask, \ + .id =3D _id, \ + } + +static const struct acpm_tmu_sensor_group gs101_sensor_groups[] =3D { + ACPM_TMU_SENSOR_GROUP(GS101_CPUCL2_SENSOR_MASK, 0), + ACPM_TMU_SENSOR_GROUP(GS101_CPUCL1_SENSOR_MASK, 1), + ACPM_TMU_SENSOR_GROUP(GS101_CPUCL0_SENSOR_MASK, 2), +}; + +static const struct reg_field gs101_reg_fields[REG_INTPEND_COUNT] =3D { + [P0_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(0), 0, 31), + [P1_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(1), 0, 31), + [P2_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(2), 0, 31), + [P3_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(3), 0, 31), + [P4_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(4), 0, 31), + [P5_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(5), 0, 31), + [P6_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(6), 0, 31), + [P7_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(7), 0, 31), + [P8_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(8), 0, 31), + [P9_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(9), 0, 31), + [P10_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(10), 0, 31), + [P11_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(11), 0, 31), + [P12_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(12), 0, 31), + [P13_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(13), 0, 31), + [P14_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(14), 0, 31), + [P15_INTPEND] =3D REG_FIELD(GS101_REG_INTPEND(15), 0, 31), +}; + +static const struct regmap_config gs101_regmap_config =3D { + .reg_bits =3D 32, + .reg_stride =3D 4, + .val_bits =3D 32, + .use_relaxed_mmio =3D true, + .max_register =3D GS101_REG_INTPEND(15), +}; + +static const struct acpm_tmu_driver_data acpm_tmu_gs101 =3D { + .reg_fields =3D gs101_reg_fields, + .sensor_groups =3D gs101_sensor_groups, + .num_sensor_groups =3D ARRAY_SIZE(gs101_sensor_groups), + .mbox_chan_id =3D 9, +}; + +static int acpm_tmu_op_tz_control(struct acpm_tmu_sensor *sensor, bool on) +{ + struct acpm_tmu_priv *priv =3D sensor->priv; + struct acpm_handle *handle =3D priv->handle; + const struct acpm_tmu_ops *ops =3D &handle->ops->tmu; + int ret; + + ret =3D ops->tz_control(handle, priv->mbox_chan_id, sensor->group->id, + on); + if (ret) + return ret; + + sensor->enabled =3D on; + + return 0; +} + +static int acpm_tmu_control(struct acpm_tmu_priv *priv, bool on) +{ + struct device *dev =3D priv->dev; + int i, ret; + + ret =3D pm_runtime_resume_and_get(dev); + if (ret < 0) + return ret; + + for (i =3D 0; i < priv->num_sensors; i++) { + struct acpm_tmu_sensor *sensor =3D &priv->sensors[i]; + + /* Skip sensors that weren't found in DT */ + if (!sensor->tzd) + continue; + + scoped_guard(mutex, &sensor->lock) { + ret =3D acpm_tmu_op_tz_control(sensor, on); + } + + if (ret) + goto out; + } + +out: + pm_runtime_put_autosuspend(dev); + return ret; +} + +static int acpm_tmu_get_temp(struct thermal_zone_device *tz, int *temp) +{ + struct acpm_tmu_sensor *sensor =3D thermal_zone_device_priv(tz); + struct acpm_tmu_priv *priv =3D sensor->priv; + struct acpm_handle *handle =3D priv->handle; + const struct acpm_tmu_ops *ops =3D &handle->ops->tmu; + struct device *dev =3D priv->dev; + int acpm_temp, ret; + + if (!sensor->enabled) + return -EAGAIN; + + ret =3D pm_runtime_resume_and_get(dev); + if (ret < 0) + return ret; + + scoped_guard(mutex, &sensor->lock) { + ret =3D ops->read_temp(handle, priv->mbox_chan_id, + sensor->group->id, &acpm_temp); + } + + pm_runtime_put_autosuspend(dev); + + if (ret) + return ret; + + *temp =3D acpm_temp * MILLIDEGREE_PER_DEGREE; + + return 0; +} + +static int acpm_tmu_set_trips(struct thermal_zone_device *tz, int low, int= high) +{ + struct acpm_tmu_sensor *sensor =3D thermal_zone_device_priv(tz); + struct acpm_tmu_priv *priv =3D sensor->priv; + struct acpm_handle *handle =3D priv->handle; + const struct acpm_tmu_ops *ops =3D &handle->ops->tmu; + struct device *dev =3D priv->dev; + unsigned int mbox_chan_id =3D priv->mbox_chan_id; + u8 acpm_sensor_id =3D sensor->group->id; + u8 thresholds[2] =3D {}; + u8 inten =3D 0; + int ret; + + /* If a valid lower bound exists, set the threshold and enable its interr= upt */ + if (low > -INT_MAX) { + thresholds[0] =3D clamp_val(low / MILLIDEGREE_PER_DEGREE, 0, 255); + inten |=3D BIT(0); + } + + /* If a valid upper bound exists, set the threshold and enable its interr= upt */ + if (high < INT_MAX) { + thresholds[1] =3D clamp_val(high / MILLIDEGREE_PER_DEGREE, 0, 255); + inten |=3D BIT(1); + } + + ret =3D pm_runtime_resume_and_get(dev); + if (ret) + return ret; + + scoped_guard(mutex, &sensor->lock) { + bool was_enabled =3D sensor->enabled; + + if (was_enabled) { + ret =3D acpm_tmu_op_tz_control(sensor, false); + if (ret) + goto out; + } + + ret =3D ops->set_threshold(handle, mbox_chan_id, acpm_sensor_id, + thresholds, 2); + if (ret) + goto out; + + ret =3D ops->set_interrupt_enable(handle, mbox_chan_id, + acpm_sensor_id, inten); + if (ret) + goto out; + + /* Restore based on cached state. */ + if (was_enabled) + ret =3D acpm_tmu_op_tz_control(sensor, true); + } + +out: + pm_runtime_put_autosuspend(dev); + return ret; +} + +static const struct thermal_zone_device_ops acpm_tmu_sensor_ops =3D { + .get_temp =3D acpm_tmu_get_temp, + .set_trips =3D acpm_tmu_set_trips, +}; + +static int acpm_tmu_has_pending_irq(struct acpm_tmu_sensor *sensor, + bool *pending_irq) +{ + struct acpm_tmu_priv *priv =3D sensor->priv; + unsigned long mask =3D sensor->group->mask; + int i, ret; + u32 val; + + guard(mutex)(&sensor->lock); + + for_each_set_bit(i, &mask, EXYNOS_TMU_SENSORS_MAX_COUNT) { + ret =3D regmap_field_read(priv->regmap_fields[i], &val); + if (ret) + return ret; + + if (val) { + *pending_irq =3D true; + break; + } + } + + return 0; +} + +static irqreturn_t acpm_tmu_thread_fn(int irq, void *id) +{ + struct acpm_tmu_priv *priv =3D id; + struct acpm_handle *handle =3D priv->handle; + const struct acpm_tmu_ops *ops =3D &handle->ops->tmu; + struct device *dev =3D priv->dev; + int i, ret; + + ret =3D pm_runtime_resume_and_get(dev); + if (ret) { + dev_err(dev, "Failed to resume: %d\n", ret); + return IRQ_NONE; + } + + for (i =3D 0; i < priv->num_sensors; i++) { + struct acpm_tmu_sensor *sensor =3D &priv->sensors[i]; + bool pending_irq =3D false; + + if (!sensor->tzd) + continue; + + ret =3D acpm_tmu_has_pending_irq(sensor, &pending_irq); + if (ret || !pending_irq) + continue; + + thermal_zone_device_update(sensor->tzd, + THERMAL_EVENT_UNSPECIFIED); + + scoped_guard(mutex, &sensor->lock) { + ret =3D ops->clear_tz_irq(handle, priv->mbox_chan_id, + sensor->group->id); + if (ret) + dev_err(priv->dev, "Sensor %d: failed to clear IRQ (%d)\n", + i, ret); + } + } + + pm_runtime_put_autosuspend(dev); + + return IRQ_HANDLED; +} + +static const struct of_device_id acpm_tmu_match[] =3D { + { .compatible =3D "google,gs101-tmu-top" }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, acpm_tmu_match); + +static int acpm_tmu_probe(struct platform_device *pdev) +{ + const struct acpm_tmu_driver_data *data =3D &acpm_tmu_gs101; + struct acpm_handle *acpm_handle; + struct device *dev =3D &pdev->dev; + struct acpm_tmu_priv *priv; + struct regmap *regmap; + void __iomem *base; + int i, ret; + + acpm_handle =3D devm_acpm_get_by_phandle(dev); + if (IS_ERR(acpm_handle)) + return dev_err_probe(dev, PTR_ERR(acpm_handle), + "Failed to get ACPM handle\n"); + + priv =3D devm_kzalloc(dev, + struct_size(priv, sensors, data->num_sensor_groups), + GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->dev =3D dev; + priv->handle =3D acpm_handle; + priv->mbox_chan_id =3D data->mbox_chan_id; + priv->num_sensors =3D data->num_sensor_groups; + + platform_set_drvdata(pdev, priv); + + base =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return dev_err_probe(dev, PTR_ERR(base), "Failed to ioremap resource\n"); + + regmap =3D devm_regmap_init_mmio(dev, base, &gs101_regmap_config); + if (IS_ERR(regmap)) + return dev_err_probe(dev, PTR_ERR(regmap), "Failed to init regmap\n"); + + ret =3D devm_regmap_field_bulk_alloc(dev, regmap, priv->regmap_fields, + data->reg_fields, REG_INTPEND_COUNT); + if (ret) + return dev_err_probe(dev, ret, + "Unable to map syscon registers\n"); + + priv->clk =3D devm_clk_get(dev, NULL); + if (IS_ERR(priv->clk)) + return dev_err_probe(dev, PTR_ERR(priv->clk), + "Failed to get the clock\n"); + + priv->irq =3D platform_get_irq(pdev, 0); + if (priv->irq < 0) + return dev_err_probe(dev, priv->irq, "Failed to get irq\n"); + + ret =3D devm_request_threaded_irq(dev, priv->irq, NULL, + acpm_tmu_thread_fn, IRQF_ONESHOT, + dev_name(dev), priv); + if (ret) + return dev_err_probe(dev, ret, "Failed to request irq\n"); + + pm_runtime_set_autosuspend_delay(dev, 100); + pm_runtime_use_autosuspend(dev); + + ret =3D devm_pm_runtime_enable(dev); + if (ret) + return dev_err_probe(dev, ret, "Failed to enable runtime PM\n"); + + ret =3D pm_runtime_resume_and_get(dev); + if (ret < 0) + return dev_err_probe(dev, ret, "Failed to resume device\n"); + + ret =3D acpm_handle->ops->tmu.init(acpm_handle, priv->mbox_chan_id); + if (ret) { + ret =3D dev_err_probe(dev, ret, "Failed to init TMU\n"); + goto err_pm_put; + } + + for (i =3D 0; i < priv->num_sensors; i++) { + struct acpm_tmu_sensor *sensor =3D &priv->sensors[i]; + + mutex_init(&sensor->lock); + sensor->group =3D &data->sensor_groups[i]; + sensor->priv =3D priv; + + sensor->tzd =3D devm_thermal_of_zone_register(dev, i, sensor, + &acpm_tmu_sensor_ops); + if (IS_ERR(sensor->tzd)) { + ret =3D PTR_ERR(sensor->tzd); + if (ret =3D=3D -ENODEV) { + sensor->tzd =3D NULL; + dev_dbg(dev, "Sensor %d not used in DT, skipping\n", i); + continue; + } + + ret =3D dev_err_probe(dev, ret, "Failed to register sensor %d\n", i); + goto err_pm_put; + } + + ret =3D devm_thermal_add_hwmon_sysfs(dev, sensor->tzd); + if (ret) + dev_warn(dev, "Failed to add hwmon sysfs!\n"); + } + + ret =3D acpm_tmu_control(priv, true); + if (ret) { + ret =3D dev_err_probe(dev, ret, "Failed to enable TMU\n"); + goto err_pm_put; + } + + pm_runtime_put_autosuspend(dev); + + return 0; + +err_pm_put: + pm_runtime_put_sync(dev); + return ret; +} + +static void acpm_tmu_remove(struct platform_device *pdev) +{ + struct acpm_tmu_priv *priv =3D platform_get_drvdata(pdev); + + /* Stop IRQ first to prevent race with thread_fn */ + disable_irq(priv->irq); + + acpm_tmu_control(priv, false); +} + +static int acpm_tmu_suspend(struct device *dev) +{ + struct acpm_tmu_priv *priv =3D dev_get_drvdata(dev); + struct acpm_handle *handle =3D priv->handle; + const struct acpm_tmu_ops *ops =3D &handle->ops->tmu; + int ret; + + ret =3D acpm_tmu_control(priv, false); + if (ret) + return ret; + + /* APB clock not required for this specific msg */ + return ops->suspend(handle, priv->mbox_chan_id); +} + +static int acpm_tmu_resume(struct device *dev) +{ + struct acpm_tmu_priv *priv =3D dev_get_drvdata(dev); + struct acpm_handle *handle =3D priv->handle; + const struct acpm_tmu_ops *ops =3D &handle->ops->tmu; + int ret; + + /* APB clock not required for this specific msg */ + ret =3D ops->resume(handle, priv->mbox_chan_id); + if (ret) + return ret; + + return acpm_tmu_control(priv, true); +} + +static int acpm_tmu_runtime_suspend(struct device *dev) +{ + struct acpm_tmu_priv *priv =3D dev_get_drvdata(dev); + + clk_disable_unprepare(priv->clk); + + return 0; +} + +static int acpm_tmu_runtime_resume(struct device *dev) +{ + struct acpm_tmu_priv *priv =3D dev_get_drvdata(dev); + + return clk_prepare_enable(priv->clk); +} + +static const struct dev_pm_ops acpm_tmu_pm_ops =3D { + SYSTEM_SLEEP_PM_OPS(acpm_tmu_suspend, acpm_tmu_resume) + RUNTIME_PM_OPS(acpm_tmu_runtime_suspend, acpm_tmu_runtime_resume, NULL) +}; + +static struct platform_driver acpm_tmu_driver =3D { + .driver =3D { + .name =3D "gs-tmu", + .pm =3D pm_ptr(&acpm_tmu_pm_ops), + .of_match_table =3D acpm_tmu_match, + }, + .probe =3D acpm_tmu_probe, + .remove =3D acpm_tmu_remove, +}; +module_platform_driver(acpm_tmu_driver); + +MODULE_AUTHOR("Tudor Ambarus "); +MODULE_DESCRIPTION("Samsung Exynos ACPM TMU Driver"); +MODULE_LICENSE("GPL"); --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 C27B03A785C for ; Mon, 20 Apr 2026 17:40:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; cv=none; b=P3o4SUCfr09fDZhsJLIsGOUBDFYjYAqhRRGqjxX1U11v1zkiip5uGU/GcWgZlnW0n4kuKVFZsJtfXd4ms69xgYhRSjftsmnWphpMK3YR3pUqQXzbjy/Nj7AjB44GgC/l5Q2rVshX73NJ4ghTQWHL3Jg4P3g/FzlZ2dGzGoPXcfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; c=relaxed/simple; bh=utGmC6SX1f1tsmdJMtEQdtOxlDLzgsEsYQAYl4X2W/0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C6DitTkxz0RAO54Y/MI4zX7czC3QC2c2cVJEvMeSAnUVEcyJWOUFmJsdrSG5tEZu6yo4uIYUrOrN3x+5MsYUHkDsAsI7INtyl9X6t0WXBWxvQTR/GPCNoC1HoVRCpi7VMu4sjTxJAOjKAF3kNIRiK2BBr51QqbnlRQDc44ktdls= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=sDnjBrPB; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sDnjBrPB" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4891b0786beso12238835e9.1 for ; Mon, 20 Apr 2026 10:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706811; x=1777311611; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=majqoFYlSL/xq0vEC9MR4HUJoBMpHEo2idjyzWrGGo4=; b=sDnjBrPB/7kBQUTlQHDyyMfhRibaGFCdQDG1TqlPH7QPloyKH/5o28pLAncaD5/zOy Vdw3QuwL4ht704Vh8XhjBdEgAoR1B/UopTGLC44rWAUSi8MPLwuxBYNNiI9qMzS8EB5U 1VCNhIyUeJwy8d3wRAXeZmI2tAU9jst1uRDcWtTW5o6d65KaHFMZomtKMXcsPgl+Wn3u FT5EkZNr7J+4H4yT7onza0IUVPFiEDuQaTC9UeANDutohl3Vhj0ksv+N98B36CbrVTOs MhssuUb3gjcb689XNsYf5+8WSt8/6RndynAYKMsHs/e0UXwkzgr4PT8mDwK9QbpvP9Gj zMyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706811; x=1777311611; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=majqoFYlSL/xq0vEC9MR4HUJoBMpHEo2idjyzWrGGo4=; b=kdpOLP6WEDY7Apt2iV7pS0T+223P0fIEOLRF5+VuTmN4dVGpZErDlBlY76j35fnU2Z miuMPzZk86IpHkXhJvV/8cslvRdphl/MFRUDauA8sWBXQarchPQhVsZs+fPr5AvIMysM YZ/iAFVsTR80Cd/BEL4Q9U3aDeL7AIGAzH96/ByR+w8erAbbApgZly/SY9WGoKkUjwWo /R6Bb6fM/xC4W5Ohozf0qu26e3EF+17uVv0XX/T7R40JwsAwihJyYE08bGP0fLzjFbt7 jndj1+TffgsT33XQHO53p7DDUIeF9hbUCHcIUyHz0OJVub2Uhr7celm4pIdmgiXIPCJy +Rxg== X-Forwarded-Encrypted: i=1; AFNElJ9MYrhHzcy6XJ7/Y9+drvmWKWGJph6PNaFQus+753GsebHguQ9AkRE9j7tsD6sVjX0F9mGUPuvHUfGKhu4=@vger.kernel.org X-Gm-Message-State: AOJu0YylZckqtcFxa6i9zE6DrZg7wqKx6cQ0cOu6GOWnMqQbuXdDrRDH 9AtZetDdxPfAd5MVWaZ9Ygf6CW9i/G42jsWf02IfkpeZiodWkfHjmQHd6NRLiik7uvE= X-Gm-Gg: AeBDiesYVmZvPwn4ZNgdivHbO8miVP9L2mZZbHtMLkqVDKh5c60dFmCecglmP6pKOuo S/j24paJ/2QTE5zsBAJKbj83H+Bkmp35d+vE/5bSWLxRznqCGabB6mupuuKd/2HE4oHBRjK5lzy Y/3nDi6Ds/qAJ0XAfW3jy+AVoaVXnWqUguSrZjy1/XnbF60L56r78YqHXXQGcRaXoNsxzFXikwz QID9zFppIudpQLny4vVw6cwN31B/ZEP0vVPKwAMSCgYztutfWCmnBI0TH6tFztbjoJ92lPGt/sC jQlO6tJGW1MSYu23i7Cii2AwlclnI5K3Q7tbgfNHToQRbaZfngW5YQRaXwrvLbO5aXo2FbnYuZq CEKAAH+sPCviB3UUQFPqS3iD4KMo8qlrKTanZqS6WZ54fGgg7ssSyOqIfp4LsrXSCTygFqDCWUx 2N0UGQzEAKSHUEl5EC4cg5BgZAyxaupiE8hbDUoXzyi93uppvpLz1ly68bd3x8+BsuS/4M0IELX JzzQmKv6e/E5xsFWg== X-Received: by 2002:a05:600c:4f13:b0:489:1a65:dd6e with SMTP id 5b1f17b1804b1-4891a65de3emr95027985e9.8.1776706810700; Mon, 20 Apr 2026 10:40:10 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:10 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:54 +0000 Subject: [PATCH v3 08/10] MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-8-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus , Krzysztof Kozlowski X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=992; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=utGmC6SX1f1tsmdJMtEQdtOxlDLzgsEsYQAYl4X2W/0=; b=ksF38PEKxEj8F8BXFtqnkVgT2aWgmm/cCh2qiLZZuahhGr02+y1RNkzFa4rchgDi3llZx0f89 UBd/cw0V2JDB3Hr3mS1DuYCTqeAFm4+ZK/GDr40q1GekCyBRI6bSKdj X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Add a MAINTAINERS entry for the Samsung Exynos ACPM thermal driver. Signed-off-by: Tudor Ambarus Reviewed-by: Krzysztof Kozlowski --- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 76d8291237be..fa67f6f449a7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -23676,6 +23676,14 @@ F: drivers/clk/samsung/clk-acpm.c F: drivers/firmware/samsung/exynos-acpm* F: include/linux/firmware/samsung/exynos-acpm-protocol.h =20 +SAMSUNG EXYNOS ACPM THERMAL DRIVER +M: Tudor Ambarus +L: linux-kernel@vger.kernel.org +L: linux-samsung-soc@vger.kernel.org +S: Supported +F: Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml +F: drivers/thermal/samsung/acpm-tmu.c + SAMSUNG EXYNOS MAILBOX DRIVER M: Tudor Ambarus L: linux-kernel@vger.kernel.org --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 8FFF33A7F66 for ; Mon, 20 Apr 2026 17:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; cv=none; b=HtNvBs6ynac5pKGdzCvFrbpDdmY7tPLTBY7OhOCHaCIcH7qc0HwpJHBD14E47x1T7Ek5ktTy+Gw2DPVYgf1b76QroG3hM8rGmaVfyga+15F8OS++vVW0wW8sErU/Ev2oldD6aqYY744OFd72Fs4bkdlY43aStdrTmO2HviiiwJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; c=relaxed/simple; bh=9sh57TDQqH/7ssKytowavLn5M99k4zWI7dQ0wDDuyzs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ctCkDBBUDF0R1ZaCYLjhqAG6JgQvnhhOL7dkVW/nQO5e5DyelfD0sHNodCT+J8XQ5+pwWcAsjxwFuwxNjkhicz9ywW2sfpBwXLg/kn/yCmo92/c182AysVMzECBxu+Wku2nSZlWZM3QCtsZ+sINugFqqea+IG34Jq4qQkHeshCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=qR/MHyzr; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qR/MHyzr" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-488e1a8ac40so43825145e9.2 for ; Mon, 20 Apr 2026 10:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706812; x=1777311612; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=28TcC2oMsGASecDBxaw71rZOaAWWIWdCO8FEc/B3qrw=; b=qR/MHyzr6V0XelXxMiwaThO6KgTwSMHKWXzvwYD2ccjrxiiyUcbF2NsCxdNGoBLfgR Knk3cDWQgrOhQlcHXiwlsaUg7d4RlL521ESvZ7ys+QberAdiGiVPj5Li49WjauaPGCXu 6NIrQxF0hFdDCPL6T6yeuGlIlIY/igxJPUPMXPALNMZhUCRQYP/hLbyTIG59vK7O03Sk 3k4ZwMty8kuPUGIGhyGLs7w1GAz3jp3r/+EanXdpMqSotcWhF6fK9vNOyTd4tecFiBSS RgIIOlZytHA7Pk0H9w69RWrHRWIE5ACCKZI6pf3V+ys2Sk4dOn2BhLi9iMN7BNlU3IOm z+Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706812; x=1777311612; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=28TcC2oMsGASecDBxaw71rZOaAWWIWdCO8FEc/B3qrw=; b=YiXZn1II6PkGftEyE/FZ32WCxU6elNNXwz+1PvNUQCv9+1bm+wkQ6GxeBxQrieTyeU 5cgwIgKH5MYIbC1Tet+5Asg4w913/SfQIHpHQQ0ke4TzDCNWUjxfPechLTS3vSI72eK9 MDDpkGybeZEpCAb6ai5hj4NgrePrthCpJGjYFodHSjgnusEkJstRl6H2036w1QOFdR+y XpcciUCRO7zrdd/GPp9vMuPdq1S38tA+8GJJK/su8j4kZgj00JMOyA7IwHophbe7zkCa h8VWmd56Lr/pZh89IUG2mALa5/UmuMDQcko2nNcAIBs5ez5YJtguSzvn7921yg5vgc83 qcHg== X-Forwarded-Encrypted: i=1; AFNElJ9Ybuj9aNu0bX/2bj+bqFb7GfCD7Bk5K1Kem3KEJIzUAg4bf3DC7Mzz++XWPU/i6JodlY49DSE/pdp3Da0=@vger.kernel.org X-Gm-Message-State: AOJu0YwZbFUwbA3sq9+3kwA5hk//1CHnzDS7psYWT92u53F6oIby48Bj 8gwmpkckbt48goR22BURGD+ALPE/nTiRvdcK+S0N9mJ6rMGSz8qkulm1l4rTUWPwSoc= X-Gm-Gg: AeBDiesUd+Ir+oWW19AcMphu8OslKhafvHEpJFGGM12l3QfMjYBXFHVahWiJYSEJipv Dld45YMTVHl4TXyV46xoifw/3hq43szFd8BBHR94k+MDo7OBaHScjNlz2VCKkZqOQLtMwul4Imx p6gJOoyCFqpHcZ3r7O5ecNAm+jyXpdfTHyViapcARPbBIAUew4t8th9NN9VayH8fkMrbMs/mPRZ YNSsc7PVA+QlQURdCv2ifSQjFtCgjlJ2rdMrwd0e6LbEi3Muxzrl5q2C0nqlRHxCZ2P4cstIXKE peAFZZtDphaH0jhxDqHJfYQJhTA3LfEHMqvVHu8ngMpdyQycse4mQEzY9rb6UlPjiutIIXej32F 6g5EF8xPyEaG2RwdMGioD0gvjg6b7VianpNC7nESjvGHrnyiX6csk/6QG0sjUru8/OUvdemhcJP kYn+nDS3Jz1RBIGIGqZbnRAOGTRlvUeewh09MECx33RWG4/Fe4MNTbqc8UKKVRZXL1GBVfqY/wu 4DxKFip8Mw2mgnSow== X-Received: by 2002:a05:600c:8901:b0:485:3fa9:358c with SMTP id 5b1f17b1804b1-488fb778117mr153521775e9.17.1776706811718; Mon, 20 Apr 2026 10:40:11 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:10 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:55 +0000 Subject: [PATCH v3 09/10] arm64: dts: exynos: gs101: Add thermal management unit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-9-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=7069; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=9sh57TDQqH/7ssKytowavLn5M99k4zWI7dQ0wDDuyzs=; b=ybbkW7PAs2lzi9awopvn2/X2xHSJ6YJT1i3T0gkdLZZ+pvHOa8zy1doChcGdyRHJtX4WYwGID J5+CdT4WPqnB1flSAgTxcc6QZWjZ15yHZmK4HXe+Vcge6sApgsbgRZS X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Add the Thermal Management Unit (TMU) support for the Google GS101 SoC. Describe the TMU using a consolidated SoC node that includes memory resources for interrupt identification and a phandle to the ACPM IPC interface for functional control. Define thermal zones for the little, mid, and big CPU clusters, including associated trip points and cooling-device maps to enable thermal mitigation. Signed-off-by: Tudor Ambarus --- arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi | 136 +++++++++++++++++++= ++++ arch/arm64/boot/dts/exynos/google/gs101.dtsi | 18 +++ 2 files changed, 154 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi b/arch/arm64/= boot/dts/exynos/google/gs101-tmu.dtsi new file mode 100644 index 000000000000..b27d1a539ec2 --- /dev/null +++ b/arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Google GS101 TMU configurations device tree source + * + * Copyright 2020 Samsung Electronics Co., Ltd. + * Copyright 2020 Google LLC. + * Copyright 2026 Linaro Ltd. + */ + +#include + +/ { + thermal-zones { + cpucl2-thermal { + polling-delay-passive =3D <0>; + polling-delay =3D <0>; + thermal-sensors =3D <&tmu_top 0>; + + trips { + big_switch_on: big-switch-on { + temperature =3D <80000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + big_mitigate: big-mitigate { + temperature =3D <90000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + big_hot: big-hot { + temperature =3D <100000>; + hysteresis =3D <5000>; + type =3D "hot"; + }; + + big_critical: big-critical { + temperature =3D <105000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + + cooling-maps { + map0 { + trip =3D <&big_mitigate>; + cooling-device =3D <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + cpucl1-thermal { + polling-delay-passive =3D <0>; + polling-delay =3D <0>; + thermal-sensors =3D <&tmu_top 1>; + + trips { + mid_switch_on: mid-switch-on { + temperature =3D <80000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + mid_mitigate: mid-mitigate { + temperature =3D <90000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + mid_hot: mid-hot { + temperature =3D <100000>; + hysteresis =3D <5000>; + type =3D "hot"; + }; + + mid_critical: mid-critical { + temperature =3D <105000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + + cooling-maps { + map0 { + trip =3D <&mid_mitigate>; + cooling-device =3D <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + cpucl0-thermal { + polling-delay-passive =3D <0>; + polling-delay =3D <0>; + thermal-sensors =3D <&tmu_top 2>; + + trips { + little_switch_on: little-switch-on { + temperature =3D <80000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + little_mitigate: little-mitigate { + temperature =3D <90000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + little_hot: little-hot { + temperature =3D <100000>; + hysteresis =3D <5000>; + type =3D "hot"; + }; + + little_critical: little-critical { + temperature =3D <105000>; + hysteresis =3D <2000>; + type =3D "critical"; + }; + }; + + cooling-maps { + map0 { + trip =3D <&little_mitigate>; + cooling-device =3D <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot= /dts/exynos/google/gs101.dtsi index d085f9fb0f62..4b8c7edaddb6 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi +++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi @@ -74,6 +74,7 @@ cpu0: cpu@0 { compatible =3D "arm,cortex-a55"; reg =3D <0x0000>; clocks =3D <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL0>; + #cooling-cells =3D <2>; enable-method =3D "psci"; cpu-idle-states =3D <&ananke_cpu_sleep>; capacity-dmips-mhz =3D <250>; @@ -86,6 +87,7 @@ cpu1: cpu@100 { compatible =3D "arm,cortex-a55"; reg =3D <0x0100>; clocks =3D <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL0>; + #cooling-cells =3D <2>; enable-method =3D "psci"; cpu-idle-states =3D <&ananke_cpu_sleep>; capacity-dmips-mhz =3D <250>; @@ -98,6 +100,7 @@ cpu2: cpu@200 { compatible =3D "arm,cortex-a55"; reg =3D <0x0200>; clocks =3D <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL0>; + #cooling-cells =3D <2>; enable-method =3D "psci"; cpu-idle-states =3D <&ananke_cpu_sleep>; capacity-dmips-mhz =3D <250>; @@ -110,6 +113,7 @@ cpu3: cpu@300 { compatible =3D "arm,cortex-a55"; reg =3D <0x0300>; clocks =3D <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL0>; + #cooling-cells =3D <2>; enable-method =3D "psci"; cpu-idle-states =3D <&ananke_cpu_sleep>; capacity-dmips-mhz =3D <250>; @@ -122,6 +126,7 @@ cpu4: cpu@400 { compatible =3D "arm,cortex-a76"; reg =3D <0x0400>; clocks =3D <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL1>; + #cooling-cells =3D <2>; enable-method =3D "psci"; cpu-idle-states =3D <&enyo_cpu_sleep>; capacity-dmips-mhz =3D <620>; @@ -134,6 +139,7 @@ cpu5: cpu@500 { compatible =3D "arm,cortex-a76"; reg =3D <0x0500>; clocks =3D <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL1>; + #cooling-cells =3D <2>; enable-method =3D "psci"; cpu-idle-states =3D <&enyo_cpu_sleep>; capacity-dmips-mhz =3D <620>; @@ -146,6 +152,7 @@ cpu6: cpu@600 { compatible =3D "arm,cortex-x1"; reg =3D <0x0600>; clocks =3D <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL2>; + #cooling-cells =3D <2>; enable-method =3D "psci"; cpu-idle-states =3D <&hera_cpu_sleep>; capacity-dmips-mhz =3D <1024>; @@ -158,6 +165,7 @@ cpu7: cpu@700 { compatible =3D "arm,cortex-x1"; reg =3D <0x0700>; clocks =3D <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL2>; + #cooling-cells =3D <2>; enable-method =3D "psci"; cpu-idle-states =3D <&hera_cpu_sleep>; capacity-dmips-mhz =3D <1024>; @@ -639,6 +647,15 @@ watchdog_cl1: watchdog@10070000 { status =3D "disabled"; }; =20 + tmu_top: thermal-sensor@100a0000 { + compatible =3D "google,gs101-tmu-top"; + reg =3D <0x100a0000 0x800>; + clocks =3D <&cmu_misc CLK_GOUT_MISC_TMU_TOP_PCLK>; + interrupts =3D ; + samsung,acpm-ipc =3D <&acpm_ipc>; + #thermal-sensor-cells =3D <1>; + }; + trng: rng@10141400 { compatible =3D "google,gs101-trng", "samsung,exynos850-trng"; @@ -1861,3 +1878,4 @@ timer { }; =20 #include "gs101-pinctrl.dtsi" +#include "gs101-tmu.dtsi" --=20 2.54.0.rc1.555.g9c883467ad-goog From nobody Tue Jun 16 19:37:18 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 D9BA43A75BC for ; Mon, 20 Apr 2026 17:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; cv=none; b=VI2VXo3yXaAOsVWieVtWTTJMDmFIeT/3RJF6KzKOSpOGcWTzsRU3yEmuyeeemD+6RtNAzUaiNciPkXydAp8bSQdhX70fOopuggyYLF0IYVeWb/QqkG/nUnoiyVgZJmsM10xiwpqbJAcqgQV7kPqguwy4azfeCtAmhzsSyAYtOkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776706819; c=relaxed/simple; bh=b4zN6V69pfC0jSn1B6TPnsLWLax41ajhjGEGhYeLmtA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h3pZXultBPT5s9K5DGNaGKPArEMbGcsU1XENexEkBUBFQzBvdtA+q4ansIbF/S0KrC7q5zrVq7gFTA31l+g5jeHzLsKfFSA/WtUb6aBPrUItBq+7n8w3HgnPkmiAVfPE0oxXuRu9wshPZCLyWvPOWm4Ywm5NEWckgZeFOrxCPxg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=CAupjM4Z; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CAupjM4Z" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-488ff90d6c7so24346535e9.2 for ; Mon, 20 Apr 2026 10:40:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1776706812; x=1777311612; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=/fwlZkaqAkipgy6piybX/zlZcoSztD08jPD+bFmkPvg=; b=CAupjM4Z1Cnnk5+fUwu87eU5F0dqCJ4DBy5J9OWidnQGgRD9cM/KpImYqzvDJVoR0y qK25eH4CxGXCSHFOi7ojOdumtqNojW2f7h3fBBkoDdesm5MiMRaAJaQK3HvFzDd3Mao2 9V4isxGMmC2yBBzQeHsC5YZDls1NzsnuA9MkcJWJB/TM/gTolma2J26Ye5KQvUA5MjHH 7bHzCATBvSXp0Vi1ij6ibGXYd4nmZR241kra+6TBuL4NyDm1Jht0Qh/a03zGYfHK2FpQ E971bDsl75zhjMpNJ6/lYn1iujfcc4LPG+Rd0qzCtk3rTW7c4Ka/3YKGQ63jh8xC33/l rHpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776706812; x=1777311612; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=/fwlZkaqAkipgy6piybX/zlZcoSztD08jPD+bFmkPvg=; b=DtLMFk3Y4U099A+lmHuoKBTLYCKd+Ysflg7IqUoZRp8CuOd+zUWcQBXYgRdwihPwF8 PyjWkwipht0GKeK7UhFQF157rEBuqYCpKDhLGDA8gRF+kz2sQIU21ZRyUr8akNwdW7GO c+SO/l87nZkF0WG+bXmJtuC8TA4AroAhlEFKqu5pdoBEAzvkbq7sXZnLMPp5CwbtfUMY iN2I+y19dCT7rRGibQKy5HvX90in+DuiH2d3r5KMV10sb7N6Bg23z69QjPAgutg1tI/F a+KVY9mVqBgYsNr+eIj49qtakd5XoSaiYXepnuunTzjPrlUYbZh23+LCyVeUVXywps+W hOHQ== X-Forwarded-Encrypted: i=1; AFNElJ8L37eTxlClspiGIscl7lJX5Vkr8PKTgQXT4WH6XijKfYkIlg31P/8jVQLxHwpHamj7c5V1MgPCSD0ttk4=@vger.kernel.org X-Gm-Message-State: AOJu0YwSIvjlyd2jSNllQb/Os46rcX8rOa+bP3uMnQ10DVMt4H1ZMjbV Rymuo2sJowgN2V0G/7EDDujeWQIxgSSW50M+1wOH6pN9sYjiBW0o0W4hxj4u47/7YNU= X-Gm-Gg: AeBDieuT5o8YTIRJYdaubXDMUVuKG5SJXO8QhEPeXYGk+JKz+6/ys1o40D7WyCddz2P a5ZCZ0o5Nmh/LcZI41VAZrgZ0D7i7mAA6XmKHSEiVzpn+rQpH7AQETOYHA9LhLHJGaEfRqsv10S 5Y6ynA7eTI0TJ6gZo5PtTgUOf13XtIYSVxwfYW8jqD+7KYtYOOlqzG1dBur5pN+K69smIHASgob m3saifPSpsDD6tfFiCffNXft4MSGMyuNrrLXozFLyHJVHKenhyEBTT2EohP5jgwNr8YG1eHXav/ ZLDhJsXFvDGAvId8CAS884t4tpkyMvQnNyqDoEXRSbtVcI1GUqWpEaPy84cI9AO995T8r/URAwG X17uv/qovdlnBt2+Ai2RwdmKiIGRo3nx91RzYi2z5EPjzC1WY7r7hn+BN8C2esoxHmrHbKvrc61 Fug/KTOg8jcO9QgbA9rw7J+6QM646YA1KeJJNxM0ra7Z4B6dHVZn2GLuWrarpNpe9pbh+cpwnza UFPPRrc827ffCA/aw== X-Received: by 2002:a05:600c:a108:b0:480:69b6:dfed with SMTP id 5b1f17b1804b1-488fb78ba6fmr175032275e9.24.1776706812164; Mon, 20 Apr 2026 10:40:12 -0700 (PDT) Received: from ta2.c.googlers.com (17.83.155.104.bc.googleusercontent.com. [104.155.83.17]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb72d365sm144280285e9.1.2026.04.20.10.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 10:40:11 -0700 (PDT) From: Tudor Ambarus Date: Mon, 20 Apr 2026 17:39:56 +0000 Subject: [PATCH v3 10/10] arm64: defconfig: enable Exynos ACPM thermal support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260420-acpm-tmu-v3-10-3dc8e93f0b26@linaro.org> References: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> In-Reply-To: <20260420-acpm-tmu-v3-0-3dc8e93f0b26@linaro.org> To: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krzysztof Kozlowski , Alim Akhtar , Bartlomiej Zolnierkiewicz , Kees Cook , "Gustavo A. R. Silva" , Peter Griffin , =?utf-8?q?Andr=C3=A9_Draszik?= , Daniel Lezcano , Sylwester Nawrocki , Chanwoo Choi , Michael Turquette , Stephen Boyd , Lee Jones Cc: willmcvicker@google.com, jyescas@google.com, shin.son@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hardening@vger.kernel.org, linux-clk@vger.kernel.org, Tudor Ambarus X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776706804; l=816; i=tudor.ambarus@linaro.org; s=20241212; h=from:subject:message-id; bh=b4zN6V69pfC0jSn1B6TPnsLWLax41ajhjGEGhYeLmtA=; b=WOxgRvOtzj9KL76srvu0GVEREFLVVJ/F/w3yzCSjd20IjCwgYQ6jiBj/Qn2GHV5jR3DQEJmfQ HziKyX9JAqtC2Ws4BV2sIldy6WYYbWuh1/1Pc0VmL0pBFzg1xMme3pe X-Developer-Key: i=tudor.ambarus@linaro.org; a=ed25519; pk=uQzE0NXo3dIjeowMTOPCpIiPHEz12IA/MbyzrZVh9WI= Enable the Exynos ACPM thermal driver (CONFIG_EXYNOS_ACPM_THERMAL) to allow temperature monitoring and thermal management on Samsung Exynos SoCs that use the Alive Clock and Power Manager (ACPM) protocol. Signed-off-by: Tudor Ambarus --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index d905a0777f93..3fe76a4c2633 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -793,6 +793,7 @@ CONFIG_BCM2711_THERMAL=3Dm CONFIG_BCM2835_THERMAL=3Dm CONFIG_BRCMSTB_THERMAL=3Dm CONFIG_EXYNOS_THERMAL=3Dy +CONFIG_EXYNOS_ACPM_THERMAL=3Dm CONFIG_TEGRA_SOCTHERM=3Dm CONFIG_TEGRA_BPMP_THERMAL=3Dm CONFIG_GENERIC_ADC_THERMAL=3Dm --=20 2.54.0.rc1.555.g9c883467ad-goog