From patchwork Mon Nov 19 12:25:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 151483 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2598089ljp; Mon, 19 Nov 2018 04:25:48 -0800 (PST) X-Google-Smtp-Source: AJdET5diSDGtTHommadQbVeTQ5n3z+uU8dNjjGeTBgtELzTyynFXeoFBpiqO5lxSIOKWySft70c1 X-Received: by 2002:a63:7f4f:: with SMTP id p15mr19979715pgn.296.1542630348254; Mon, 19 Nov 2018 04:25:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542630348; cv=none; d=google.com; s=arc-20160816; b=ji9B8M2aTVTCN6Skzog0clhLgHOJzwt+cL5zp9kMz9yT8mLz7pcGITaC32RRe3BoZQ aZ0p++lBn5hqR/SbhSF0CvzjwK9DuCcpMOGJQJS2dz993fiadsdErAgRqfKfSVXQctZx augNfgoH3Xjfs8eXoLvKqM1MdJwZ2RHyIJLa/em4Lt5VRghgY+R3NWxcJXq4bgeEIk+m 6lpht7Ud6SwGgubm/W4xIzWl6tiZB6+833S6t4PUR/QYEasvn2KNgTi9m2jez4cdIsBP nq59Upj+iQSOZQoMLDhe0MEETM+0/uEmtWJIdy5DcNVvkoS4yt7db7Pt2pbWrqAS8llK nAHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=e94DIEaO20VLtFTPXBdeuigr1I2rzbvph1yIasDBL34=; b=SyCTUnjzRJ89ZGCmRKFoPSqWrWCQVxBmF25XM6e8aE3fRilELaXQwVVbDsYHjr9x6l Ji8D09pj22klskWFu14zOpOTFGnz79GF+so0lPvj8jNxthyEO783/dyMTWRawVEbkGq/ GPJx7U9FSjEh4N35wv7GoU3i6y8kxkeNh9WkXBi90i/ELuAA2RcZzROYswlBQ37vb7Rh UfTw90ujeZHyKLHMVDPa3KG2OAx7bEHrX/Zqf0tkX11ey5fxm0/m0vygYnGvhDAHZjFC lxtdxFp6G4YGESF69dHHhUg8aZgP/Qs/LHAEuVP1/vPkgRqH3pb+vFn52iWgWzY572CI 01tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ey27Y8J2; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5si26787732pgh.422.2018.11.19.04.25.48; Mon, 19 Nov 2018 04:25:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ey27Y8J2; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1728769AbeKSWtP (ORCPT + 15 others); Mon, 19 Nov 2018 17:49:15 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42414 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728579AbeKSWtP (ORCPT ); Mon, 19 Nov 2018 17:49:15 -0500 Received: by mail-wr1-f65.google.com with SMTP id u5-v6so26544432wrn.9 for ; Mon, 19 Nov 2018 04:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=e94DIEaO20VLtFTPXBdeuigr1I2rzbvph1yIasDBL34=; b=Ey27Y8J2YhDE6+lRkH45SC/ejdTI66xX5FYehwkoJNLKYb2WF+BiAYZkU3ZNZXYALm KIk21DyB6303cxBETEvNWE8CyCVt82fCJc0SAI515Ohhw/5xoHhKVCy0UP4lkDSsVY5R jCiuIVulkdgN8ok5R4m/FcpkxJ4p7OGfHnAZA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=e94DIEaO20VLtFTPXBdeuigr1I2rzbvph1yIasDBL34=; b=mqp9SWoZYmaBzgTYkYix2kkJLpuqcsYdmpYWnHnpSzFKtzLJOmIEvnkDYtguOSKWgc XDuUFlvC0/Ym+Bvh4kjkWVUGcbpdPuMPwwim8RIe45diqhb0iqd3AfxkOTOUO/B7wwon hAVKgXPxLxW7g3nUeu6Lv7usHBxqzNVsAD6lkHps0CaY2hvLoIhAt5k8GCy7UVVdh66C iIDXHDOEGyrk3SA1tpxsdvk6AhfX8/Sgtc0wvvig39T4diGr6W51x4jkOaOUeEKU/mgs DGyaU0hdiouRttsTsLSYBMSODxpMysAY1Td75ypl//O7djG300scDCSfwTaKMA2gUaye n1MQ== X-Gm-Message-State: AGRZ1gK60edugLkR9WoDPZXU7/pK4XD0DOmtveG8sOsoxjOBE44Fq0VE vjP82SWKh+VVw+Gs8fyqUiuEGEBMqR8= X-Received: by 2002:a05:6000:1009:: with SMTP id a9mr17527207wrx.271.1542630345269; Mon, 19 Nov 2018 04:25:45 -0800 (PST) Received: from localhost ([49.248.195.80]) by smtp.gmail.com with ESMTPSA id h67-v6sm42241111wma.10.2018.11.19.04.25.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:25:44 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, vkoul@kernel.org, Zhang Rui , Daniel Lezcano , Rob Herring , Mark Rutland Subject: [PATCH v2 1/4] dt: thermal: tsens: Add bindings for qcs404 Date: Mon, 19 Nov 2018 17:55:19 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org qcs404 uses v1 of the TSENS IP block. Create a fallback DT property "qcom,tsens-v1" to gather common code. Signed-off-by: Amit Kucheria Reviewed-by: Vinod Koul Tested-by: Vinod Koul --- Documentation/devicetree/bindings/thermal/qcom-tsens.txt | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt index 1d9e8cf610181..799de30623522 100644 --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt @@ -8,9 +8,12 @@ Required properties: - "qcom,msm8996-tsens" (MSM8996) - "qcom,msm8998-tsens", "qcom,tsens-v2" (MSM8998) - "qcom,sdm845-tsens", "qcom,tsens-v2" (SDM845) + - "qcom,qcs404-tsens", "qcom,tsens-v1" (QCS404) The generic "qcom,tsens-v2" property must be used as a fallback for any SoC with version 2 of the TSENS IP. MSM8996 is the only exception because the generic property did not exist when support was added. + Similarly, the generic "qcom,tsens-v1" property must be used as a fallback for + any SoC with version 1 of the TSENS IP. - reg: Address range of the thermal registers. New platforms containing v2.x.y of the TSENS IP must specify the SROT and TM From patchwork Mon Nov 19 12:25:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 151484 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2598279ljp; Mon, 19 Nov 2018 04:26:01 -0800 (PST) X-Google-Smtp-Source: AJdET5evAda81OXCZCIKY+1E5YhJhvdoGy57k+cbuyh8U84Qfz9/zkMS/+FgEJCAxFqokoIHV7ya X-Received: by 2002:a63:5e43:: with SMTP id s64mr20092307pgb.101.1542630361005; Mon, 19 Nov 2018 04:26:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542630360; cv=none; d=google.com; s=arc-20160816; b=NLcwY5M73LmPNppwWcubj6S7aPo1ul02I0JOYv3pZUJIT0YVJT/kUgqq2/6ewhzsI4 cUiPWDu7xwTqI8hMUWoY0otxwMPnZ63mW/tgXu4fha4UChmI73DFMaJGWTw3WRbzmtHM sJvyOaKfmcpEPlYSy/2nsaK5+BochNspiO8OS1WVP28BIAuGcjADSpmknSRULx7itKbd GPfkyIoqunECYY1CFN0OQjA/YFjdbxGpkVJrdTQ0iimSRLuBXWepWqxH8Sl/2GlMsJIp eKLsW5tMo/NCSLjnFY7dV64LNrD/TEFRH/hm4mL8GAf/DuLyA1DP10PU4W3BuqeqTwAI AD7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=nnvzoqmDkXg2eFCHfa07NLT0wJHaS90+T7q5bDbkcjg=; b=KvXDtqXJJrBf50NZoGpWGp9faQ42kxfKYc+6Hf/rFdxPCuNQeb0wz3BQMq5FfzbhiE S9geG3JoinkrFF/Dpy/17LqpMfrvq+mSS8vJKr6QuxhrvwoCRigQYhtHAptdAZ/84kM5 Aw5Dz5WbppEk+3MtYfKSMM/V+cQOZAkazdeqN5xZnNd/hHl//dJIlM2cByCJyymWbbSF 70yWnYjM4E5NVam5h2OBuNtJL3Tg01OyEaqAozSYVicDBIK0DXahDeEx7SzKWZgN/+P7 KDHO90pikfMxDIUy2DxQp/cperXrisoE0JTv1MsC13qsMUd9Qr5ZLu2dKOY5h/ZGj/cx JMZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZS+gRXN4; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5si26787732pgh.422.2018.11.19.04.26.00; Mon, 19 Nov 2018 04:26:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZS+gRXN4; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1728721AbeKSWt2 (ORCPT + 15 others); Mon, 19 Nov 2018 17:49:28 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:36682 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728747AbeKSWt2 (ORCPT ); Mon, 19 Nov 2018 17:49:28 -0500 Received: by mail-wr1-f68.google.com with SMTP id t3so1632208wrr.3 for ; Mon, 19 Nov 2018 04:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=nnvzoqmDkXg2eFCHfa07NLT0wJHaS90+T7q5bDbkcjg=; b=ZS+gRXN4eCG2s6bbsG8JnInfLj2yZSxw9a3Ygd340t7o6Csu3C/mm2N+66vn2knV8D xyq0fVUVatXNc3oczOwtz5f8pMwfnIBDILBg+CW2Tq3FhfnPNTmV0S/oF2tphl8KGblP ZMKEvSEy0TnFO0ps4x8m0CZ9FEQ9J4wfveNK0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=nnvzoqmDkXg2eFCHfa07NLT0wJHaS90+T7q5bDbkcjg=; b=WXD2pmVgo0PvjqA6RigWnYUmGKOXWUA/jBVB6W3444RGDSQr8CUU/Bt7kDf88yKL7z HsSj5pY0309B8usAAZkHBtFWXfXHU7aEATyBRUx+dm+5S4t53Bdb31u7wfNcjhR4MT2f ziQ5R5SJcAJDmUyCsfnI/IeUyFtAKduUIw3JT1MmsXw6tbru9GtNMg/psvElwgicQVxC Azv7zTzcbLXgPkMc25aqKEOPrmMFQWMwNZ6/e4KJ+okYJ/PNWEkv9CFrslfLuKJvjZKL 3cAOff26g08lBkonwiOc5o+zT9mGcxQixOsGmJ5qm7c6vlhfuUu9+B50M1H8UoFvcOvA 3keA== X-Gm-Message-State: AGRZ1gJ7aT/bSqjUrHBwwqe1H1qlHhEUGN7LTruA7obz3rH+U+8RKtgQ psRFVKxCTjmETVqA2iLLtHZPgw== X-Received: by 2002:adf:fb47:: with SMTP id c7-v6mr17733860wrs.200.1542630357755; Mon, 19 Nov 2018 04:25:57 -0800 (PST) Received: from localhost ([49.248.195.80]) by smtp.gmail.com with ESMTPSA id a204sm5902119wmh.23.2018.11.19.04.25.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:25:57 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, vkoul@kernel.org, Zhang Rui , Daniel Lezcano Subject: [PATCH v2 2/4] drivers: thermal: tsens: Add generic support for TSENS v1 IP Date: Mon, 19 Nov 2018 17:55:20 +0530 Message-Id: <503c279da72905b601f0f66ad6ab74b2affe0265.1542629810.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org qcs404 has a single TSENS IP block with 10 sensors. It uses version 1.4 of the TSENS IP, functionality for which is encapsulated inside qcom,tsens-v1 compatible. Signed-off-by: Amit Kucheria Reviewed-by: Vinod Koul Tested-by: Vinod Koul --- drivers/thermal/qcom/Makefile | 2 +- drivers/thermal/qcom/tsens-v1.c | 196 ++++++++++++++++++++++++++++++++ drivers/thermal/qcom/tsens.c | 3 + drivers/thermal/qcom/tsens.h | 2 +- 4 files changed, 201 insertions(+), 2 deletions(-) create mode 100644 drivers/thermal/qcom/tsens-v1.c -- 2.17.1 diff --git a/drivers/thermal/qcom/Makefile b/drivers/thermal/qcom/Makefile index a821929ede0bd..60269ee90c434 100644 --- a/drivers/thermal/qcom/Makefile +++ b/drivers/thermal/qcom/Makefile @@ -1,2 +1,2 @@ obj-$(CONFIG_QCOM_TSENS) += qcom_tsens.o -qcom_tsens-y += tsens.o tsens-common.o tsens-8916.o tsens-8974.o tsens-8960.o tsens-v2.o +qcom_tsens-y += tsens.o tsens-common.o tsens-8916.o tsens-8974.o tsens-8960.o tsens-v2.o tsens-v1.o diff --git a/drivers/thermal/qcom/tsens-v1.c b/drivers/thermal/qcom/tsens-v1.c new file mode 100644 index 0000000000000..00186b2f82808 --- /dev/null +++ b/drivers/thermal/qcom/tsens-v1.c @@ -0,0 +1,196 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2018, Linaro Limited + */ + +#include +#include +#include "tsens.h" + +/* eeprom layout data for qcs404 (v1) */ +#define BASE0_MASK 0x000007f8 +#define BASE1_MASK 0x0007f800 +#define BASE0_SHIFT 3 +#define BASE1_SHIFT 11 + +#define S0_P1_MASK 0x0000003f +#define S1_P1_MASK 0x0003f000 +#define S2_P1_MASK 0x3f000000 +#define S3_P1_MASK 0x000003f0 +#define S4_P1_MASK 0x003f0000 +#define S5_P1_MASK 0x0000003f +#define S6_P1_MASK 0x0003f000 +#define S7_P1_MASK 0x3f000000 +#define S8_P1_MASK 0x000003f0 +#define S9_P1_MASK 0x003f0000 + +#define S0_P2_MASK 0x00000fc0 +#define S1_P2_MASK 0x00fc0000 +#define S2_P2_MASK_1_0 0xc0000000 +#define S2_P2_MASK_5_2 0x0000000f +#define S3_P2_MASK 0x0000fc00 +#define S4_P2_MASK 0x0fc00000 +#define S5_P2_MASK 0x00000fc0 +#define S6_P2_MASK 0x00fc0000 +#define S7_P2_MASK_1_0 0xc0000000 +#define S7_P2_MASK_5_2 0x0000000f +#define S8_P2_MASK 0x0000fc00 +#define S9_P2_MASK 0x0fc00000 + +#define S0_P1_SHIFT 0 +#define S0_P2_SHIFT 6 +#define S1_P1_SHIFT 12 +#define S1_P2_SHIFT 18 +#define S2_P1_SHIFT 24 +#define S2_P2_SHIFT_1_0 30 + +#define S2_P2_SHIFT_5_2 0 +#define S3_P1_SHIFT 4 +#define S3_P2_SHIFT 10 +#define S4_P1_SHIFT 16 +#define S4_P2_SHIFT 22 + +#define S5_P1_SHIFT 0 +#define S5_P2_SHIFT 6 +#define S6_P1_SHIFT 12 +#define S6_P2_SHIFT 18 +#define S7_P1_SHIFT 24 +#define S7_P2_SHIFT_1_0 30 + +#define S7_P2_SHIFT_5_2 0 +#define S8_P1_SHIFT 4 +#define S8_P2_SHIFT 10 +#define S9_P1_SHIFT 16 +#define S9_P2_SHIFT 22 + +#define CAL_SEL_MASK 7 +#define CAL_SEL_SHIFT 0 + +static int calibrate_v1(struct tsens_device *tmdev) +{ + u32 base0 = 0, base1 = 0; + u32 p1[10], p2[10]; + u32 mode = 0, lsb = 0, msb = 0; + u32 *qfprom_cdata; + int i; + + qfprom_cdata = (u32 *)qfprom_read(tmdev->dev, "calib"); + if (IS_ERR(qfprom_cdata)) + return PTR_ERR(qfprom_cdata); + + mode = (qfprom_cdata[4] & CAL_SEL_MASK) >> CAL_SEL_SHIFT; + dev_dbg(tmdev->dev, "calibration mode is %d\n", mode); + + switch (mode) { + case TWO_PT_CALIB: + base1 = (qfprom_cdata[4] & BASE1_MASK) >> BASE1_SHIFT; + p2[0] = (qfprom_cdata[0] & S0_P2_MASK) >> S0_P2_SHIFT; + p2[1] = (qfprom_cdata[0] & S1_P2_MASK) >> S1_P2_SHIFT; + /* This value is split over two registers, 2 bits and 4 bits */ + lsb = (qfprom_cdata[0] & S2_P2_MASK_1_0) >> S2_P2_SHIFT_1_0; + msb = (qfprom_cdata[1] & S2_P2_MASK_5_2) >> S2_P2_SHIFT_5_2; + p2[2] = msb << 2 | lsb; + p2[3] = (qfprom_cdata[1] & S3_P2_MASK) >> S3_P2_SHIFT; + p2[4] = (qfprom_cdata[1] & S4_P2_MASK) >> S4_P2_SHIFT; + p2[5] = (qfprom_cdata[2] & S5_P2_MASK) >> S5_P2_SHIFT; + p2[6] = (qfprom_cdata[2] & S6_P2_MASK) >> S6_P2_SHIFT; + /* This value is split over two registers, 2 bits and 4 bits */ + lsb = (qfprom_cdata[2] & S7_P2_MASK_1_0) >> S7_P2_SHIFT_1_0; + msb = (qfprom_cdata[3] & S7_P2_MASK_5_2) >> S7_P2_SHIFT_5_2; + p2[7] = msb << 2 | lsb; + p2[8] = (qfprom_cdata[3] & S8_P2_MASK) >> S8_P2_SHIFT; + p2[9] = (qfprom_cdata[3] & S9_P2_MASK) >> S9_P2_SHIFT; + for (i = 0; i < tmdev->num_sensors; i++) + p2[i] = ((base1 + p2[i]) << 2); + /* Fall through */ + case ONE_PT_CALIB2: + base0 = (qfprom_cdata[4] & BASE0_MASK) >> BASE0_SHIFT; + p1[0] = (qfprom_cdata[0] & S0_P1_MASK) >> S0_P1_SHIFT; + p1[1] = (qfprom_cdata[0] & S1_P1_MASK) >> S1_P1_SHIFT; + p1[2] = (qfprom_cdata[0] & S2_P1_MASK) >> S2_P1_SHIFT; + p1[3] = (qfprom_cdata[1] & S3_P1_MASK) >> S3_P1_SHIFT; + p1[4] = (qfprom_cdata[1] & S4_P1_MASK) >> S4_P1_SHIFT; + p1[5] = (qfprom_cdata[2] & S5_P1_MASK) >> S5_P1_SHIFT; + p1[6] = (qfprom_cdata[2] & S6_P1_MASK) >> S6_P1_SHIFT; + p1[7] = (qfprom_cdata[2] & S7_P1_MASK) >> S7_P1_SHIFT; + p1[8] = (qfprom_cdata[3] & S8_P1_MASK) >> S8_P1_SHIFT; + p1[9] = (qfprom_cdata[3] & S9_P1_MASK) >> S9_P1_SHIFT; + for (i = 0; i < tmdev->num_sensors; i++) + p1[i] = (((base0) + p1[i]) << 2); + break; + default: + for (i = 0; i < tmdev->num_sensors; i++) { + p1[i] = 500; + p2[i] = 780; + } + break; + } + + compute_intercept_slope(tmdev, p1, p2, mode); + + return 0; +} + +#define STATUS_OFFSET 0x44 +#define LAST_TEMP_MASK 0x3ff +#define STATUS_VALID_BIT BIT(14) + +static int get_temp_tsens_v1(struct tsens_device *tmdev, int id, int *temp) +{ + struct tsens_sensor *s = &tmdev->sensor[id]; + u32 code; + unsigned int status_reg; + u32 last_temp = 0, last_temp2 = 0, last_temp3 = 0; + int ret; + + status_reg = tmdev->tm_offset + STATUS_OFFSET + s->hw_id * 4; + ret = regmap_read(tmdev->tm_map, status_reg, &code); + if (ret) + return ret; + last_temp = code & LAST_TEMP_MASK; + if (code & STATUS_VALID_BIT) + goto done; + + /* Try a second time */ + ret = regmap_read(tmdev->tm_map, status_reg, &code); + if (ret) + return ret; + if (code & STATUS_VALID_BIT) { + last_temp = code & LAST_TEMP_MASK; + goto done; + } else { + last_temp2 = code & LAST_TEMP_MASK; + } + + /* Try a third/last time */ + ret = regmap_read(tmdev->tm_map, status_reg, &code); + if (ret) + return ret; + if (code & STATUS_VALID_BIT) { + last_temp = code & LAST_TEMP_MASK; + goto done; + } else { + last_temp3 = code & LAST_TEMP_MASK; + } + + if (last_temp == last_temp2) + last_temp = last_temp2; + else if (last_temp2 == last_temp3) + last_temp = last_temp3; +done: + /* Convert temperature from deciCelsius to milliCelsius */ + *temp = sign_extend32(last_temp, fls(LAST_TEMP_MASK) - 1) * 100; + + return 0; +} + +static const struct tsens_ops ops_generic_v1 = { + .init = init_common, + .calibrate = calibrate_v1, + .get_temp = get_temp_tsens_v1, +}; + +const struct tsens_data data_tsens_v1 = { + .ops = &ops_generic_v1, + .reg_offsets = { [SROT_CTRL_OFFSET] = 0x4 }, +}; diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index f1ec9bbe4717e..d0cc0c09894a9 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -63,6 +63,9 @@ static const struct of_device_id tsens_table[] = { }, { .compatible = "qcom,msm8996-tsens", .data = &data_8996, + }, { + .compatible = "qcom,tsens-v1", + .data = &data_tsens_v1, }, { .compatible = "qcom,tsens-v2", .data = &data_tsens_v2, diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 7b7feee5dc463..7060c22ea611b 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -92,7 +92,7 @@ int init_common(struct tsens_device *); int get_temp_common(struct tsens_device *, int, int *); /* TSENS v1 targets */ -extern const struct tsens_data data_8916, data_8974, data_8960; +extern const struct tsens_data data_8916, data_8974, data_8960, data_tsens_v1; /* TSENS v2 targets */ extern const struct tsens_data data_8996, data_tsens_v2; From patchwork Mon Nov 19 12:25:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 151485 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2598377ljp; Mon, 19 Nov 2018 04:26:07 -0800 (PST) X-Google-Smtp-Source: AJdET5d0LwDL2+1ulBm7bHmVviD8+MmI1Ss82Mg34u4SDrOLk4U9z33rLQN8CX2om+0/qKK2gb4o X-Received: by 2002:a17:902:24c:: with SMTP id 70-v6mr21435888plc.120.1542630366964; Mon, 19 Nov 2018 04:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542630366; cv=none; d=google.com; s=arc-20160816; b=jNjStYJFws177Y8jqGyC5gJ8SUqx5bHd+1rNeHU0mHoLDCAfxSJZi6DYxkSJRBQlUY CNGBrpfLvUp+TKtD74JxoO3YWTdVEc8UFmBs4BwV5rOcfeOlx+/gHHVq87E52gK3M4Cx T3IW56NINYWE0bNpEV9NFZB3IeKuU+AsxV4xLHJPaLvh7n1b4pmURAy5TpqZylhJiwlv TXP7TIpk0NaRHiQ8UlZut1+fu4xsrkYcBCzWk0UCpar/9OtLuEQumwd9SroB3nORXBck vn8gL0fWbzMPp7a9ec5xOdMBqFiEUcKM09uYG+K8ykw2i6/SjBGbx/Efrj/ApWa2sGBE v/9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=vbujpZlR3xwCQtHN+6i4d1gyZCoKcwoCzl86pAegAMo=; b=qpT2B9YlrXkjxMZJa4QCALk7mljgIU3xirLSVHDjbVc0ngTpgTPIk7Tq3SB65T35fv eoSE/HEczptPB2Ynzr1PjLCe4QMNvqPXA+r1ec9nA0P3/Hz1ELaDtvAOJBdxhFWjqDwo oyOY4BGsa8wQGeZaJafXacYx0SDaVTuyVC7nECG/N0ZgGM/jj3OhFGLuB69MLcgC9YOS yKSu4kuP3yRm8EbiiPCYmPyTir3cOcOGyTz+UFJ25TkBEDr/fh6PUcqzrdbodysuE8/V 93ydgoVVap65hR/9cz7nAKYI5vvXGLQADnGC8luKzUo1HD982pBHRL0mnP39i3NJBRD+ tjHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="G/8MFWFL"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r71-v6si20639647pfc.253.2018.11.19.04.26.06; Mon, 19 Nov 2018 04:26:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="G/8MFWFL"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1728853AbeKSWte (ORCPT + 15 others); Mon, 19 Nov 2018 17:49:34 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39225 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728782AbeKSWte (ORCPT ); Mon, 19 Nov 2018 17:49:34 -0500 Received: by mail-wr1-f67.google.com with SMTP id b13so31812883wrx.6 for ; Mon, 19 Nov 2018 04:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=vbujpZlR3xwCQtHN+6i4d1gyZCoKcwoCzl86pAegAMo=; b=G/8MFWFL/2b/pz78l1CvrUfCvTR63oUZyGVoJDnd4pU0iEETt3KEAIlDSYGzANK6td t/iNHC9qBHA5qlFYMe/gBF7qmX6LhFWfb8wjR0X9PPOgRlYSzX8pOPt9gCDYDufbFxal mM+QOUyUqOHj9uETDRP9NYe/UBH5Li2LC9KT4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=vbujpZlR3xwCQtHN+6i4d1gyZCoKcwoCzl86pAegAMo=; b=jRG0XMqjA4VCwycKwUFtLLCm0/lJByxnV14sTZ49P8/wRGhStvMHXNMxBJOCUjIofJ FzQWWYhYGQ9JASteFImBoGnxQILBHWMO12C2RnqNhpkZRfpRIvfvH/bR0mdJ/lZPclzM oJPNdmHvNzSU0UfG/SF+ezGwM+9avaI7Vkz93WBpoOoZ48n+/NDTemRRUg3weJPy1hPo 33tTzsCh0fzGyXj1unYkoJKxpf/XCJULd52G247vJ3V660GSMg1B7JTM4JOULKvpFuvr Uu1KAlgB87vk0nC/lnWSaGoD811AjklN0OcsahhuWJmr4Pbm/rzJga9bcRRBQltuAfiX M1DA== X-Gm-Message-State: AGRZ1gLObwIQ8sKg0yHcqHkSC10wKJjOLQaHz1/d3L35dV4jNALSvIeB Zy0n2CIS5qyqI4rbcEpMdMJziQ== X-Received: by 2002:adf:df0a:: with SMTP id y10-v6mr18346814wrl.127.1542630364278; Mon, 19 Nov 2018 04:26:04 -0800 (PST) Received: from localhost ([49.248.195.80]) by smtp.gmail.com with ESMTPSA id u8-v6sm27063818wrr.33.2018.11.19.04.26.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:26:03 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, vkoul@kernel.org, David Brown , Rob Herring , Mark Rutland Subject: [PATCH v2 3/4] arm64: dts: qcom: qcs404: Add tsens controller Date: Mon, 19 Nov 2018 17:55:21 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org qcs404 has a single TSENS IP block with 10 sensors. The calibration data is stored in an eeprom (qfprom) that is accessed through the nvmem framework. We add the qfprom node to allow the tsens sensors to be calibrated correctly. Signed-off-by: Amit Kucheria Reviewed-by: Vinod Koul Tested-by: Vinod Koul --- arch/arm64/boot/dts/qcom/qcs404.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.17.1 diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi index 9b5c16562bbe4..57d14d8f0c901 100644 --- a/arch/arm64/boot/dts/qcom/qcs404.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi @@ -253,6 +253,16 @@ reg = <0x00060000 0x6000>; }; + qfprom: qfprom@a4000 { + compatible = "qcom,qfprom"; + reg = <0x000a4000 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + tsens_caldata: caldata@d0 { + reg = <0x1f8 0x14>; + }; + }; + rng: rng@e3000 { compatible = "qcom,prng-ee"; reg = <0x000e3000 0x1000>; @@ -260,6 +270,16 @@ clock-names = "core"; }; + tsens: thermal-sensor@4a9000 { + compatible = "qcom,qcs404-tsens", "qcom,tsens-v1"; + reg = <0x004a9000 0x1000>, /* TM */ + <0x004a8000 0x1000>; /* SROT */ + nvmem-cells = <&tsens_caldata>; + nvmem-cell-names = "calib"; + #qcom,sensors = <10>; + #thermal-sensor-cells = <1>; + }; + tlmm: pinctrl@1000000 { compatible = "qcom,qcs404-pinctrl"; reg = <0x01000000 0x200000>, From patchwork Mon Nov 19 12:25:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 151486 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2598535ljp; Mon, 19 Nov 2018 04:26:17 -0800 (PST) X-Google-Smtp-Source: AJdET5d7smrSKDWlCIKC+CUCdLe8ppgjtueG+FueZQrJcEIurt+Zg5FM3NxXo3+MjT6kfalVM3po X-Received: by 2002:a63:a41:: with SMTP id z1mr19871924pgk.117.1542630376997; Mon, 19 Nov 2018 04:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542630376; cv=none; d=google.com; s=arc-20160816; b=ZOaERxWo3YNE6fnPx+0/WS6Wca9jmvRxFUthF2VRELtncp6BQs1MrqAnzLtaeO2gEl 23RJXoLwCcXAe8v3HFZLc40xnxhkkL+BEPTKOspHPyFXDku1TjgHACrkNzpGBZcIItgu ePKno8G5ODMh3wvljkJWEUUHcTh8abjaGn8iKOSjQ46fjEzTOYN47VpmbN9m4fkSPYXr 4ovJv5fbDI8WFX2SsvqLhHNXSJ4Eu+/M/q9YMzs8CkcRwO2VhWi94+2He/KCVAkAQRep QW7gIM0iJluo/DEgVUnWEeS90ybGidYKv//f/87eMfqYPo+qNBTxUTWYlWFUFlVHr/Do A3jQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=RWlU1LSwFAx6oov/bJmjYlsstO2SymtzOQNbuVyVIRA=; b=qpcobA3rGJsmySXUCezz51GhLQUQUmlWg+4osswsiSWvJwOdcBa4IwDciPc90bwUF0 wW5ioEvu04vEXWl5tHiyzriOXfSiUMRNEEbtQY8QcQ6d0lpP04DK/8dxl/srcLm/93ZL JNYdSOkqaghmqQZ31BOX4yrFbRECFQ3HJPE+0DVUS24rMkDQ43EDG4l9icpo1RH/JaJR yZNjSve4zs9S/jezEd/u6BTOoJN8tDOwNPfJmZ0UvY8GKe8+av08z/06ivj2iL6bFK1+ jrhPK7jO85r+XfbZoXouusclllsdnLogK5YXy2jirV6nzfgckOwoehGv0Cj5uVShnlOh Lw5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WKSXXSG+; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb1si17532949plb.37.2018.11.19.04.26.16; Mon, 19 Nov 2018 04:26:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WKSXXSG+; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1728877AbeKSWto (ORCPT + 15 others); Mon, 19 Nov 2018 17:49:44 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52028 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728829AbeKSWto (ORCPT ); Mon, 19 Nov 2018 17:49:44 -0500 Received: by mail-wm1-f67.google.com with SMTP id w7-v6so5116360wmc.1 for ; Mon, 19 Nov 2018 04:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=RWlU1LSwFAx6oov/bJmjYlsstO2SymtzOQNbuVyVIRA=; b=WKSXXSG+em8s0+pLK1Y9+pBR6bqDlIlElS09l0Y8J67kJa55X0C6kUKW/3mLQJeIy9 52tbFT5/+fzxq/xerKyo3KLt2EvBMmFc3wKfuCz9VjL1KBIRT5lrtsvRznITCWchcHTE u81HPdUeNo6LKBfm6FvzAEc1amCjIQr9jU8G0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=RWlU1LSwFAx6oov/bJmjYlsstO2SymtzOQNbuVyVIRA=; b=AFtvZLSmpjpl52kcCOyt1+uESSqJs2cd1GduDJ8GrFxgarqj8cLhojymuLVr57LMOn fYn2zY6mjUh8cUfJQribnU/BOS4zRqSIfdUTfiTvx+GpcFIdkA7exhaXCeEtuTWUdCu3 YZh/ko6C6rHQEgfAMW2JnLe3C0GLpl+S1f2sdqonI0VNUwvzIvjYNlRnVzanjUF8vn6g M8V++hEPIcoLa8EpWznZymzzhvkzc0iebe1Yu1htUwMlv8yzJ7PWKRmQRxDVTEpvdtKt ad8tA1IoYFf1gwM5VHjkGauUF6mq8AIekaJRi70OE+0C24PxbkSAguKPHZwyhSVNcWis 2H1Q== X-Gm-Message-State: AGRZ1gKMKvGd2ZsgqvlmRTzZaMn5QHmgjicO4HOWBEUMtqtFMejo3Vzy zTm4yD/yWYyhu6Jkcw0PXoo2GQ== X-Received: by 2002:a1c:7d54:: with SMTP id y81mr6913645wmc.106.1542630373963; Mon, 19 Nov 2018 04:26:13 -0800 (PST) Received: from localhost ([49.248.195.80]) by smtp.gmail.com with ESMTPSA id a18-v6sm35058384wrt.79.2018.11.19.04.26.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Nov 2018 04:26:13 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, vkoul@kernel.org, David Brown , Rob Herring , Mark Rutland Subject: [PATCH v2 4/4] arm64: dts: qcom: qcs404: Add thermal zones for each sensor Date: Mon, 19 Nov 2018 17:55:22 +0530 Message-Id: <4c95177d5454421fb789cb67da94181af2a0370d.1542629810.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org qcs404 has 10 sensors connected to the single TSENS IP. Define a thermal zone for each of those sensors to expose the temperature of each zone. Signed-off-by: Amit Kucheria Reviewed-by: Vinod Koul Tested-by: Vinod Koul --- arch/arm64/boot/dts/qcom/qcs404.dtsi | 206 +++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) -- 2.17.1 diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi index 57d14d8f0c901..cbc3fd3788938 100644 --- a/arch/arm64/boot/dts/qcom/qcs404.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi @@ -30,6 +30,7 @@ reg = <0x100>; enable-method = "psci"; next-level-cache = <&L2_0>; + #cooling-cells= <2>; }; CPU1: cpu@101 { @@ -38,6 +39,7 @@ reg = <0x101>; enable-method = "psci"; next-level-cache = <&L2_0>; + #cooling-cells= <2>; }; CPU2: cpu@102 { @@ -46,6 +48,7 @@ reg = <0x102>; enable-method = "psci"; next-level-cache = <&L2_0>; + #cooling-cells= <2>; }; CPU3: cpu@103 { @@ -54,6 +57,7 @@ reg = <0x103>; enable-method = "psci"; next-level-cache = <&L2_0>; + #cooling-cells= <2>; }; L2_0: l2-cache { @@ -507,4 +511,206 @@ #interrupt-cells = <2>; }; }; + + thermal-zones { + aoss-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 0>; + + trips { + aoss_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + aoss_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + dsp-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 1>; + + trips { + dsp_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + dsp_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + lpass-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 2>; + + trips { + lpass_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + lpass_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + wlan-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 3>; + + trips { + wlan_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + wlan_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cluster-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 4>; + + trips { + cluster_alert: cluster_alert { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cluster_crit: cluster_crit { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu-thermal0 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 5>; + + trips { + cpu_alert0: cpu_alert0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit0: cpu_crit0 { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu-thermal1 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 6>; + + trips { + cpu_alert1: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit1: trip1 { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu-thermal2 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 7>; + + trips { + cpu_alert2: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit2: trip1 { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + cpu-thermal3 { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 8>; + + trips { + cpu_alert3: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + cpu_crit3: trip1 { + temperature = <110000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + + gpu-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + + thermal-sensors = <&tsens 9>; + + trips { + gpu_alert: trip0 { + temperature = <75000>; + hysteresis = <2000>; + type = "passive"; + }; + gpu_crit: trip1 { + temperature = <95000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + }; + }; };