From patchwork Thu Feb 28 12:21:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 159357 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp576540jad; Thu, 28 Feb 2019 04:27:17 -0800 (PST) X-Google-Smtp-Source: AHgI3IaWcCduHvkGzOV36otgESm+/XOhMBBJsbgiC1zY7VicLJ5HLtcg7DlIcktB7QXFz/la3DmL X-Received: by 2002:a62:be02:: with SMTP id l2mr7218027pff.55.1551356837093; Thu, 28 Feb 2019 04:27:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551356837; cv=none; d=google.com; s=arc-20160816; b=uIwSRDFOP1v08ajEPkok1v7e30xBSmWH03S/1v2vGXf3ycXEWXepSVo1kPJhfyeab1 6igLoXivXknISExKUtIsIgHpMIL1VtYObszZyWU18NFw9wwN6W2dhkGndHXiYqVPzWOg 6QwnP1Ts7RbF8AbGQKps+Qn2fVotlrX7mYeMMstsAYlPHch8++MQDycvYTCdg6Doz4y2 PjG7ptBwOi5JUC8TdLTC0SMRbayfKo+nJGUzTC0m8/Uo3qgq7fYMA3qqGhmhXqfyzWYO zSLLxIpyG9H0fznyFEJp3R97zARpISXNrTF8XotJN2oz1PNcGzKoWktMG1T2Vv4g1YL9 evoQ== 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=7ih+SAWN2J6Z2DTnoiDcjijOHCsTs+vEB5wC/EgIIos=; b=VnKO+3tQ184jx9VZWazs9qs66MyrE7bLkgif4pqIjDX6OjC3t2GF32kMnkmCEmh8Vp +YCVK+TVR3KtKimUDYlKS2rdVyhrXV5P8vTY5ff+CfeeXo9S7akMqPGd4dE7BmtZqpD1 YRym3KrYz5cJQrytweVEgkk0lJVaKLI07rJdag9aKEcDtdvCkbiye52pC/36Ujf4I6Rj 06xFnMwmF0DcIyF9XZCRftVV123OkugTM9r/4p797mcvU8a9KB3XXHiCqohf8RDAQ4HR 8h2yjM4CtSZa+DscQgKltofEQoJnd8iPdp2DMvrdkUOthzIcV1CExSUaZuGt3emeprhX ze6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yybSd720; 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 r23si16154398pgv.406.2019.02.28.04.27.16; Thu, 28 Feb 2019 04:27:17 -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=yybSd720; 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 S1731408AbfB1M1Q (ORCPT + 15 others); Thu, 28 Feb 2019 07:27:16 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46602 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730829AbfB1M1P (ORCPT ); Thu, 28 Feb 2019 07:27:15 -0500 Received: by mail-wr1-f67.google.com with SMTP id i16so21693338wrs.13 for ; Thu, 28 Feb 2019 04:27: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=7ih+SAWN2J6Z2DTnoiDcjijOHCsTs+vEB5wC/EgIIos=; b=yybSd7203embm0NYsxNwm95uzUGP+CtRXYUpVnrMV6voOiY0xfoVISdxp0yynAcVRu fU8UD2J9H9uI8m9klpBCGZeuPKToibFTit6Ls+IqvKCb8jcD5aog+tR08vxrABM+yuoU alVSOh33ZYgI4kcRsijx0VcuUUh4gD3ooInN9ourrBZgcUBSPNIas/0IhpyXlMsSawjc QhO8bpQluxVBmpPmWJU56c0r0samQcP0PpnsPeCmiNT+cNuijKMi8mvZKhCFEWCMSbT0 mjWaz8mvy05xGERmuwrFCmiAY0ZHAWi7Cma1D2QSbi9YQsRaszDiKRPQCkNhnTvHJffW ohGQ== 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=7ih+SAWN2J6Z2DTnoiDcjijOHCsTs+vEB5wC/EgIIos=; b=mB+QNuJXMswUXZ++Iql9yVR/xzCy2tJtNuQ++JvdpWWADthMo0y3PNl1mBhk7nAStX vJpj5tX0HI4Ds2xAVZr6NrQawEsy9lJn4TWdS/4N6xpl9WEhfjDKNAiBoDBW5U430Xq1 qecvxBpEu4YvQ5LxwZ9B8tk1LnkqHanAETqvnyFlu69KhHIDavdKSEcsk3m4BTdxN79I yJihvNtGa3L7m2XHqeJ9lbDO7nT4c3PG3jnpfVKC9YJikHA2Kk/pQi9WNDZEe31Qbs5y 6UrpeoQimxNIm+Az3Plhog1oHUnfYig0tP2psdgw9WCP2dSjTxHuzIB+LYduMt8JH56C eouA== X-Gm-Message-State: APjAAAURDsLvqkbKa3Ca4S52M5VFCK54yOEwxr+hudi0k0ec8qIplhrY 05o9OH+iE8OfI3DRio+/QxLK7A== X-Received: by 2002:a5d:4412:: with SMTP id z18mr6125270wrq.111.1551356834053; Thu, 28 Feb 2019 04:27:14 -0800 (PST) Received: from localhost ([49.248.54.130]) by smtp.gmail.com with ESMTPSA id d206sm7905080wmc.11.2019.02.28.04.27.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 04:27:13 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, Daniel Lezcano , David Brown , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v2 13/24] drivers: thermal: tsens: Track IP version Date: Thu, 28 Feb 2019 17:51:03 +0530 Message-Id: <4a91bf86d985129397312c25dec1f1f559c1ab53.1551355503.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 Version information is available on some TSENS IP. Allow reading it by allocating memory for the regmap_field. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.17.1 diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index aae3d71d7eed..8d632de2c7f8 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -155,6 +155,16 @@ int __init init_common(struct tsens_priv *priv) if (IS_ERR(priv->tm_map)) return PTR_ERR(priv->tm_map); + /* alloc regmap_fields in srot_map */ + if (priv->feat->ver_info) { + for (i = 0, j = VER_MAJOR; i < 2; i++, j++) { + priv->rf[j] = devm_regmap_field_alloc(dev, priv->srot_map, + priv->fields[j]); + if (IS_ERR(priv->rf[j])) + return PTR_ERR(priv->rf[j]); + } + } + priv->rf[TSENS_EN] = devm_regmap_field_alloc(dev, priv->srot_map, priv->fields[TSENS_EN]); if (IS_ERR(priv->rf[TSENS_EN]))