From patchwork Wed Jul 22 21:00:44 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Hantel?= X-Patchwork-Id: 2725 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 8171F1C00D4 for ; Wed, 22 Jul 2026 23:07:10 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-24625-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-24625-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 0A1DC3041A11 for ; Wed, 22 Jul 2026 21:01:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2FB043B3E5; Wed, 22 Jul 2026 21:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fNap4FpH" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.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 5DF2535C183 for ; Wed, 22 Jul 2026 21:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754079; cv=none; b=eBUIYu6qqOmJS31kjysWOEF9KOPp/BPpC3C6feNupZj9zZyPuq0ssGX3jiPhWi6Pw9nxdRNUCbz+M75jEYeb/3rvb+Rxg/R4QNcc/AJNlzjMK8oRlzA4vPQjJ+Pq1oWd81et/JIQ4mSI0RiLpruoBqnO+QLvfWMiaizVhMBKYqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754079; c=relaxed/simple; bh=H7gc8EHhrE54TIGFPE01knw9jDcZnFRii3hzkCBNdj4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=k2B73kyYNxU4RZgcv9LNobDWB+evG9tsj73PIQnKIcfRWMjECpSGA+nRLzW+trA5VS4IIzfi5Xh3oe41qDTmQhWl7sGm1XUTTCJI3fU9P0wQdXsYJrlicVByU8ltB138B7c2X++JQ7iUUuWb6B1feZqf47tW8+j+luktoeXzTvc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fNap4FpH; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-47ddf7b09aaso8568153f8f.3 for ; Wed, 22 Jul 2026 14:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784754076; x=1785358876; darn=lists.linux.dev; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=xSx084TFnzGFnpguxyZxDPEBlEGv6khf3RChBzg4a7A=; b=fNap4FpHKY62j5aywzMipunGz/cU4tVTgbzbIUFM6dq0woK0JZlsLSk+lSNDaKnI0v N4EQ+mEGAE5q24GYrUpyJ//w8XtBZdKvDWyJym4Tor7UTb4bPgJ4XHQiqzlPwtCbnojK VetZ8XxZ9unqT7MxZNjtdA+GN92Zx3WBYWl7yr5yUD9qbowoibR0WmFSXwuRFQ3/oJNP 2ltdCyRGmEblHIJSOROE8GReq6ZjWnBxVYl7RXQ4IKQkdQoQUW/NtbfC04jxNVXusAXl wNx5CgA1pvm8OF1fpdUQFBqOrzcuT4SuMsVo+bXsbVyKe9QRboHGcFaOLnBXnvM2aGBC 62Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784754076; x=1785358876; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=xSx084TFnzGFnpguxyZxDPEBlEGv6khf3RChBzg4a7A=; b=fm4ignkmyePwTYJigp15m8X063Lxov2p3/wxqCdac6el0Ja9R9lzbbBnO+pHy/ZoqY Y95ql5+z6xT63AjR0+DjSKpvxzVKBWabzTL1vuCNDsNN+MV0OiTMETDdB0bHy69uoTUW 7Yr4ToEV9PbVpm38bnJModzKv+UYLmzqsOAzWcKFFVG9pCEp7GzW/RORe8myBB8kCFG8 REhiXGKODBU1vdrjFJ0TJLocnqqb3vyPaP6KJsC//b80hOtDa7vL9zpH/UFmVaFJwcyt jsrDwhmNorJ+EztHCCrCNFsnLEmgIMgP4goIUA2WMWmG5pf+181BfJ4c4EbKVulvp5CF rGRQ== X-Forwarded-Encrypted: i=1; AHgh+RqDqJO9H+SGghjF1+cB2lJxKZAYCtvU47DrJSrmXl39Hd5cl0RcdJLspbDyi8nUZbjUgQHfn397Maghfg==@lists.linux.dev X-Gm-Message-State: AOJu0Yzgk5reFNWdzlnXgFvnIpA36sHuKfSedhgyBwo08+K6LG3vL9xQ FkiEsvomqdBPsGMS+VIvMZuBBN+dR9jonU+WwzyDpos5cGSdriWdO5kZ X-Gm-Gg: AR+sD128c3P/VTgSXNpiO7eepOvgGUZjC0YRP6bS4AkZRGHYWR2x7kn7G2xbhlhOg7C 6kTMJ7txxMv4/6eNBw3Y9RZu+ZDTV7FsSSq3OZ+78xkzCy5c0qEmpXwtoF+N2VU49t5W7mGX6x6 mK+GpfFCO7dgA9FnNzCMenkYwJupkDGWvVbQ1rotCsv3k0D7Fro6CMs0pHL5pnrVKpG3n3s1E2/ XCbXh4RZU8Fge9aAGbcy91X8W8xe4gRoHR/b+XAbYwJ1xmvsmvMPFffwh/C5J2pRU/2tiZvQU1Z eePo2MtEXNzD/ePTwnVRY26Y0m7OdsnaipdxN6uEkCRyb2whzPPnQMqwSHcGp42FtCIoifCxiE1 H6vZq7/5/nrGfm6jVrLCrNjtOI2pKi1mRv+xnzHTqmAsRYFTJKq+gMRcFisPjhtJwkQuLCbjXaa sLlOovnOZRf5/KxEY1o8PAvnOm X-Received: by 2002:a05:6000:4282:b0:462:ce05:c5e4 with SMTP id ffacd0b85a97d-47f8d755525mr573989f8f.37.1784754075574; Wed, 22 Jul 2026 14:01:15 -0700 (PDT) Received: from coolemuke.fritz.box ([2a00:6020:b320:1a00:c256:1463:a40b:d8c6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85c63678sm8610812f8f.29.2026.07.22.14.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 14:01:15 -0700 (PDT) From: " =?utf-8?q?S=C3=B6ren_Hantel?= " X-Google-Original-From: =?utf-8?q?S=C3=B6ren_Hantel?= To: linux-pm@vger.kernel.org Cc: Vasily Khoruzhick , Yangtao Li , "Rafael J . Wysocki" , Daniel Lezcano , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Rossak , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, =?utf-8?q?S=C3=B6ren_Hantel?= , Claude Fable 5 Subject: [PATCH v2 1/3] dt-bindings: thermal: sun8i: Add binding for the A80 THS controller Date: Wed, 22 Jul 2026 23:00:44 +0200 Message-ID: <20260722210046.2932498-2-fugininsane@googlemail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260722210046.2932498-1-fugininsane@googlemail.com> References: <20260722203341.2917852-1-fugininsane@googlemail.com> <20260722210046.2932498-1-fugininsane@googlemail.com> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The Allwinner A80 has a thermal sensor with four channels which shares its MMIO block, bus gate, module clock and reset line with the GPADC. Register-wise it is an early version of the THS found in the A83T and later SoCs, with the THS registers starting at offset 0x40 of the shared block. Add the compatible to the sun8i THS binding. The A80 takes a bus and a module clock plus a reset line, so the existing conditionals already describe it correctly. Co-authored-by: Claude Fable 5 Signed-off-by: Sören Hantel --- .../devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml index 3e61689..718c44d 100644 --- a/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml +++ b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml @@ -18,6 +18,7 @@ properties: - allwinner,sun8i-a83t-ths - allwinner,sun8i-h3-ths - allwinner,sun8i-r40-ths + - allwinner,sun9i-a80-ths - allwinner,sun20i-d1-ths - allwinner,sun50i-a64-ths - allwinner,sun50i-a100-ths From patchwork Wed Jul 22 21:00:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Hantel?= X-Patchwork-Id: 2723 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 3CA721C0BC9 for ; Wed, 22 Jul 2026 23:02:49 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24626-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24626-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 8E90530A0C06 for ; Wed, 22 Jul 2026 21:01:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D0A393CFF66; Wed, 22 Jul 2026 21:01:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ux2XMQEO" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.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 C271D3E558C for ; Wed, 22 Jul 2026 21:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754080; cv=none; b=a2vXA5hJVKvqpgN8yhlBOr8SRk90QH0AhyUB0F8BAlzPODtWn6ESjsrHs57Ljf84KEVWYPWnh8Ip2Ax5nGmMD04KiYOBrSRuioPIMQkJLsQCcM/9KQsxQHzhlp6Q60cU8migKtGos087zbIQFO5vDEFGMXI4Sojf3OwzUWJVUII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754080; c=relaxed/simple; bh=QfEiZ1MBoePzf0Zzf6Vklru7ufE2oWiROW1QfAEBbtg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=i6D1P8R+5Uh75YB+KtV98R1sAk954qkC2JcXR63GVmVCrSPSw04lnGvjfmpw24DeylukF5KY59kObDOSAdKb+3azRTVruvmpHewT910wQY/8gZF8meV8cfoz6CH/Ifgkt5d2lW7HgsuUdEFhWDXO84paef+/zBkUUa5whfeNKT4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ux2XMQEO; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-47f73b1ee02so906504f8f.1 for ; Wed, 22 Jul 2026 14:01:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784754077; x=1785358877; darn=lists.linux.dev; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=B4bcrjfjaOxCTjFJ1nEuge+dwYCIOai8f6MdCth28oQ=; b=Ux2XMQEOFLUM3dl2tPunvh6vJWPVJg+SMZgbZKwbmcLl6qlpUrvxbd5xW0aync8De6 hP5gRbhGGFRKv8dSjiHnlpqhOAFQkIiDHplp21RDiQZkQd/g2oOGrSv0UNuixGcriQY/ WdBStb9yOF9ZJEHkkjNGhEP1z6E/Ogmptj6oA7Kf4TPoVxktWDGeNDcOrWSgyNPNvZ1K MaUzRFI68KrHvquUGprP/zOAPhspz6k4PI/4quAwSIgZVlF1/jMNPg+GPU0ap15hI13l 2KhY7vc/KA/MlRE51iYjylupT625unDWQ7m+YhzFtBpWEMMgi+bk1XIZQnmI2A5ipJJa ccSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784754077; x=1785358877; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=B4bcrjfjaOxCTjFJ1nEuge+dwYCIOai8f6MdCth28oQ=; b=gQkCivfbgzelEZ2JK4+sPuLGu6QNbiDCULWIFXBrpmKVsYi5Z2CLYcIpeG2oGvee6E RpGWCJIkev2AqeP1Q9kU9hxUHGJ6cuC4hWfIZ98OWGNnWKCmQ6TohXxf9qNzz9IZJWef w08TLGcyG26XG/z0OY9bbTETBBvVAKLQMm2nQQbknp27tO0UQPPUYOO+wAbcwhlbaCJ8 cMcT3zUPLD1D4hZR8E3U5zLEvOXlicfsJaqjXmkmri0hjb/i/4EVUdF39/+u3OOoRNML gqV39UtXttT2Ss+EsNJqzvCpb0tbCCRAVAPeSeGrW5tKvQS9KReAIYBvPYUj+YRphgQ1 eN8Q== X-Forwarded-Encrypted: i=1; AHgh+RphY+Z/15rwk/DRQKg1dq6uitDfnrjEvZBjIwycFdankGydnmHObP6LaZR6vdYdc6s7BSidtmPK5HWG2w==@lists.linux.dev X-Gm-Message-State: AOJu0YwzXRdbHZvBW78yR3EHdC6ULZa0VRXShtCHRozYlyyiV+/yxrGQ 4K0ztkzMw9EdxYd5eoZA02yjMAKJexASQrRzGsxZ5o7urzryEA0h7Xn2 X-Gm-Gg: AR+sD13nNLHiYXrWnzkQcL+SPOzhY1RkzIX485OHZ/sM0J8DGDeukJ7xWTPbLcUR+Fq oOvskHpV7rdvY0HEYah6m03KkjdpmVqwjxoq/JhmwhUhjOrwwqId7sDcg4AsKigF//eygtrZ2KN Zq3a9yJXeuWhMuRGoBn05v1iYNyxyZ3hma6Nmzq4PGa+JuAtzyPVu2KUtUrA5pa7eBNUCcUGc+y lAD/ziaS8KD5gB84PbhehUVZO4PgLCf7ehoS8EP8bEk43Yq5+Kk3gcZ+q9m5QQ8ZqoS7ZEsOLZH +PbcDx4b8sDHv0+mUWkMQuJdlXFDNMIxfbgVu0ftXQuPo5ckSIuGcyT/YI8tJjHLSCmw7gkwf7S +Wsg7iYoFEqW4TDEzZBFYYZI0oqwazEZF862kTK4rI6a9ThmcWOSqNVAJt1Nyi9fc57AerV6Ys2 g5jhjCD7WETb1Ibs5Uo57GgGaJ X-Received: by 2002:a05:6000:4903:b0:46f:a0f1:c33f with SMTP id ffacd0b85a97d-47f8d7565a2mr481160f8f.32.1784754076687; Wed, 22 Jul 2026 14:01:16 -0700 (PDT) Received: from coolemuke.fritz.box ([2a00:6020:b320:1a00:c256:1463:a40b:d8c6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85c63678sm8610812f8f.29.2026.07.22.14.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 14:01:16 -0700 (PDT) From: " =?utf-8?q?S=C3=B6ren_Hantel?= " X-Google-Original-From: =?utf-8?q?S=C3=B6ren_Hantel?= To: linux-pm@vger.kernel.org Cc: Vasily Khoruzhick , Yangtao Li , "Rafael J . Wysocki" , Daniel Lezcano , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Rossak , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, =?utf-8?q?S=C3=B6ren_Hantel?= , Claude Fable 5 Subject: [PATCH v2 2/3] thermal/drivers/sun8i: Add support for the A80 THS Date: Wed, 22 Jul 2026 23:00:45 +0200 Message-ID: <20260722210046.2932498-3-fugininsane@googlemail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260722210046.2932498-1-fugininsane@googlemail.com> References: <20260722203341.2917852-1-fugininsane@googlemail.com> <20260722210046.2932498-1-fugininsane@googlemail.com> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-1.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_TWELVE(0.00)[18]; TAGGED_RCPT(0.00)[dt]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo,anthropic.com:email]; TO_DN_SOME(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FORGED_SENDER_MAILLIST(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,kernel.org,sholland.org,vger.kernel.org,lists.infradead.org,lists.linux.dev,googlemail.com,anthropic.com]; FREEMAIL_FROM(0.00)[gmail.com]; PRECEDENCE_BULK(0.00)[]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; TAGGED_FROM(0.00)[bounces-24626-noreply=patchwork.local]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[fugininsane@gmail.com,linux-sunxi@lists.linux.dev]; RCVD_VIA_SMTP_AUTH(0.00)[] X-Rspamd-Queue-Id: 3CA721C0BC9 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= The Allwinner A80 thermal sensor is an early relative of the THS found in the A83T and later SoCs. It shares its register block, bus gate, 4 MHz module clock and reset line with the GPADC; the THS registers live at offset 0x40 of the shared block, with four data registers for the four sensors (0: big cluster, 1: DRAM, 2: GPU, 3: little cluster). Register layout, initialization values and the temperature formula (T = 190 - raw * 1000 / 14543, i.e. offset 190000 / scale 688 in this driver's convention) are taken from the vendor BSP kernel. The init sequence also programs the hardware alarm (~90 degC) and emergency shutdown (~105 degC) thresholds the BSP uses, since their reset defaults are undefined. Unlike on later SoCs the data-ready interrupt fires at the conversion rate (tens of kHz), and the level triggered alarm interrupt would retrigger for as long as an over-temperature condition persists, so both stay disabled and the thermal core polls the sensors; only the emergency shutdown event keeps its interrupt enabled. Since the A80 chip description has no calibrate callback, guard the callback invocation in sun8i_ths_calibrate(); the A80 SID is not yet supported by the sunxi nvmem driver anyway, so calibration data is currently unavailable and the driver falls back to the defaults, which yield plausible results (idle temperatures around 40 degC, full-load peaks in the mid 50s on a Cubieboard4). Tested on a Cubietech Cubieboard4: all four zones report load-reactive temperatures via polling. Co-authored-by: Claude Fable 5 Signed-off-by: Sören Hantel --- drivers/thermal/sun8i_thermal.c | 98 ++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c index 2267479..c906dea 100644 --- a/drivers/thermal/sun8i_thermal.c +++ b/drivers/thermal/sun8i_thermal.c @@ -65,8 +65,27 @@ struct tsensor { int id; }; +/* + * The A80 thermal sensor shares its register block with the GPADC. + * The THS registers start at offset 0x40 within that block. + */ +#define SUN9I_THS_CTRL 0x40 +#define SUN9I_THS_IC 0x44 +#define SUN9I_THS_IS 0x48 +#define SUN9I_THS_ALARM_TH(x) (0x50 + (x) * 0x4) +#define SUN9I_THS_SHUT_TH(x) (0x60 + (x) * 0x4) +#define SUN9I_THS_MFC 0x70 +#define SUN9I_THS_TEMP_DATA 0x80 +#define SUN9I_THS_CTRL_ACQ(x) ((x) << 16) +#define SUN9I_THS_CTRL_SENSOR_EN GENMASK(3, 0) +#define SUN9I_THS_ALARM_IRQ_EN GENMASK(3, 0) +#define SUN9I_THS_SHUT_IRQ_EN GENMASK(7, 4) +#define SUN9I_THS_ALARM_IRQ_STS(x) BIT(x) +#define SUN9I_THS_SHUT_IRQ_STS(x) BIT(4 + (x)) + struct ths_thermal_chip { bool has_mod_clk; + unsigned long mod_clk_rate; bool has_bus_clk_reset; bool needs_sram; int sensor_num; @@ -307,6 +326,9 @@ static int sun8i_ths_calibrate(struct ths_device *tmdev) size_t callen; int ret = 0; + if (!tmdev->chip->calibrate) + return 0; + calcell = nvmem_cell_get(dev, "calibration"); if (IS_ERR(calcell)) { if (PTR_ERR(calcell) == -EPROBE_DEFER) @@ -413,7 +435,8 @@ static int sun8i_ths_resource_init(struct ths_device *tmdev) return PTR_ERR(tmdev->mod_clk); } - ret = clk_set_rate(tmdev->mod_clk, 24000000); + ret = clk_set_rate(tmdev->mod_clk, tmdev->chip->mod_clk_rate ?: + 24000000); if (ret) return ret; @@ -596,6 +619,78 @@ static int sun8i_ths_probe(struct platform_device *pdev) return 0; } +static int sun9i_a80_thermal_init(struct ths_device *tmdev) +{ + int i; + + /* clear any pending interrupt status */ + regmap_write(tmdev->regmap, SUN9I_THS_IS, 0xfff); + /* set up the median filter, average over 8 samples */ + regmap_write(tmdev->regmap, SUN9I_THS_MFC, 0x5); + + /* + * Program the protection thresholds with the values the vendor + * BSP uses (thresholds are in raw sensor units, which decrease + * with rising temperature): an alarm interrupt at ~90 degC and + * an emergency hardware shutdown at ~105 degC. + */ + for (i = 0; i < tmdev->chip->sensor_num; i++) { + regmap_write(tmdev->regmap, SUN9I_THS_ALARM_TH(i), + (1454 << 16) | 0xfff); + regmap_write(tmdev->regmap, SUN9I_THS_SHUT_TH(i), + (1231 << 16) | 0xfff); + } + + /* + * Unlike on later SoCs, the data-ready interrupt fires at the + * conversion rate (tens of kHz), and the level triggered alarm + * interrupt would retrigger for as long as the over-temperature + * condition persists. Leave both disabled and let the thermal + * core poll the data registers; only the emergency shutdown + * interrupt stays enabled, as by the time it fires the hardware + * is powering off anyway. + */ + regmap_write(tmdev->regmap, SUN9I_THS_IC, SUN9I_THS_SHUT_IRQ_EN); + /* acquire time 0x2f, enable all four sensors */ + regmap_write(tmdev->regmap, SUN9I_THS_CTRL, + SUN9I_THS_CTRL_ACQ(0x2f) | SUN9I_THS_CTRL_SENSOR_EN); + + return 0; +} + +static unsigned long sun9i_a80_irq_ack(struct ths_device *tmdev) +{ + unsigned long irq_bitmap = 0; + int i, state; + + regmap_read(tmdev->regmap, SUN9I_THS_IS, &state); + + for (i = 0; i < MAX_SENSOR_NUM; i++) { + if (state & (SUN9I_THS_ALARM_IRQ_STS(i) | + SUN9I_THS_SHUT_IRQ_STS(i))) { + regmap_write(tmdev->regmap, SUN9I_THS_IS, + state & (SUN9I_THS_ALARM_IRQ_STS(i) | + SUN9I_THS_SHUT_IRQ_STS(i))); + set_bit(i, &irq_bitmap); + } + } + + return irq_bitmap; +} + +static const struct ths_thermal_chip sun9i_a80_ths = { + .sensor_num = 4, + .has_mod_clk = true, + .mod_clk_rate = 4000000, + .has_bus_clk_reset = true, + .scale = 688, + .offset = 190000, + .temp_data_base = SUN9I_THS_TEMP_DATA, + .init = sun9i_a80_thermal_init, + .irq_ack = sun9i_a80_irq_ack, + .calc_temp = sun8i_ths_calc_temp, +}; + static const struct ths_thermal_chip sun8i_a83t_ths = { .sensor_num = 3, .scale = 705, @@ -711,6 +806,7 @@ static const struct ths_thermal_chip sun50i_h616_ths = { static const struct of_device_id of_ths_match[] = { { .compatible = "allwinner,sun8i-a83t-ths", .data = &sun8i_a83t_ths }, + { .compatible = "allwinner,sun9i-a80-ths", .data = &sun9i_a80_ths }, { .compatible = "allwinner,sun8i-h3-ths", .data = &sun8i_h3_ths }, { .compatible = "allwinner,sun8i-r40-ths", .data = &sun8i_r40_ths }, { .compatible = "allwinner,sun50i-a64-ths", .data = &sun50i_a64_ths }, From patchwork Wed Jul 22 21:00:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?S=C3=B6ren_Hantel?= X-Patchwork-Id: 2724 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 692C81C0BC9 for ; Wed, 22 Jul 2026 23:03:11 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24627-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24627-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 760AD30DCE56 for ; Wed, 22 Jul 2026 21:01:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F11ED43CE72; Wed, 22 Jul 2026 21:01:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GWh+5U4w" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.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 AFAE03859F9 for ; Wed, 22 Jul 2026 21:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754081; cv=none; b=kMCFJveZ0QeGfZfeWAxuSqNHb0LMu3sMavgH5tuVlNs62AMbmFe9BB8mQClJoG6Af3xnGu7UxL5ZmQJMAYi8x8VGUSsXQAMUCcNiJShGbQV/sbauadMlVkAMJifXSuOe0drN5+5pecyUHtVxJ6WJdBzARNQBnVBEwwUbr33sKI8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784754081; c=relaxed/simple; bh=6esLaWMxVzWgBgD3LBUpQLC+g+cCbkEItwcvYGe7Tc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C2ExdW9j5XX9uBMtV+MM3BkyE75Ugu7VK7GqxUN0tyTdFxOcgtD8V/pfE91fmQwAcwWRP2IwRXeHzo4/zo2sPisNqzZrQAgB48Q67uf8hecjCLPBDOV/OW4wSTX0++HVhRqq0cMqoTNEWCFlIXFk5Cju8ouQ6UjxbFw7B4iZzK8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GWh+5U4w; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-475417f010dso7484790f8f.2 for ; Wed, 22 Jul 2026 14:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784754078; x=1785358878; darn=lists.linux.dev; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=WOd+XZss+YRv1olA4v5j/GA2GS28MPr0U93YAb8IAO0=; b=GWh+5U4wKMRZtH3cYlJevOJgrTH2f92O9VcpCa5tgeiqvJQT2I9vUVOc5cbuJADL3K zWv2Ckzs5WsgukMbP/vTZX0dxAGcWoLNlI6BAYHyuqsGZRN96Wi8K2E6mwaf/4+Y901Q XiMqCRYVyPgiclccrX0VUxNwQvB9O99Rs2p3KW9vKLGjGGJI1CB2/pYQg6aIossHPp+/ xJCD7wl3nPBCuikmt1mbbW61LkBbrx1A8WSRqzKefqb/H/Z9UFrISDA0zlfurzoW6A17 pcs0aHfWO/Zg0IUOeez8Z86tDkWIpwY3BU6RFIBBlCPFehWQq0EDRlxEKjxGHMnik/sS EoNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784754078; x=1785358878; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=WOd+XZss+YRv1olA4v5j/GA2GS28MPr0U93YAb8IAO0=; b=AuBFFF46/m+XJ2uhzwQoYSvfq9brCLZYNXAmJlN4OKOWUpgTWIrUtV0cVgrrLSdRxQ Yub/cm19+iZzv0V1O+s31KQkgL0ECjko+3r97Y38LtVZX4ajftJCDktXaWASFfogus12 w6uwSwTn03+qdrA3TFmh72bRT2nltzEJUxR39G4LmisOsm99LJ6kcXMHMxG4k3pN+cao vbGe2KXe9SeWRGFEPpUmsdyTBH3FxKTlrJVNdFErRR5QyehYdBCOalAwxWKaZTcHWCsY 7ttQ9/Aa/LLkJhkLvrJLnXesE2Tey+gLuiuirDaS8oLEoRNdmdxBg5qwvOE7EI6pYBZv nzng== X-Forwarded-Encrypted: i=1; AHgh+RqGfSisWCbyY5jNgwMBp2jSx9mIg3A3zUL51JN2u7lxbfF1sBcI5dt1stbR2Pfaf99Cyd91adfaR9EJNw==@lists.linux.dev X-Gm-Message-State: AOJu0YxI/KlSbj0TOnEQNEqhxHMYpS0PZ1nai2QTnitkIdAukiGedKwg SkLiou9X84JtkUXkQ8mj5GkS0rft8lGSO7lily11Y7TIzRHJvRTdkr0d X-Gm-Gg: AR+sD11nNdEEWwA3vc2JlFOe6IyoE1CRuLcNfuJoHorZjMNKJOWlRUsJr52cVpbXxOa cVM6ZHlIBMLq3nAYwnOk4kLXB0vITrVRKXRglFUeX1N8/3BRNAoe+G6JmgdhOmLOAS7Q6Kmiyhf mkAWHHN6aXedTqQWATzJW8hHD8uLeVu6m9f3truzHtGVM4KcA/Ax+wxvaAJU7phf+IcWIYnjKvx iba+L3IL5xKaTQG9fknX3PwwGG9JESqIQOdGnSn4H7oU49tWL3f1QtNaXGaPnURLF8y0ShSxPkY RwQmuNJRKC8ln4vY0vNW7507rQyjuARt4yQYMISNFcH3Q+nlbtt0O1+C13smhO8qcIlkrsu1IN0 pTaP0Vd/bfbIyts9nfsgrHxW/AZoPSTqugkLwwLmLxXWdC6Lc9svIR1rPT3eDeyCfAspk2kEv0x wLUKJCvq5qnhgJByn8JmyS6xMQ X-Received: by 2002:a05:6000:2387:b0:47f:6fbd:89eb with SMTP id ffacd0b85a97d-47f8dc936b1mr487157f8f.57.1784754077794; Wed, 22 Jul 2026 14:01:17 -0700 (PDT) Received: from coolemuke.fritz.box ([2a00:6020:b320:1a00:c256:1463:a40b:d8c6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f85c63678sm8610812f8f.29.2026.07.22.14.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 14:01:17 -0700 (PDT) From: " =?utf-8?q?S=C3=B6ren_Hantel?= " X-Google-Original-From: =?utf-8?q?S=C3=B6ren_Hantel?= To: linux-pm@vger.kernel.org Cc: Vasily Khoruzhick , Yangtao Li , "Rafael J . Wysocki" , Daniel Lezcano , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Rossak , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Claude Fable 5 , =?utf-8?q?S=C3=B6ren_Hantel?= Subject: [PATCH v2 3/3] ARM: dts: sun9i-a80: Add thermal sensor and thermal zones Date: Wed, 22 Jul 2026 23:00:46 +0200 Message-ID: <20260722210046.2932498-4-fugininsane@googlemail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260722210046.2932498-1-fugininsane@googlemail.com> References: <20260722203341.2917852-1-fugininsane@googlemail.com> <20260722210046.2932498-1-fugininsane@googlemail.com> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Philipp Rossak Now that the A80 thermal sensor is supported, add its device node and the thermal zones to the device tree. The clocks and the resets are shared between the GPADC and the THS sensor. Sensor 0 is located beside the big CPU cluster, sensor 1 beside the DRAM controller, sensor 2 beside the GPU and sensor 3 beside the little CPU cluster. Signed-off-by: Philipp Rossak [soeren: rebased from the 2018 series, fixed the interrupt number (SPI 115 as in the vendor BSP; verified on hardware - SPI 31 stays silent), added critical trip points matching the driver's emergency shutdown threshold] Co-authored-by: Claude Fable 5 Signed-off-by: Sören Hantel --- arch/arm/boot/dts/allwinner/sun9i-a80.dtsi | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/arch/arm/boot/dts/allwinner/sun9i-a80.dtsi b/arch/arm/boot/dts/allwinner/sun9i-a80.dtsi index a1ae092..8e7f8cd 100644 --- a/arch/arm/boot/dts/allwinner/sun9i-a80.dtsi +++ b/arch/arm/boot/dts/allwinner/sun9i-a80.dtsi @@ -941,6 +941,16 @@ #reset-cells = <1>; }; + ths: thermal-sensor@6004c00 { + compatible = "allwinner,sun9i-a80-ths"; + reg = <0x06004c00 0x100>; + interrupts = ; + clocks = <&ccu CLK_BUS_GPADC>, <&ccu CLK_GPADC>; + clock-names = "bus", "mod"; + resets = <&ccu RST_BUS_GPADC>; + #thermal-sensor-cells = <1>; + }; + timer@6000c00 { compatible = "allwinner,sun4i-a10-timer"; reg = <0x06000c00 0xa0>; @@ -1250,4 +1260,62 @@ #size-cells = <0>; }; }; + + thermal-zones { + cpu0_thermal: cpu0-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&ths 0>; + + trips { + cpu0_crit: cpu0-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + dram_thermal: dram-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&ths 1>; + + trips { + dram_crit: dram-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + gpu_thermal: gpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&ths 2>; + + trips { + gpu_crit: gpu-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu2_thermal: cpu2-thermal { + polling-delay-passive = <1000>; + polling-delay = <5000>; + thermal-sensors = <&ths 3>; + + trips { + cpu2_crit: cpu2-crit { + temperature = <100000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; };