Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp179497imm; Tue, 17 Jul 2018 23:44:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf5JPVl1od6/UWUpzzTYYeO+7+2VtuqRlpw0lvTIBxU2wWt78P03ODZuUd4W9FIyp7S3QTL X-Received: by 2002:a63:6d8b:: with SMTP id i133-v6mr4641964pgc.215.1531896297237; Tue, 17 Jul 2018 23:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531896297; cv=none; d=google.com; s=arc-20160816; b=ZJ5WJjaMWPJGKb46a9F0FrAmGQOH6l5mtw1Mwr56Sq42ljkqEHA+IAjbyDdatIvwnq O3JY9CctKC9IuznBZKzf5ZCHh/amQOOkcMxCST9lxB7Auiybm1XiT+K92sBo7Jounap6 p5Ahk/wLkPZT99bKqN7baXqc/uPdFbsshXKf6VQlYNLA1Pj4qOcrtTffrcRxi9nQ5Wha qqPwdkDbf3ySOSmlgS5PzxE5mr1HEXP3Owfk2qUzdYO0a8kyXC7WBduOZ4BxmEPNmyoh j/WyPp87jpudwhOIpv8S2qx3Xl5BXtwvBsz+upB0t1YOyYIPsnijQtrjpXYz8DFw0wN+ lA8g== 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 :arc-authentication-results; bh=AQma1INj9PDjYURj+rLLqne78i7V0ruv9qs3xa+leU0=; b=gVGOk5CHkFl1Ra0pE6pmKnGEgBHPHfTnVQhuFlgS1WvAQPoe6dXjyRi5pKXjgnP2rt taWFDCmOAXvzne4wuwuTH8O1R74uc8iHWfeXrczE8MUqJunbJg8GvXhuah1/fMAjcAEa bJWfNCkXQ0njaskvnolYfaU+8PwYNInkcd7XY7AM0EBkR6sUiYWWShV9vIUsZfvCJvLt MpVqnCWNeNRgIUhpuuDaoRhM9fZ3ZtOF+3jhiQzXF5cnFdW577p2CVE0ZUi2i6eQKQP0 nkO0QtkJ1snalDpBhM3SiPC1JkTmga/8HDxFyPsUou0bBBTwFQpSk77o/oy4Cin83I86 AY3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dPM4VirE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 q5-v6si2558723pgn.95.2018.07.17.23.44.42; Tue, 17 Jul 2018 23:44:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=dPM4VirE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1729185AbeGRHUJ (ORCPT + 99 others); Wed, 18 Jul 2018 03:20:09 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39459 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729058AbeGRHUI (ORCPT ); Wed, 18 Jul 2018 03:20:08 -0400 Received: by mail-wr1-f66.google.com with SMTP id h10-v6so3422817wre.6 for ; Tue, 17 Jul 2018 23:43:49 -0700 (PDT) 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=AQma1INj9PDjYURj+rLLqne78i7V0ruv9qs3xa+leU0=; b=dPM4VirE34Z7s4dwJRj6na8ombwtmojaSITUtP+xGLiG5SNgYZCLlzxjRhmZX6ZhlX aGsgbCBzQw5ds2xPHDlOuouUGAQrTgqU+ZHrABjcYVM8aYXjy0dWLY5VLk99oQS5JB/F ifGkQS+LB7YGbEsgF6Q1CfbhGJDJifwUVgBkI= 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=AQma1INj9PDjYURj+rLLqne78i7V0ruv9qs3xa+leU0=; b=S/fdyw8Ni/Gqj0am1WZh5bTJFQGUT1dU8V4wSj6TfUf9yTFIzV+STpZOB4p0lMYeW5 G6qD5mmGdbZ2pq8FFyyAaMBKq+0MxlJifzsU+YllzUIJ3RHo0Aks0wTMcn7P8tsdTGWz R1VUx8m2fcwPGBWO2kIMWxcpFij/U7KN1E7Z6dvCEUQwXhgk5RAriQWC1mlP8MUMfFZR Wp4y0hWi7mG//Kf1H38zs+3u0T/YtM+LBXjv8Qlnwgc5LG6vH5mtnIziFB4R03fMb4Y8 4ZO8TNCw+8DnVVB4Ou/7jUS4kqW11pvtAy5xYcvrnuQ7a5375YyMYWPIzfOMVPYfxuap sz6A== X-Gm-Message-State: AOUpUlFbSgO/klffF5/e2y4alrJnjC12EAtEZX2uP85m2J51rde36oKf jPYgJovc2t/JfyVSFqEEz3t2EHj67jc= X-Received: by 2002:adf:8b01:: with SMTP id n1-v6mr3500964wra.282.1531896229031; Tue, 17 Jul 2018 23:43:49 -0700 (PDT) Received: from localhost ([103.249.91.115]) by smtp.gmail.com with ESMTPSA id y102-v6sm2544665wmh.9.2018.07.17.23.43.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jul 2018 23:43:48 -0700 (PDT) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, smohanad@codeaurora.org, vivek.gautam@codeaurora.org, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v8 2/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP Date: Wed, 18 Jul 2018 12:13:08 +0530 Message-Id: <842b6fb711b9be401a0b3fdb2827dcb8980699b2.1531895128.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We want to create common code for v2 of the TSENS IP block that is used in a large number of Qualcomm SoCs. "qcom,tsens-v2" should be able to handle most of the common functionality start with a common get_temp() function. It is also necessary to split out the memory regions for the TM and SROT register banks because their offsets are not constant across SoC families. Signed-off-by: Amit Kucheria Reviewed-by: Rob Herring Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- .../devicetree/bindings/thermal/qcom-tsens.txt | 31 +++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt index 06195e8..1d9e8cf 100644 --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt @@ -1,18 +1,28 @@ * QCOM SoC Temperature Sensor (TSENS) Required properties: -- compatible : - - "qcom,msm8916-tsens" : For 8916 Family of SoCs - - "qcom,msm8974-tsens" : For 8974 Family of SoCs - - "qcom,msm8996-tsens" : For 8996 Family of SoCs +- compatible: + Must be one of the following: + - "qcom,msm8916-tsens" (MSM8916) + - "qcom,msm8974-tsens" (MSM8974) + - "qcom,msm8996-tsens" (MSM8996) + - "qcom,msm8998-tsens", "qcom,tsens-v2" (MSM8998) + - "qcom,sdm845-tsens", "qcom,tsens-v2" (SDM845) + 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. + +- reg: Address range of the thermal registers. + New platforms containing v2.x.y of the TSENS IP must specify the SROT and TM + register spaces separately, with order being TM before SROT. + See Example 2, below. -- reg: Address range of the thermal registers - #thermal-sensor-cells : Should be 1. See ./thermal.txt for a description. - #qcom,sensors: Number of sensors in tsens block - Refer to Documentation/devicetree/bindings/nvmem/nvmem.txt to know how to specify nvmem cells -Example: +Example 1 (legacy support before a fallback tsens-v2 property was introduced): tsens: thermal-sensor@900000 { compatible = "qcom,msm8916-tsens"; reg = <0x4a8000 0x2000>; @@ -20,3 +30,12 @@ tsens: thermal-sensor@900000 { nvmem-cell-names = "caldata", "calsel"; #thermal-sensor-cells = <1>; }; + +Example 2 (for any platform containing v2 of the TSENS IP): +tsens0: thermal-sensor@c263000 { + compatible = "qcom,sdm845-tsens", "qcom,tsens-v2"; + reg = <0xc263000 0x1ff>, /* TM */ + <0xc222000 0x1ff>; /* SROT */ + #qcom,sensors = <13>; + #thermal-sensor-cells = <1>; + }; -- 2.7.4