From patchwork Mon Aug 21 14:03:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Botka X-Patchwork-Id: 13359475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 326F5EE4996 for ; Mon, 21 Aug 2023 14:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+Wy9cxbPpjfQjZAGnrgiO/OW+q+xo32rRBh7JoFzpNY=; b=WiKODkGqUKIGvh DgHbpZZU+vZk+20y76GZ2IfEdeEth93yEQYePH8AN6IcBVmkVznU95UQYz1pZXKmlzQhfclXzRTdZ Q2mJa2cAKkZ1Dy+olPV7enXV8wtqcGRXK9JiX9TfKF7awch2ZzaUoHUqth6QoJAA18XToTdcSF2uB tkB6heRk2C6FkwBiMLOMUGILBet6Wh0TFfKLXniS8qMRnlsRNXC/1Ymd0O1KlB3Wg07F+xYnzY0vW IQWy92dcsXyyicgFv+vMf8J1cAgAmWgbZ1OXL6lOc1pCtYgvZs2F1YhlLNsx7zYUVoGpQof3H4dw6 ny0EtnyWYZsIN3h5stFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qY5Vz-00E8ff-0Q; Mon, 21 Aug 2023 14:04:19 +0000 Received: from relay06.th.seeweb.it ([5.144.164.167]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qY5Vh-00E8YE-35 for linux-arm-kernel@lists.infradead.org; Mon, 21 Aug 2023 14:04:05 +0000 Received: from [192.168.2.137] (bband-dyn221.178-41-211.t-com.sk [178.41.211.221]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id E86A63F30B; Mon, 21 Aug 2023 16:03:48 +0200 (CEST) From: Martin Botka Subject: [PATCH v2 0/3] Add support for H616 Thermal system Date: Mon, 21 Aug 2023 16:03:45 +0200 Message-Id: <20230821-ths-h616-v2-0-cda60d556798@somainline.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAMFu42QC/0XMQQrCMBCF4auUWTuSRNOkrryHdJG2YzOgSUlKU UrvbiyIy//x+FbIlJgyXKoVEi2cOYYS6lBB710YCXkoDUqok7BS4+wz+lrWaEynhk7XWp0bKPc p0Z1fO3VrS3vOc0zvXV7kd/0h9o8sEgUKkiS07ZreuGuOT8fhwYGOMY3Qbtv2AUEeW2WlAAAA To: Vasily Khoruzhick , Yangtao Li , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Andre Przywara , Alan Ma , Luke Harrison , Marijn Suijten , AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Martin Botka , Krzysztof Kozlowski X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1692626628; l=1641; i=martin.botka@somainline.org; s=20230811; h=from:subject:message-id; bh=DJBh216VE8/GQJzrTvmlTLXla05Im/ECScvbd00nu20=; b=VRrVoI/qxDMBF10i+PzdqsGwvgJofvviGYIuaLgVX8dIN7c5iUIsRfC596/y9nIZD9cZVWlOF T2SjoM7M/DVBaxv4LM+Rg03wL2oOM79ptTMDxUfrx4TVwwtuZ9tXO5w X-Developer-Key: i=martin.botka@somainline.org; a=ed25519; pk=aTCd3jmwU8GrJidWg3DSKLpdVMcpFzXzCSLXLR6NtWU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230821_070402_154342_271DB70E X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello, This patch series adds support to thermal system found in H616 SoC. There are 4 thermal sensors in this SoC. One for GPU, CPU, DRAM and VE. Trips while unused for now until cpufreq is implemented (WIP) are required by dt-bindings and thus included here. Cheers, Martin --------------- Hello, Im very much not sure if the trips should be included or not. Since they are not optional part I decided to add them but please let me know. Cheers, Martin Signed-off-by: Martin Botka --- Changes in v2: - Fix typos - Remove h616 calc and init functions - Use TEMP_CALIB_MASK insteaf of 0xffff - Adjust calibration function to new offset and scale - Add proper comment to bindings patch - Split delta calculations to 2 lines - Add parentheses around caldata[2|3] >> 12 - Negate bindings if for clocks - Link to v1: https://lore.kernel.org/r/20230818-ths-h616-v1-0-0e1e058b9c7a@somainline.org --- Martin Botka (3): dt-bindings: thermal: sun8i: Add binding for H616 THS controller thermal: sun8i: Add support for H616 THS controller arm64: dts: allwinner: h616: Add thermal sensor and thermal zones .../bindings/thermal/allwinner,sun8i-a83t-ths.yaml | 18 ++--- arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi | 87 ++++++++++++++++++++++ drivers/thermal/sun8i_thermal.c | 74 ++++++++++++++++++ 3 files changed, 169 insertions(+), 10 deletions(-) --- base-commit: df6283416a280d17609f5e55388601458241348c change-id: 20230815-ths-h616-77b2db565249 Best regards,