From patchwork Thu Jul 12 08:39:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 141805 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1242251ljj; Thu, 12 Jul 2018 01:40:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpckHz5iwvRp33uPJv52DCd4IV9PohC/qws6a6VwPJLYI8qkV61e2iqeKSyKi6fH362D+LF5 X-Received: by 2002:a17:902:4424:: with SMTP id k33-v6mr1289041pld.242.1531384818679; Thu, 12 Jul 2018 01:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531384818; cv=none; d=google.com; s=arc-20160816; b=yL/Jfjmzyx0pxiGgPgJQARVb8nBsJjsmqC5Qbz+KSuTrPtPEzIHS1glNd7ervIWZUk UC4gNbbm4vCM0q+L3+QH/a2Vb5/QeY/1YK7nw81Quv8GYJ5rTpVVB+3PFw68CtN3FWWd gq2iMwqoEECGRG+41KB5kkQar18t6wrCiqIbGFFL8A8iVCFjCf2HM9QY0CR1jh092zaP ORJVWAV1kAsiWBIFhx/K4oGtB8UMyo5/PDlZ+3hfvcw3wqevmB/Vhw9CI7m/2MgSbtDn s72sdm4K+CYOwsgcxalXxd4RDdZjwlfgg3hJieUNfgZaC9MYOctPG8gATFkrzuq+nE9q qbxw== 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=87wSDx+vexmmWqL1OtxaD1UAffFBwrzG1X9ioY0ysh8=; b=GLHqJlLVMe2dY0354wXhZsA9Ad8YkqDz6ehqCPYvoxkiw0v9/fDZIVQ+6E3tacgDQn VC+ZqsU+tikK82IdO4zXix1QnE4uKmJBCaqhtDwnKpPxOfljoMi/iWOs9fD2XoQfs2D2 +i2PTKL7aiQhWoDdz2JPaiUsaNWbeeMEv5H0fMtO1pdZXLeExF2IFWynefvfKHe2+Hw/ YzNfkmi/F5Nz6m7UXff99oNGfU3mpW6eg8uWeXqQ84hsjNKr6jmUDUjj3aLwqBZ1udxN 0J6ZzMdxo98UTm3/BoHWqyyzXrp7MvmYhyelMS8KiyaPZjiYuYa9KmuwZnPc/xT5Bbc4 9HOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XpPlh2nm; 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=fail (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 b23-v6si20420837pls.341.2018.07.12.01.40.18; Thu, 12 Jul 2018 01:40:18 -0700 (PDT) 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=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XpPlh2nm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732510AbeGLIsw (ORCPT + 13 others); Thu, 12 Jul 2018 04:48:52 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38322 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726474AbeGLIsv (ORCPT ); Thu, 12 Jul 2018 04:48:51 -0400 Received: by mail-wr1-f65.google.com with SMTP id m1-v6so8073942wrg.5 for ; Thu, 12 Jul 2018 01:40:16 -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=Z/Epa84MInFKAspg0c1M9qw1LPPX0QzXvaRtMaKoXvI=; b=XpPlh2nmPQe9Q1iTS+L3nE04p1J3EeifQ+V0qTbLqfghrjK2wryGCzAzc9wtDIJc6+ +z8k+XImaeGz7SnyswlG4azQ3HB20Hw/zigxdcvDZw0W2XZ5Sc27tn87ZOXhbhATbn2H 4auyTxKM3TkZWTT9tYjkyyMdIflDwYzxekBtw= 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=Z/Epa84MInFKAspg0c1M9qw1LPPX0QzXvaRtMaKoXvI=; b=pmF2m/Y1CB7LP5BGOn3P3oFgChxR60kGAplky7cDMFglIdUBCooi/w0K56AnEYWz3R MT/ZvVbJa0m3o4OhAEeiTTtXWNlVxFoHBgGz9j1Sd3OKEfHW4lBAEjMouxhl3YNxvUik 84zglQYJUBTp45RAjlTXzs9GEhNdGRjsvdV/S/sQ8jybT4L2JM4vGYsFkkP2Ugcaiw7I H3HH+xhrlzprLPMwxdcQquA/IZvDLByamL9nmbrplp5SLF5ZJgSALT4iXfwZTKb96bkz k/Uvvp+klO5jwiq9JEJqxExOEvePva0+X8a4ZrY6hzZESwCkyH+tcMre6/op+1s8zMgr ApBA== X-Gm-Message-State: AOUpUlG1cH5k7YTF/QgGgtksiqqCDS3piMTxHvJxvHSDqETvNcDzuPPc crwXGo1ltwfOzOnQHDjiWvhZ5Q== X-Received: by 2002:adf:9d46:: with SMTP id o6-v6mr973758wre.51.1531384815812; Thu, 12 Jul 2018 01:40:15 -0700 (PDT) Received: from localhost ([103.249.91.93]) by smtp.gmail.com with ESMTPSA id y203-v6sm5760396wme.42.2018.07.12.01.40.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 01:40:15 -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 v7 5/7] dt: thermal: tsens: Document the fallback DT property for v2 of TSENS IP Date: Thu, 12 Jul 2018 14:09:06 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 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 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 --- .../devicetree/bindings/thermal/qcom-tsens.txt | 31 +++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt index 06195e8..b5312a8 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 beacause 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 propoerty 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>; + };