From patchwork Sat Jun 10 20:35:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 13275072 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 A1790C7EE43 for ; Sat, 10 Jun 2023 20:36:23 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tcc8WMR5jNzib75AwQOX7GSYKUlYLhgZKRJ0zy4dH1A=; b=PALB9EneuC1IaN pw595WMyEbMtIXVQSsixoejSFa7A6mFBKM1bOQ/vfne6rYWQ7Btyx7AXndp3p9AwFtulEEClCP1i4 0tdNzJX/3gd/4zgo+pwGCV5cjTO4O3qLJSYZ3BtEGEU293FRZczmsdbiDL9pyt91GXC897LQ8eLBC HSeePw0JE3wevCNndaJRyo2qXMjeuFaltpJ1ydazY6u+DV1iwRzA3blKVvbzzpXBWYzwyRvD1OZ8A NizbFEGzkG5VitIKFgxQgh/G88MHmH/l6bO/ukZp/8HQon9uSM1d8rCrknqltT6VNDNiN6vH73p9X DMbodc5fmTMTQeaTpVNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q85Jr-00H0pk-29; Sat, 10 Jun 2023 20:36:19 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q85Jo-00H0oJ-2x; Sat, 10 Jun 2023 20:36:18 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f6e1394060so21216115e9.3; Sat, 10 Jun 2023 13:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686429375; x=1689021375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vsgeyxXBjiNCCbFnpasARFFtGQuGGzV0SKK6yZWlTDw=; b=oUeElQHhNEZYn7UmTCYVdAIuxvdnK05pup+LGf26JjI6Jtiz54aN912t5s9bF4NOfq BHjhJ3iZIVcn5/NxcOH0qvw6+6nLxkEm3dZ1xkxTlvq/C2Us/uPLKAb8FdeQq9ee/rjK yhkh8aL4lbbNruqdQpM4nooNdEBcx05Ndk3kUQ9vKn+/jjFeBaOuyaABt8OlOEm3zyaq gIOkK6ekJgZIw6qbuNDrvFD0153UCmIpIcz3GW9dJIVSUPiODl+d0ZeFZPIZz3jVEfFC BDisGdMneISNyl0Vi0cXnGB9JExaK0L3EzNF6A7S5dAS33f+dRTMd7rVzGZUK7wZzHLf IJSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686429375; x=1689021375; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vsgeyxXBjiNCCbFnpasARFFtGQuGGzV0SKK6yZWlTDw=; b=cWNvAvVpLXIVO5GjVhkchLIJL8lcrVqhY5yduNSzyDGsw+pp9klinAoPBOxsG3yMyU u9PUOyM7D4D/6jRN5hRRyXmyKNb25036VdDSG8AjV5mH7cg4JeorQNRADmZVVtrwjqZK U1eiZFCX3pOt+LirTT8/3mPBCQ4UosFZd73tQoc0IJ1R94DuCKaj4j3a8DGJOevpBpzk nK/k/nwPl32tp8uqtVY/e02Yfag2Kacop39RZ4osF+aN3iiVkQvM3y7K8ZuaxA52LstC ehBbf6Xsp4WHU9WO/G8o2b35nYQafQdQYpzLqWL2NC7tO3L5nOeHHTQnD0oxwYplcThq MyvA== X-Gm-Message-State: AC+VfDyQgVz1CVRq1PricKrKN3SNCXHdt6Ofv2kx+VbOm27XdPzbCI0z rV2MDZ5NsWFj1Stk+iq0k0E= X-Google-Smtp-Source: ACHHUZ5Nsi32LCrv1wkY3Q1YnwLUja35YD1C06qrqpyjQaRiaaIadIbfPyOvjjEdr7k5omq1qnotNw== X-Received: by 2002:a05:600c:2144:b0:3f8:946:115d with SMTP id v4-20020a05600c214400b003f80946115dmr2992226wml.30.1686429374960; Sat, 10 Jun 2023 13:36:14 -0700 (PDT) Received: from user-PC.. ([92.51.95.194]) by smtp.gmail.com with ESMTPSA id m13-20020a7bce0d000000b003f42a75ac2asm6572867wmc.23.2023.06.10.13.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 13:36:14 -0700 (PDT) From: Maksim Kiselev To: linux-kernel@vger.kernel.org Cc: Maxim Kiselev , 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 , Paul Walmsley , Palmer Dabbelt , Albert Ou , Cristian Ciocaltea , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org Subject: [PATCH v2 1/3] dt-bindings: thermal: sun8i: Add binding for D1/T113s THS controller Date: Sat, 10 Jun 2023 23:35:42 +0300 Message-Id: <20230610203549.1127334-2-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230610203549.1127334-1-bigunclemax@gmail.com> References: <20230610203549.1127334-1-bigunclemax@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230610_133616_961709_E9277BAC X-CRM114-Status: GOOD ( 11.00 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Maxim Kiselev Add a binding for D1/T113s thermal sensor controller. Signed-off-by: Maxim Kiselev Signed-off-by: Maksim Kiselev --- .../thermal/allwinner,sun8i-a83t-ths.yaml | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml index fbd4212285e2..001faa37fc27 100644 --- a/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml +++ b/Documentation/devicetree/bindings/thermal/allwinner,sun8i-a83t-ths.yaml @@ -16,6 +16,7 @@ properties: - allwinner,sun8i-a83t-ths - allwinner,sun8i-h3-ths - allwinner,sun8i-r40-ths + - allwinner,sun20i-d1-ths - allwinner,sun50i-a64-ths - allwinner,sun50i-a100-ths - allwinner,sun50i-h5-ths @@ -61,6 +62,7 @@ allOf: compatible: contains: enum: + - allwinner,sun20i-d1-ths - allwinner,sun50i-a100-ths - allwinner,sun50i-h6-ths @@ -84,7 +86,9 @@ allOf: properties: compatible: contains: - const: allwinner,sun8i-h3-ths + enum: + - allwinner,sun8i-h3-ths + - allwinner,sun20i-d1-ths then: properties: @@ -103,6 +107,7 @@ allOf: enum: - allwinner,sun8i-h3-ths - allwinner,sun8i-r40-ths + - allwinner,sun20i-d1-ths - allwinner,sun50i-a64-ths - allwinner,sun50i-a100-ths - allwinner,sun50i-h5-ths @@ -159,4 +164,17 @@ examples: #thermal-sensor-cells = <1>; }; + - | + thermal-sensor@2009400 { + compatible = "allwinner,sun20i-d1-ths"; + reg = <0x02009400 0x400>; + interrupts = <0 90 0>; + clocks = <&ccu 0>; + clock-names = "bus"; + resets = <&ccu 2>; + nvmem-cells = <&ths_calibration>; + nvmem-cell-names = "calibration"; + #thermal-sensor-cells = <0>; + }; + ... From patchwork Sat Jun 10 20:35:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 13275073 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 8E2CCC7EE2E for ; Sat, 10 Jun 2023 20:36:32 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W4XxxLord83Gzlou6FeZSbrT96sW86FPUAHaoRPWxMw=; b=GRkm0EdE6FgYl3 daSYA8jh2lXRe39c223B0GvqTSnyeH5mua5Siv5UjfW/Hyv854ngc4oET/xPMwAmdYFNeLyTs/HPq TQLbYpwYUu6pZmvxbDzNFQPWNZyeNaRx1rL0iOJyDJO1Ht+MIdVgQvf2K5zm12tPCkoGhmogWfMEt aIop0+2egmU00I3xIGN+5x+1vYlMwmCQ8kBIAeTDrp3yOLpyD/txWU00UV7jc2OKStESYFIhbp3qG 11zUoRvOq2ylNfsQ9OzpQMPxHChTV+03t5y8UNoH/4E/IbDKHMqFJ10BUd0ZvnuvyC6wXIWYlXDrw Mwj0NYziBS+qN5yTcjVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q85K0-00H0tN-1L; Sat, 10 Jun 2023 20:36:28 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q85Jw-00H0rT-2l; Sat, 10 Jun 2023 20:36:26 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f730c1253fso21260925e9.1; Sat, 10 Jun 2023 13:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686429383; x=1689021383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=e9cOOb3r9v8BRSMkdUQlBjQ12Gi0JnIYbGoQ0F774a0=; b=hCzJ8w/C8XAiKMLk1PQVqDGJUYz+ewadst0OkQUn4d5nizx00kUrz+JvsV5fjHJOs1 xYN7oz/akg9Y/NBAodNbp7uwpGj7HcK++NNAtUFmiRQTPl7g8/4jYmmg/y0cuvOudf1z EY6uBG3TAPq0mFe3X/T8YGU230zN5YUKmwSoODaUofWBqgMEf5ZHqRO2vFsZ9giLPHD+ xbaWYFLF4lEIo51q7jS30UB3k5tgtJSEalnDNpZNciBuNxSt6AJUubqrD1V9pbvpOdF5 zOkfgWYCkLE4YeuVNtGKw1XL7w6HUJravJGULA496KvFehy6T0ENZSaQVGYE0sXfj8zw R0xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686429383; x=1689021383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e9cOOb3r9v8BRSMkdUQlBjQ12Gi0JnIYbGoQ0F774a0=; b=WoJ/3bcAOgjeAPASw8nTiYvYwMyvsKTaU1MyORMdeMr3zs6uJnCB/fUiCTSMgResNH vwUwNbfBK57NlD/FKm1/6t7/hnArzvSnoVIxhDyKaH5S9n0aX92NwZO4fMZDAOz6KwC7 xgG5fyE9DanCLZwJzT0sHSajKIzRLn3Ccg3tk8PrjUJfev52SWXTYWXgFsIlbOLPaui+ RsnkLaeygwcYvcUawH0jj7U056kdUXna/XD4TT01jvACi30xkkif4XXR2A14KbunU+EC PSDrWKfNsJz3LKVDtGxOe+icS6/rkaER0x3KVbzULYO1i9XfVxzdAeaKESshQ23zVBzI r/Zg== X-Gm-Message-State: AC+VfDwTaJLxZ7pKiu8qCIgj39FB22vfgU5rW+ZkEB3nZVm4WDFFbTnm HmBjti7XJ51hF2WWnoTAO78= X-Google-Smtp-Source: ACHHUZ6znngh/wR+0bLuo2/c7FCAm/DUauulTjJoR3scCyrl5bnT5rG0oH5Yd0jsw/WxkHptEHGjQQ== X-Received: by 2002:a7b:c7d8:0:b0:3f7:16ed:4cb2 with SMTP id z24-20020a7bc7d8000000b003f716ed4cb2mr3232250wmk.13.1686429382439; Sat, 10 Jun 2023 13:36:22 -0700 (PDT) Received: from user-PC.. ([92.51.95.194]) by smtp.gmail.com with ESMTPSA id m13-20020a7bce0d000000b003f42a75ac2asm6572867wmc.23.2023.06.10.13.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 13:36:22 -0700 (PDT) From: Maksim Kiselev To: linux-kernel@vger.kernel.org Cc: Maxim Kiselev , 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 , Paul Walmsley , Palmer Dabbelt , Albert Ou , Cristian Ciocaltea , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org Subject: [PATCH v2 2/3] thermal: sun8i: Add D1/T113s THS controller support Date: Sat, 10 Jun 2023 23:35:43 +0300 Message-Id: <20230610203549.1127334-3-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230610203549.1127334-1-bigunclemax@gmail.com> References: <20230610203549.1127334-1-bigunclemax@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230610_133624_894041_E75AE25C X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Maxim Kiselev This patch adds a thermal sensor controller support for the D1/T113s, which is similar to the one on H6, but with only one sensor and different scale and offset values. Signed-off-by: Maxim Kiselev Signed-off-by: Maksim Kiselev --- drivers/thermal/sun8i_thermal.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c index 793ddce72132..01cc4e130892 100644 --- a/drivers/thermal/sun8i_thermal.c +++ b/drivers/thermal/sun8i_thermal.c @@ -628,6 +628,18 @@ static const struct ths_thermal_chip sun50i_h6_ths = { .calc_temp = sun8i_ths_calc_temp, }; +static const struct ths_thermal_chip sun20i_d1_ths = { + .sensor_num = 1, + .has_bus_clk_reset = true, + .offset = 188552, + .scale = 673, + .temp_data_base = SUN50I_H6_THS_TEMP_DATA, + .calibrate = sun50i_h6_ths_calibrate, + .init = sun50i_h6_thermal_init, + .irq_ack = sun50i_h6_irq_ack, + .calc_temp = sun8i_ths_calc_temp, +}; + static const struct of_device_id of_ths_match[] = { { .compatible = "allwinner,sun8i-a83t-ths", .data = &sun8i_a83t_ths }, { .compatible = "allwinner,sun8i-h3-ths", .data = &sun8i_h3_ths }, @@ -636,6 +648,7 @@ static const struct of_device_id of_ths_match[] = { { .compatible = "allwinner,sun50i-a100-ths", .data = &sun50i_a100_ths }, { .compatible = "allwinner,sun50i-h5-ths", .data = &sun50i_h5_ths }, { .compatible = "allwinner,sun50i-h6-ths", .data = &sun50i_h6_ths }, + { .compatible = "allwinner,sun20i-d1-ths", .data = &sun20i_d1_ths }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, of_ths_match); From patchwork Sat Jun 10 20:35:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 13275074 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 2A11EC7EE43 for ; Sat, 10 Jun 2023 20:36:40 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lC8/oJn9KFOPrxmIaq+B5/yp9akZgMRska6KvFG4Kmc=; b=z+w3zEyHQuwHAS 00IylQYC7WMRIy7u0m5hKlGSx6zlmW2b4J5flH3YmGt/lLO/a13ItPtb1G7lOSDs4OIUynqUmmrHI 3bY4GnuILteMAhFT9fA3FL48QlbVWhL5to2ihw244KDR9IBgTES2wF3GMueTIMCHCxHQKPRLby875 xBbPzjPnZCbzIGFILadW2NcJ6ITI3LHFRTrR6hB0a9VQu0lYrJh3SvXfriO3jh0ek/Z5Wtv70uqW7 n5kXLtX79XQ9JeM3ZcfOb0tVTsw8K55mb2srEsb01ND+bbyVhOGUTN/xvxak2ZUzWGZB5E7X+Zoko QNyGyKwddmsXx/2uHYMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q85K7-00H0xm-2x; Sat, 10 Jun 2023 20:36:35 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q85K4-00H0us-19; Sat, 10 Jun 2023 20:36:33 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3f7f4819256so22158755e9.1; Sat, 10 Jun 2023 13:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686429390; x=1689021390; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iADzhJzSziS7zTAopdQl1F1LJEpxTBMZdMAeH9fjzio=; b=Bm3zYkI0IGQ1FSCpqk+234/h0gkcSzDm70S2yoO/lXMfJwYUfFTD0FB2emzCrK2GI9 9wgoLsJxkwXeEgLVCLrIVVkFFyKms9G3DIucdfZVi5EORIEi2w8nfGSckf87X0Hs0D7g sw1ncM+AoiTjg+p0jOgGYvJwideciJNJ4tZhfCxU/j2eJS1t/poY3JDuYc+NZ7SnGAni 1whAg3p1QEiIO480DcOznESxesMcMh1P78/N+pWTw/qOjlkqaDRSsMvXwXtRGFJF80sT grGB4vXb/a8K+liaAGkrWio+4C3Nw/YGYib7QUaLe0Wdxe2YphuaamiuAcXdZHMO9BKO /+3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686429390; x=1689021390; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iADzhJzSziS7zTAopdQl1F1LJEpxTBMZdMAeH9fjzio=; b=XqKZB6ESkzTF7ca/GGfUC8VqEbxlL2ucKqJ+5gvp5b4/tdboF7Fis2f6a+0Pb2/kgm Ii/f9pv+1jmZBOA6c114ABCE8rvgR10HpWik0/JDBnEs+qGgEOA+EC/x3jYVwkjTNOql 9DJArrXR6oSJ/zFc1O8WmB+AibzSTgndSmPw2iP82geHBi8pLPyJ0QvjTSfvnOAl6LsM pr/9ATBVqHTgGyD3+iyVHmokTvEflY2v3ETQKA2EaNceZOfis9b32PTKYBWi/CMfAaPt 1fLkJPYRk5Gb9kxafJfa31tRAgLZQ0wBbt//EE/J81r3xoOFoTax20QsacQFIUGWnkGo DHMA== X-Gm-Message-State: AC+VfDzDqTuPZe7tOJHG98ApKa85opbJK5dGskhnld1wUokBaBZauFaI oLxWk7EDT5V0tyAa+q/Hkig= X-Google-Smtp-Source: ACHHUZ6ztxNBWHhkcgno6mzQ/hQvNnl3aEdK/r5i0RGahfv9+1tI5qQxdo13vdx1ALpyyrMoMmQ3Fg== X-Received: by 2002:a1c:7715:0:b0:3f8:153b:a51e with SMTP id t21-20020a1c7715000000b003f8153ba51emr441389wmi.36.1686429390438; Sat, 10 Jun 2023 13:36:30 -0700 (PDT) Received: from user-PC.. ([92.51.95.194]) by smtp.gmail.com with ESMTPSA id m13-20020a7bce0d000000b003f42a75ac2asm6572867wmc.23.2023.06.10.13.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 13:36:30 -0700 (PDT) From: Maksim Kiselev To: linux-kernel@vger.kernel.org Cc: Maxim Kiselev , 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 , Paul Walmsley , Palmer Dabbelt , Albert Ou , Cristian Ciocaltea , Andre Przywara , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-riscv@lists.infradead.org Subject: [PATCH v2 3/3] riscv: dts: allwinner: d1: Add thermal sensor and thermal zone Date: Sat, 10 Jun 2023 23:35:44 +0300 Message-Id: <20230610203549.1127334-4-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230610203549.1127334-1-bigunclemax@gmail.com> References: <20230610203549.1127334-1-bigunclemax@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230610_133632_409396_51B53C82 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Maxim Kiselev This patch adds a thermal sensor controller node for the D1/T113s. Also it adds a THS calibration data cell and thermal zone. Signed-off-by: Maxim Kiselev Signed-off-by: Maksim Kiselev --- .../boot/dts/allwinner/sunxi-d1s-t113.dtsi | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi index 922e8e0e2c09..b893f3325554 100644 --- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include / { #address-cells = <1>; @@ -138,6 +139,19 @@ ccu: clock-controller@2001000 { #reset-cells = <1>; }; + ths: thermal-sensor@2009400 { + compatible = "allwinner,sun20i-d1-ths"; + reg = <0x02009400 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_THS>; + clock-names = "bus"; + resets = <&ccu RST_BUS_THS>; + nvmem-cells = <&ths_calibration>; + nvmem-cell-names = "calibration"; + status = "disabled"; + #thermal-sensor-cells = <0>; + }; + dmic: dmic@2031000 { compatible = "allwinner,sun20i-d1-dmic", "allwinner,sun50i-h6-dmic"; @@ -365,6 +379,10 @@ sid: efuse@3006000 { reg = <0x3006000 0x1000>; #address-cells = <1>; #size-cells = <1>; + + ths_calibration: thermal-sensor-calibration@14 { + reg = <0x14 0x4>; + }; }; crypto: crypto@3040000 { @@ -843,4 +861,12 @@ rtc: rtc@7090000 { #clock-cells = <1>; }; }; + + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 0>; + }; + }; };