Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3734226rwd; Sat, 10 Jun 2023 13:41:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4lwHYCGj84XiVdcG5Zxrg9DLkp1vKm0Xk/3/e9dipf9znnxPd6GbqputiYRcQlRkVI4xam X-Received: by 2002:a17:903:1104:b0:1b0:2d08:eb51 with SMTP id n4-20020a170903110400b001b02d08eb51mr3218420plh.12.1686429709609; Sat, 10 Jun 2023 13:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686429709; cv=none; d=google.com; s=arc-20160816; b=dZsgd0NB9F8ciVHOv1w5410jDtNmYQWKROX9l49Vtm0j0S+GlSWp1cYwxOG+VzF57K 0B/ovjAMYCC0555Ynx88/gTIhFQK2lrnfT2VM7UUvG7zV/IQB2tg7+xsA+uootBSYQTV M01ORtynS8/c3z1TBjArlIji5MT0kabrA3cRJ9PlnSAp1ERCEvNOem9dwyOcKEG/GB7X SUVck9i6mFuFl1+i+lkhYqnxYH0TtIIJ6qP8OzqVM/VQDG38weCoF0pr4gMPiTyvFNVg iRPavBvBc8o/xoUGEUnsnwutL77Z/6z3ky+y+JlJiUMBPsD/EdWJR2kEBqumVOD0Dk9O Vp5A== 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=TpbaCe3SQYzjHlgGlOZCn8scSV3jUHKOiEtikMIFOhCBCMqk8pOEqQC6JLktfCGF7n KipynG/rg83vKYr75NuBfEKq7HbQZvsb9v54Asta/BWDbANYb2RQkrdcgDjeFrXj9Ky+ j4y2+pRG0/O886MQYwQsrdLHpvwihU6wj/1uUeYwxoJNaXEIHDR4eibnTFWZa5gFnC6s Cd0VwpxMKpmnW7/jNzt+Q7kq0vU9BAQGZ0V7pGX4LCG5U/iKRCNxRK7RTzxpiDkBWHkH 0MB8oL/jcMCk7vTZQ9Cz5euwnNR5f/6wJNZjHGcaYnMT04Sirb0G1ZzpbUheykHz0Uwm GRCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="hCzJ8w/C"; 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 q8-20020a17090311c800b001b3affd712asi891813plh.133.2023.06.10.13.41.37; Sat, 10 Jun 2023 13:41:49 -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="hCzJ8w/C"; 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 S231154AbjFJUg2 (ORCPT + 99 others); Sat, 10 Jun 2023 16:36:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231709AbjFJUg0 (ORCPT ); Sat, 10 Jun 2023 16:36:26 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF4E3A8D; Sat, 10 Jun 2023 13:36:24 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f7378a75c0so21243595e9.3; 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=lYMwXzndHISGjAChQtoShMDPfNpzSDoZQnj89NLesGV5szWUU1n/2JVeXbjL/NJeSa kyY4Tohih554DVDMvbzCUbMzcki+x9Kwt67MDgXfALtxxyCUJ3+fnDekAB3urlKlrnYo Yc+K9fE/2RfFEB/zbOUWCJo169uN9Z3zGNNVw778yYKd6RTlwaA8+toxgSgtrcpq4fGG KCjM4krwEudNfcIWiPA/FZofX6mey+CH48NgjoyUDFK30BUegk7XOnMpvD+OBpr+UcCI TKHxZRpEEYhvc27TpM9vYN0Cltaud48dnbZ2aIF1SqoINRj7BuzKeuLSbfhUaf0JcROL aFhw== X-Gm-Message-State: AC+VfDyDFLpJs75Pn54XYnZeNBPEPGIVKJKKYiTKprRcYY/hzQwrk07d ibp7ZmLj2mD6CzbFV+8BhxiaulxX0XdNUhet 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 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