Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3417281rwd; Sat, 10 Jun 2023 07:21:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6GLAGtPK0/sE84s1YRZ5TK8FxSGIsGa1t+SMLpARdBp8DY/KnIF7VHS7X4hP9YmGCNUnZx X-Received: by 2002:a17:907:26c9:b0:968:236:eb17 with SMTP id bp9-20020a17090726c900b009680236eb17mr4764525ejc.24.1686406860075; Sat, 10 Jun 2023 07:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686406860; cv=none; d=google.com; s=arc-20160816; b=qoeSBVJVDFYhbTMYQ2U2EszBV5rOwWXVsPC8N+kZ5oW5w45mzmvgN8quaWderVfrCj jLwXq9EEll0+uNHO0kso+WvJXUOwPbEFecDJlI8nJCJrOHSm7Q87Z7CKPa6aLxVrGG5N vmkucpmPTUIzq/v0ERY7BTi9LxpMawDsbZpcGWdgCyuY6bJVQAsE9DWiCqtTWZG3xdAG YlFT/gv8Jo18fCp/OkOivl9piPRBBuMsKpJY6k4yKqqp3GqQY/rmtOAYvsS9NuAAeGiv q3GGxHQdWtXygL896irPWV92/R6K5+Zj9O4i2qQvO5s2yzvIzVmoSX2wnena6nrpri99 5FJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=e9cOOb3r9v8BRSMkdUQlBjQ12Gi0JnIYbGoQ0F774a0=; b=bCXIaGRMuRl4JDOxWSBnmOK8x18wiYvuXfVGia5LgueL8dXghkJ3uNLlDGB2x0Ua22 MsUEzdw1IBUasNSpGKFgJ4O1k6LbuCG4NuGiVyqNIHm6cVmcbBYqMInQyipyy717UPOy eXo5+FadhMaVJE4i5IP53KEXaH7h4wPfRB0bJfqSUfwUdIFmn/GA99pfK08EAqaSCHrg 3botjqDAaZ8k1WCEIlxwB24eg0kOfBedtLM30Xx9Smq6jimZnZfpzhG1KmD3zA1Y0X6f aA15NoNpeouXI7gMUSDRHTNmcWbw8jiL26xvqc+k/gonmovosvKeFttOjPGkxUnN7uQF VcBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kNwy6UQT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v23-20020a17090690d700b0096f8c5b1279si3247792ejw.313.2023.06.10.07.20.34; Sat, 10 Jun 2023 07:21:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=kNwy6UQT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235254AbjFJOSM (ORCPT + 99 others); Sat, 10 Jun 2023 10:18:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235207AbjFJOSJ (ORCPT ); Sat, 10 Jun 2023 10:18:09 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C4BE3AA3; Sat, 10 Jun 2023 07:18:07 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f736e0c9a8so20648315e9.2; Sat, 10 Jun 2023 07:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686406685; x=1688998685; 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=kNwy6UQTNhOxiYaxn0QFVJliYWZalve47Symz95XFyBIaz9YlzqeRGPP2Gk2ZX/S4e 2XSb++WWR7c6+CEHm+6NxWdHPWmwQ9OWaK3Y2fLZGFPRq/7e3e6xfyCF441UX5d/TCVH o+BBxEhrQ1ulFxmPKAyrmVHElgN3SI2DEYycJBbPnELadGQ/D/R9q1Hdkp+2dqc5f2I4 lHd9xVRtvrPfhvt/7sttgKpsBU70eHal+9s5GpesiZjzMlJEVC2bMT1J6VhxUXdssXd9 f5Rt3kCxdZ8iyt7NJ68SUW+B74PFwiw2116CwZZ5L5szsaeJwXMbJ1gXynQhn3j31f6B lMDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686406685; x=1688998685; 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=AD/cfvW3fA9SdBxnBD7jo3whN5j3cMpduqk52GGKGppphJ+fPHR0h0RlSzhI/JyPnC AOKIcHZ2KfjjGUSMDE94wDc7I41DKG1vPzM7k08jW2gxRxfE9VdhqImyTa6qp+bJnHXS 6fzTQ4GE6qrDH/B82dbAu+veCmtlJxYrlAPRXeYTzr9gN+X5eZ4LxcHgF363663r6hKs w+lZFvFEDjcbv4/gnZHpdB6K8gJbgsrzgZut1EcQJzux5RwA2C2h7vtNoHGmnKipZ/hI F1Yeepx1k+0Q+Rube5HUNQEakV2eY+MyEga/tVsPjNtz5ry/tM4+LTl6dP75uWNJdfz6 J3HQ== X-Gm-Message-State: AC+VfDzjmd20NADsGeCitwKGNaHDS6ye193cIIFn6uEvuj2m5fXBzkkN bICDn4L68TMeyyz3fZimpLiOjTM32sNX7WCf X-Received: by 2002:a7b:c454:0:b0:3f7:e6d7:f711 with SMTP id l20-20020a7bc454000000b003f7e6d7f711mr2743988wmi.7.1686406685338; Sat, 10 Jun 2023 07:18:05 -0700 (PDT) Received: from user-PC.. ([178.134.198.138]) by smtp.gmail.com with ESMTPSA id z10-20020a05600c220a00b003f735d6fa74sm5841488wml.9.2023.06.10.07.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Jun 2023 07:18:05 -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 v1 1/3] thermal: sun8i: Add D1/T113s THS controller support Date: Sat, 10 Jun 2023 17:17:32 +0300 Message-Id: <20230610141739.999268-2-bigunclemax@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230610141739.999268-1-bigunclemax@gmail.com> References: <20230610141739.999268-1-bigunclemax@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- 2.39.2