From patchwork Sat Oct 29 05:14:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 12644 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1193195wru; Fri, 28 Oct 2022 22:20:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pM/SlHsxC/joYI+zF/atAQ/BCNDxYrbltUTk2fHBaXB1HYo1uvJvfEtltncb675uJ1HYt X-Received: by 2002:a05:6a00:2402:b0:52c:81cf:8df8 with SMTP id z2-20020a056a00240200b0052c81cf8df8mr3108919pfh.60.1667020802756; Fri, 28 Oct 2022 22:20:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667020802; cv=none; d=google.com; s=arc-20160816; b=NwYD116VHpANLYP4sMjVCvL+jg7TKr3J86a1opbpWwZ77zY/6gpA0tPuTiTnRQUOkF wzM+wRpf3Hae2IrWJPu8EQJxpQ6JlYhP5gsvyIWnwwnnmFXQf1Aq4nkiwUjGdcm2hbl+ 8PLlT4pH+qG7oOFE8AUszpx4zvDEcfiyVG80pRRnADe1rVVLKfVpuCj/Ijq8/NXyH+Or VCFTjl3KH8bj5ys5buhqbBdjqmRp2BGt7pS0zmfSGjB3tNnT5olRcpEv55z6Gxt8MTqA gKCzqF0dL28t6XDy0axiN6e9xjjlPDeOyldMxbAp3nUKJK+Uh6VQleF7tSV8HoMiuVqq 0BTQ== 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=dpyWOsS0FBSOmnylpOdwOjAVxC2jYFz7gdsUBGPUnb0=; b=MOzb/uy8GPxC9bfgXk10Ke3o1t5XjGfDZrg6cwIaeLyVwAGrEtsUAYEyNRTkKZx87X OlXFZqHZVYsJMSbaDppkCSHRvX7om2DQTuP/hI1anE1UJh2dBho1PWQWKIr4MgIm3OBc V76vjSWI12IT8WYvsbkA8+OzcZ02Tl7J9dEwbkp5Pa67DcK8+nCOg1/nEuR+s4Mke09Z erns+hN8r1pzBDetA6ZszelEkUNaZwrYHTctiem6U4njANqQWUMdi/ZkMYxBrdNCJLBl rNzq95swZo4vcHZgDym84tluj6grenTyQeOJ0QLOlhJ8tQINiDABBY2qwoTHkfQ5TjlB DVuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qzoXpid0; 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=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ok5-20020a17090b1d4500b002006b213af9si860263pjb.32.2022.10.28.22.19.49; Fri, 28 Oct 2022 22:20:02 -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=@linaro.org header.s=google header.b=qzoXpid0; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229483AbiJ2FQv (ORCPT + 99 others); Sat, 29 Oct 2022 01:16:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbiJ2FQW (ORCPT ); Sat, 29 Oct 2022 01:16:22 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C5C9AF196 for ; Fri, 28 Oct 2022 22:16:05 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d24so6545446pls.4 for ; Fri, 28 Oct 2022 22:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=dpyWOsS0FBSOmnylpOdwOjAVxC2jYFz7gdsUBGPUnb0=; b=qzoXpid0DCIWb2RKt8w0bFIHln3U61B6bnegL/kf56vwhNn+IPJnNLiX2Mubujj/P4 /Ve39fktovVrJt9csGeFLKBuminWK8xrLY+Bfy6A0xh3jMzNAiOcNuEXF4EfQcJAQTra n+A1GyiXoeh4zqTLKeMQmHr1qpmGhEsAI37wq13R6RCWhYWem9t3KnVViOayMYrHjOOE zpnZlCxtQQtsXkJh1OfbcMp6ZWdM8xTRRNZjOeVguSEu1RUQgOFTQ69KaB1gg5BtGbpZ VIqbJfHz46kKTO4OkxjkVkAwdlFMP3GGzZ/UCxXOhL7go4v7LDRQP55GBa7g+spy5tu5 kYSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=dpyWOsS0FBSOmnylpOdwOjAVxC2jYFz7gdsUBGPUnb0=; b=rvXfoAVyQkU8RzUKxgbrAj527coPq+QP9Lqkezn4tmqzsZ2/hpTFBIA0YhFMYydCxt XoMyqCN4DXbgb3AWN+2tSX5az3P0J5Y0/O7lVmNzI72odeq26S/OnnW/mpvirUGkYI4S RSLWzS37NVxZfIHBPJDk/JtkPTHH/5g3LS8XR1yT2MpKLVCmt1oXw4sTzYSUKmUw36XO 0c+fQlDKLDlMivTPKIdMxab0boaAbd4fEeEPUC8uE+T0ZfS6Im1iC8DV62bThi5DLIEc EPsuxQ1h8CnF0wACPVzTSJ7DD9pEvUQXtWh+fpBL4wAqurjB4WttIWWcRdWY61kqd2v4 GSnw== X-Gm-Message-State: ACrzQf3PioG8fIwqJzL8jlURpNM9sTXFGHh08H+9EFgs7jW7SY7fpQeq 0hj9Bf0oWhosgLvi6AFjPjTU X-Received: by 2002:a17:90b:38d1:b0:210:99f9:9712 with SMTP id nn17-20020a17090b38d100b0021099f99712mr20447697pjb.57.1667020565035; Fri, 28 Oct 2022 22:16:05 -0700 (PDT) Received: from localhost.localdomain ([59.92.103.167]) by smtp.gmail.com with ESMTPSA id f5-20020a170902ce8500b0017e9b820a1asm363150plg.100.2022.10.28.22.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 22:16:04 -0700 (PDT) From: Manivannan Sadhasivam To: andersson@kernel.org Cc: konrad.dybcio@somainline.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, johan+linaro@kernel.org, quic_jprakash@quicinc.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, steev@kali.org, Manivannan Sadhasivam Subject: [PATCH v2 12/12] arm64: dts: qcom: sc8280xp-x13s: Add thermal zone support Date: Sat, 29 Oct 2022 10:44:49 +0530 Message-Id: <20221029051449.30678-13-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221029051449.30678-1-manivannan.sadhasivam@linaro.org> References: <20221029051449.30678-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747998005435236747?= X-GMAIL-MSGID: =?utf-8?q?1747998005435236747?= Add thermal zone support by making use of the thermistor SYS_THERM6. Based on experiments, this thermistor seems to reflect the actual surface temperature of the laptop. For the cooling device, all BIG CPU cores are throttle down to keep the temperature at a sane level. Signed-off-by: Manivannan Sadhasivam --- .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index ca77c19c6d0d..96e2fa72f782 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -29,6 +29,52 @@ backlight { pinctrl-0 = <&edp_bl_en>, <&edp_bl_pwm>; }; + thermal-zones { + skin-temp-thermal { + polling-delay-passive = <250>; + polling-delay = <0>; + thermal-sensors = <&pmk8280_adc_tm 5>; + + trips { + skin_temp_alert0: trip-point0 { + temperature = <55000>; + hysteresis = <1000>; + type = "passive"; + }; + + skin_temp_alert1: trip-point1 { + temperature = <58000>; + hysteresis = <1000>; + type = "passive"; + }; + + skin-temp-crit { + temperature = <73000>; + hysteresis = <1000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&skin_temp_alert0>; + cooling-device = <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + + map1 { + trip = <&skin_temp_alert1>; + cooling-device = <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; + vreg_edp_bl: regulator-edp-bl { compatible = "regulator-fixed";