Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp319983imj; Thu, 7 Feb 2019 04:59:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IYD/rWGVapSFHl/4SjMyqNmyjNd5eRuNW2vAtPhqG8yN0ySbCuUUySFCElE+wwCb/N7vaPP X-Received: by 2002:a17:902:a50e:: with SMTP id s14mr4390355plq.311.1549544389449; Thu, 07 Feb 2019 04:59:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549544389; cv=none; d=google.com; s=arc-20160816; b=bGHPunTZ5hN5HWUprvkIPB1svekh/4R++N4ZiYu6XE1uMNbHXd+DvTKFEBjYqeTL98 isRzoxsb+w4ytWQlZ/xQ4NwauKyiAsbMhEGZ01xykmwvYDkY8Z0q8aWT4xpHlL6tlFni rE7/vuMNAxKKMXUMcMU6v8KUH5PB2e1y6XWbTRar0sJlFEN0dNw75XksGyuH1eaXw/5S N1MeO/NS2ZqopPDe/jmsBQuJuQfzdBTxvYhI4DFvfyZFTJx+63qQgHh12iqwrF4CCq3X dKrO2Qo+EzFG2jAGbCy6AOjDKBTvCCRpnjjW/z0Hnu0nAn5eawHLvs1ky5IF3AqHPV8T RGcg== 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=7Kre07rqxuYGmES37cZuu+9CLEHFnu9rKvpL3j9UuBM=; b=fqKiIwGXFgQJog4xaDC3hRD9Ni9Q0yxL+aqE0NCH/nypB23piliELZZdAqTdkgIz4+ 2unEL3xNPJLcy7DfCVoqzXFaQ3TOztKeHWGOuqYdPKSrc3CPqjrOUNK3FbiOyeZ9PbqI cjpTTuHhb1ibU+39qk7rft+4eVVqrNcljGOxjO2h56btGUjGFRvhkrx2n9cxFxXHY8nD uuc3HxyaPpavhwi8UnWDJ3mvHbX96gcT8VlMAAoEI9LDJdp0KM3ogyKEl0lzo8leuJ+4 eQ4JxKG6iQUBK7EpJFeEbkaXilYp17z+292lqF9YjYeJxNi2VYQm2HKcD+TXWqNQJb/D uVog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OUO6Nc8I; 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 f124si9267154pfa.1.2019.02.07.04.59.33; Thu, 07 Feb 2019 04:59:49 -0800 (PST) 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=OUO6Nc8I; 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 S1727677AbfBGM6e (ORCPT + 99 others); Thu, 7 Feb 2019 07:58:34 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38100 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727664AbfBGM6c (ORCPT ); Thu, 7 Feb 2019 07:58:32 -0500 Received: by mail-pg1-f195.google.com with SMTP id g189so4458822pgc.5 for ; Thu, 07 Feb 2019 04:58:32 -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=7Kre07rqxuYGmES37cZuu+9CLEHFnu9rKvpL3j9UuBM=; b=OUO6Nc8I8vPsMM4z+NMO4fUll1Th63CA+OyRLn1l4OS2tIsT4HvnUYhXsJGWNjsfaQ u1h27oPvBfrDOlTIZgCtG6JvbEVrtmZ/DiNoGVcap6lcWY8SiGMp0gVQSSXamixQl0py K3PFITXsokOq2djeQuC+vb1o7XtDOgxd1TUAuCvR4nfNOBkiccY6Zh6M8/3ASHfy4e1P LTaLdJginablYLBH6ddSWQEE+HwC/XiQnHuPbZeSKhucjqSLje9mFKlEpylGk4Tmvae1 IcvaJ+Tupn9wwa6zxUOdu9eItiaUievK5fSRnk3tO4b564542bY8VxoczRvKtRF0hpdA fA5A== 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=7Kre07rqxuYGmES37cZuu+9CLEHFnu9rKvpL3j9UuBM=; b=R7Wtsfz4bIsgMESEGWWCar08zfMCAPWTO4HWxmPDMopqM5PSyp/wjyiustbD6iuJvb +of3mRI3kXB2y3FVqiSwOHzpVQsgXumcPUMX3HvjbV3eR/kg5cxdy0WoeEu8t2kS22Eh CFUpFv9w6cOjjoJtD5su/plS7NOX0ETPypPgYGTyYsVQfWvfLhOMdHQfkRWrJkHhRI7W Zh3U8ejsglyes1fzSluiJaYPXOBaANgssSPYzOBazMVecfQCk3+TUQ/RP17EsXsogSMQ lCnQEMT/cv2whyYYeGGjaU+KtFNgW2dMbzyjuf64V4fpmH5Y9PSA9bLXkhcF3aNVfhJm LngQ== X-Gm-Message-State: AHQUAubcJ6roZek3Cx959p3WfIZve+uRPxkC9bSUVnWgAybgskRJ5Fti 9oTCpXhm7NeLbVOabmP9GwFHp/dxUWU= X-Received: by 2002:a63:555b:: with SMTP id f27mr9879002pgm.313.1549544311695; Thu, 07 Feb 2019 04:58:31 -0800 (PST) Received: from localhost ([2402:3a80:c80:4138:75dd:3900:1d90:762f]) by smtp.gmail.com with ESMTPSA id i28sm9894347pfi.171.2019.02.07.04.58.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 04:58:31 -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 v1 13/24] drivers: thermal: tsens: Print IP version Date: Thu, 7 Feb 2019 16:19:31 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 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 On some TSENS IP, version is stored. Print that version at init. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index aae3d71d7eed..39cd5733fd44 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -121,7 +121,7 @@ int __init init_common(struct tsens_priv *priv) void __iomem *tm_base, *srot_base; struct device *dev = priv->dev; struct resource *res; - u32 enabled; + u32 enabled, maj_ver, min_ver; int ret, i, j; struct platform_device *op = of_find_device_by_node(priv->dev->of_node); @@ -155,6 +155,27 @@ int __init init_common(struct tsens_priv *priv) if (IS_ERR(priv->tm_map)) return PTR_ERR(priv->tm_map); + for (i = 0; i < MAX_REGFIELDS; i++) { + priv->rf[i] = NULL; + } + + /* 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]); + } + ret = regmap_field_read(priv->rf[VER_MAJOR], &maj_ver); + if (ret) + return ret; + ret = regmap_field_read(priv->rf[VER_MINOR], &min_ver); + if (ret) + return ret; + dev_info(dev, "version: %d.%d\n", maj_ver, min_ver); + } + priv->rf[TSENS_EN] = devm_regmap_field_alloc(dev, priv->srot_map, priv->fields[TSENS_EN]); if (IS_ERR(priv->rf[TSENS_EN])) -- 2.17.1