Received: by 2002:a05:7412:361b:b0:f9:2edb:3e4d with SMTP id ie27csp103162rdb; Sun, 17 Dec 2023 16:58:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7+O2PuWL6KGBvxHqSplg1BPVW1T/sRiBggy7AYJAtTxEAve9KPlDSWmP0E0DEP7yfYEE2 X-Received: by 2002:a50:cd15:0:b0:552:e463:a388 with SMTP id z21-20020a50cd15000000b00552e463a388mr2085948edi.40.1702861080359; Sun, 17 Dec 2023 16:58:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702861080; cv=none; d=google.com; s=arc-20160816; b=FmQ6YKL7DBcva/REAjb/L1Kp4SFjKqmWc1rItQD/6thOfkiNn+CMu3SCeFA2bRqhWc n41s9caNJLpnrZXmVq8La0dFFsj3DZ6GN/C3FJnI+zyx0hfE4yDf20t0+AvuzWjXmWF6 oHANlcORQQx7WxZn2A085NvUQ0NN0Vq4Y2LTCK4Vi9AK87ZCh0aJivWNB6HZE19NLTI7 jvEilZYZwK3HZJYSCbMxtPF/U1/AjK0M22IKGhDSW5qNT2YlkEu5ZQZE9TmrFcsJ020m i+Nnfy71uAxCOLfiUp2q5oHC+YFlu7O4fy4wqoLPD4c+pmkD53h7XRnaqZCF7l0ACpJ0 RKLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=KnnDTibaiIVR2SxogpJmo3/Ut8PIEG6ITXMvXjcSynM=; fh=C0wKTZHc800kA6PN60mFRJA0OH/1tK5bt9aHHOkUEkA=; b=mJh5CP0TG7uUF6KE0U4iO9Y5SQ/1XISHlKJZDj5W3l88nbBjlhAleTp/cQTy/s3mBp KFb+/AnB76gbd4nmbR1mUA4WoTvZQITqI01oMKQmgAD1LA7V+9CA0cE5/KN4fJ1+ht1q uR0yy0oLwXpJxP3GrimTw+USi+8LBl43z3Fgf5nek4OBFcKbbufEb7J/Domu37lTtIf9 zmcKONQynh+cNYA4zNPKGRrKRszoDkNmERcyhpHfFQ8MCcr8JDIGK/4nZeXj4WP0nacS q+1khCNye8wNkzAaIeDIwzCtPwkMbiEUHJKtr91mLROD/AdOsCKOUeZXWh7gJmRq4Dsy w1cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f7-20020a50a6c7000000b005535cdad5e5si128163edc.366.2023.12.17.16.58.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 16:58:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2893-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E036B1F21C6A for ; Mon, 18 Dec 2023 00:57:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72A1D1FB2; Mon, 18 Dec 2023 00:57:52 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F10041863; Mon, 18 Dec 2023 00:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B55E81FB; Sun, 17 Dec 2023 16:58:32 -0800 (PST) Received: from minigeek.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C59CD3F738; Sun, 17 Dec 2023 16:57:44 -0800 (PST) Date: Mon, 18 Dec 2023 00:57:30 +0000 From: Andre Przywara To: Maksim Kiselev Cc: 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: Re: [PATCH v6 2/3] thermal: sun8i: Add D1/T113s THS controller support Message-ID: <20231218005730.59227952@minigeek.lan> In-Reply-To: <20231217210629.131486-3-bigunclemax@gmail.com> References: <20231217210629.131486-1-bigunclemax@gmail.com> <20231217210629.131486-3-bigunclemax@gmail.com> Organization: Arm Ltd. X-Mailer: Claws Mail 4.2.0 (GTK 3.24.31; x86_64-slackware-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 18 Dec 2023 00:06:23 +0300 Maksim Kiselev wrote: Hi Maksim, > 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. That looks alright to me, the offset and scale values match the converted values in the manual, and the rest looks indeed the same as used on the H6. > Signed-off-by: Maxim Kiselev Reviewed-by: Andre Przywara Thanks, Andre > --- > 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);