From patchwork Sun Dec 17 21:06:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 755169 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.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 47CBF481D1; Sun, 17 Dec 2023 21:09:16 +0000 (UTC) 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e/A2GRuY" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5533ca9cc00so585133a12.2; Sun, 17 Dec 2023 13:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702847354; x=1703452154; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XxR6hF/d37at9Svy1FV0ihBmt4KDeen/lqmXip53gJA=; b=e/A2GRuYovUYxKwe/LnzBNhlma98wxet7jl013VppOBxC/ncQ6aMzqFRsKc8Wi2UNw naOLVa17CC6FRt5FC4EAnaGlygr3z4ArPvidHKtzzxw68ioMcwS2QZ1M6MSjnIVt4oIh zQ7oEBfOOVdja2PuXTxEpAglDkaEPsZqOQB2T8GkcyhhpVdo3gRpSqBWtyJcKebmVsuA Mdm9SRchbKnD1eJTefbRYf6MwKMfie71gjZc5Dk2RDiet6M1XhxNz/9GU89X4wQ1TXMf p0DCzMg2FRt8d7+i+ABOO9YAR6XTuZOlHqnqEIDPcvf+dl6EKoegeusBljHuxJtaKwco mRNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702847354; x=1703452154; 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=XxR6hF/d37at9Svy1FV0ihBmt4KDeen/lqmXip53gJA=; b=fYtO94DHAprL5vJKet+UJCtV4qIDuouCnP19bqoPmDuKc76Y3rVz3cUT88XkwUgKtg gAIlz9VFiZnRmrKwAwtT9QfKI8EP/RESGVxOvcvw+djbgeoXsQtmrOphUBx3vT3HpEGS nTtrmGRsTCWaqSFjCI7mFp+TCIynuSlHHpoJ2g0PNn72De5H+jU5VZFEhTKfzNxKpRrE ekDiKrTHqmNyyip2BqeuD7hvptVAfW07RZMUmnGhWDbcD+FVD0ZAz68hqdqv1u6hVe+q LBs5OjzHfIA5ADPMz5WjCVCtOvtwyJ0ggzkmG+0G+mhZsd3BlcNcpNBBvc70sVz20PTS MZ3g== X-Gm-Message-State: AOJu0YyW4X0pa6WCwehYIzMj8KWoQjk7wZOV7tBE/aUH8S3h6KbMK+qP V7pda+6oK0mTkWq3Rv5Dus0= X-Google-Smtp-Source: AGHT+IH8rZUBNlfMGfHajr+JWoOQrRyXykFKDWSFBD2jwvMitlgbukM748ZcSk7h6iptqsxEjLQnuQ== X-Received: by 2002:a17:907:6d07:b0:a23:5369:9890 with SMTP id sa7-20020a1709076d0700b00a2353699890mr583642ejc.79.1702847354192; Sun, 17 Dec 2023 13:09:14 -0800 (PST) Received: from wpc.yadro.com (188-169-139-214.dsl.utg.ge. [188.169.139.214]) by smtp.gmail.com with ESMTPSA id vc11-20020a170907d08b00b00a1ce58e9fc7sm13316096ejc.64.2023.12.17.13.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 13:09:14 -0800 (PST) From: Maksim Kiselev To: Cc: Andre Przywara , Maxim Kiselev , Conor Dooley , Vasily Khoruzhick , Yangtao Li , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Walmsley , Palmer Dabbelt , Albert Ou , John Watts , Cristian Ciocaltea , Marc Kleine-Budde , 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, linux-riscv@lists.infradead.org Subject: [PATCH v6 1/3] dt-bindings: thermal: sun8i: Add binding for D1/T113s THS controller Date: Mon, 18 Dec 2023 00:06:22 +0300 Message-Id: <20231217210629.131486-2-bigunclemax@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231217210629.131486-1-bigunclemax@gmail.com> References: <20231217210629.131486-1-bigunclemax@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Maxim Kiselev Add a binding for D1/T113s thermal sensor controller. Signed-off-by: Maxim Kiselev Reviewed-by: Conor Dooley --- .../bindings/thermal/allwinner,sun8i-a83t-ths.yaml | 7 ++++++- 1 file changed, 6 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..9b2272a9ec15 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 From patchwork Sun Dec 17 21:06:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 755676 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 B2846481D7; Sun, 17 Dec 2023 21:09:22 +0000 (UTC) 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mseP0aXD" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-55333eb0312so480018a12.1; Sun, 17 Dec 2023 13:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702847361; x=1703452161; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LAUbIAntM3d+P1r7PxLEQx0z9V8P0MjzX6e4WUbLKOw=; b=mseP0aXD5abnrW5Tv6VZybfDnf3cG9KKDug+wW+GoNP+H45Sb3iw5s3e4ku6bdxiK6 LxaeD3xMqB7sAGgGXsZwU9YlSF3wVaajPZ9Ot61P0TlEUOPHmD814LxBQ0t+Fcj4ghUD CZf9fx1e4QDfH/KBv9Me9bdiVlsbxahTnLGv4zraNHMiRJ4BXXQ5kyNVchIeFvndbjN6 ce4ReTDfQBj0GIYzlGWkJC/YHfZkLwVPLdc571HPZ82DqDZvQoC4PpJXJBmGP21+J019 1kghp+SUr8smCclUXmzsa9UOeAZ/iw3lg4s1gjuDilksSE5JOMmwKVBTbAhwrMa+SskN cUhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702847361; x=1703452161; 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=LAUbIAntM3d+P1r7PxLEQx0z9V8P0MjzX6e4WUbLKOw=; b=uZ4vU/46xSGcv1nGl4d2+adgkpPGH5cTxwCW8xHAarub14iA9UL1xbCG5dSjPyiWWU dhVnd+sYKkWt9TdjqAFO2CF6h9EKIq7ikkyMnkhkMQIf2D7vFeI9Dz2UELRUJSJSwpB/ hNoKoYnzXlQv9l2C3/Eadi/WoLIfKcx5Pu/JqQid2xlaK1JKdVlhH8HY101hSh5o8VPS X8gp+SbUZ2UdomLKbqFQpiRPavsrz4CwU4jFB5dWqBKcwK8VvFhnYjx8Qe3qy0+ko6yr j/qvGXJTrMcsbmN3tPflWrmPYrtsND1j9G0utUC2a+1K/RsOcNWlVMl8w6O7010kr6Px u01w== X-Gm-Message-State: AOJu0YzDzdgC3wFw2SxLiVxHjY3gcI1Kd34jSl4IeoT6Ubec0WZu4O/R c0hCib8PaEKr1iqE5KyQVKk= X-Google-Smtp-Source: AGHT+IGXBluqcGQB7k35DpbnUHnaijO7J6FnYJlOKlthAcSTpRKN4IAiy50prOqyAzcchEuhhGrjqg== X-Received: by 2002:a17:907:a0d:b0:a23:3212:9c37 with SMTP id bb13-20020a1709070a0d00b00a2332129c37mr1452093ejc.50.1702847360868; Sun, 17 Dec 2023 13:09:20 -0800 (PST) Received: from wpc.yadro.com (188-169-139-214.dsl.utg.ge. [188.169.139.214]) by smtp.gmail.com with ESMTPSA id vc11-20020a170907d08b00b00a1ce58e9fc7sm13316096ejc.64.2023.12.17.13.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 13:09:20 -0800 (PST) From: Maksim Kiselev To: Cc: Andre Przywara , Maxim Kiselev , Vasily Khoruzhick , Yangtao Li , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Walmsley , Palmer Dabbelt , Albert Ou , John Watts , Cristian Ciocaltea , Marc Kleine-Budde , 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, linux-riscv@lists.infradead.org Subject: [PATCH v6 2/3] thermal: sun8i: Add D1/T113s THS controller support Date: Mon, 18 Dec 2023 00:06:23 +0300 Message-Id: <20231217210629.131486-3-bigunclemax@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231217210629.131486-1-bigunclemax@gmail.com> References: <20231217210629.131486-1-bigunclemax@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Acked-by: Jernej Skrabec --- 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 f989b55a8aa8..6a8e386dbc8d 100644 --- a/drivers/thermal/sun8i_thermal.c +++ b/drivers/thermal/sun8i_thermal.c @@ -606,6 +606,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 }, @@ -614,6 +626,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 Sun Dec 17 21:06:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maksim Kiselev X-Patchwork-Id: 755168 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.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 BA23E49F77; Sun, 17 Dec 2023 21:09:29 +0000 (UTC) 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iryjYSYb" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-50e270639d9so1550155e87.3; Sun, 17 Dec 2023 13:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702847368; x=1703452168; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VEmC8yzpg0VqIzMb5nxgOtA5V+BfOBifdcCXQ6xHVfo=; b=iryjYSYbYP0DX/DmxzCa3kCTEutqt0G46cq6jTWg7Xyyu+jDhL8ie0RS+LBfbd5x1T xawtKL6XuNUU+sMSu+w+4Dr2BasvRvyhM9LSKlO7eLKYi2p8kg53jE4H1qOCcPNjWyA6 rUzqklvajrJzGa3vLNciYpJPs3UCA2YA7BzWkXcBGqJgZLwAozmvZEFc5HtrYIYfzL+5 0B215HNmdkrp5BauVHLVFkqT0AU3ko2jBY8USoyrLELeakJTQ4fTwuWCTyn7sWvAaTsK wpSM2scGyPu6seP11K2zxZHOvFvXv7GMbu5u40b7Ba3nNXLt1llVZWAvWIyMKHk90xcQ KrWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702847368; x=1703452168; 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=VEmC8yzpg0VqIzMb5nxgOtA5V+BfOBifdcCXQ6xHVfo=; b=cFnpmFueIzJZjhFdSmHvYt/EJCxNJtE3Sq92RJ/fa5HkV5qm/ccZbUONocdIcSoxGC gfpmm4o2LscIhKherJiFaVyksMbziWM8o1E0jqTbTTCmSQEoQ+qDQURqfhL5c7nNZqEj GGcsbqx6h6HOt+zJ5aQoKfPfVbz5n/sHnobK5MwMg8kPfneGeEvC77DRQpk9fUiR2VDH f+SSx597URAE/k4r4ELc8iPeXBIkZOZkmZgwx4MZJlbDCkyZQRYCEGRbcJgv62hidocu RTi4KLGr1tt7CWONJsFcpErkrXFVNsuvZGPmqAXbFDmj4FeORS4Awo3A6+Z2eyWwBKfN 7C5w== X-Gm-Message-State: AOJu0YzQpaCpRp7s9XMkQpb9ckBHnHn6mfhbR5MokbCM/7A7/Dob5gQJ ab1z2cQTMFuFOQ83nTyXDaI= X-Google-Smtp-Source: AGHT+IEmHz+jRu9UqOYO0LhhslWbwSbg09nII/aLGLXumsvPqPzNtDYWNyrCPwroyrvzHYdz6tqJSQ== X-Received: by 2002:ac2:4c15:0:b0:50e:3b2a:a7ed with SMTP id t21-20020ac24c15000000b0050e3b2aa7edmr29915lfq.16.1702847367506; Sun, 17 Dec 2023 13:09:27 -0800 (PST) Received: from wpc.yadro.com (188-169-139-214.dsl.utg.ge. [188.169.139.214]) by smtp.gmail.com with ESMTPSA id vc11-20020a170907d08b00b00a1ce58e9fc7sm13316096ejc.64.2023.12.17.13.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 13:09:27 -0800 (PST) From: Maksim Kiselev To: Cc: Andre Przywara , Maxim Kiselev , Vasily Khoruzhick , Yangtao Li , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Walmsley , Palmer Dabbelt , Albert Ou , Marc Kleine-Budde , John Watts , Cristian Ciocaltea , 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, linux-riscv@lists.infradead.org Subject: [PATCH v6 3/3] riscv: dts: allwinner: d1: Add thermal sensor Date: Mon, 18 Dec 2023 00:06:24 +0300 Message-Id: <20231217210629.131486-4-bigunclemax@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231217210629.131486-1-bigunclemax@gmail.com> References: <20231217210629.131486-1-bigunclemax@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Maxim Kiselev This patch adds a thermal sensor controller node for the D1/T113s. Also it adds a THS calibration data cell to efuse node. Signed-off-by: Maxim Kiselev Reviewed-by: Andre Przywara --- .../boot/dts/allwinner/sunxi-d1s-t113.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi index 5a9d7f5a75b4..6f5427d9cfbf 100644 --- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi @@ -166,6 +166,19 @@ gpadc: adc@2009000 { #io-channel-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"; @@ -415,6 +428,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 {