From patchwork Thu Feb 7 10:49:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 157751 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp611928jaa; Thu, 7 Feb 2019 04:58:36 -0800 (PST) X-Google-Smtp-Source: AHgI3IYuKGNB3C3/7KmLLmn9yYSJhtbAtkGJV0ON8HRLP+qyJ6u7uOxIHUZf9Zmd4k2udE2MpSBG X-Received: by 2002:a63:c22:: with SMTP id b34mr4348554pgl.398.1549544316106; Thu, 07 Feb 2019 04:58:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549544316; cv=none; d=google.com; s=arc-20160816; b=SI6dCJ/Ktsl3esxa6L4nyUG4/Sg1gJ1I8jbKOlDSwMNa6+xIIP6Dw17tS7cuKY1Eug Sj0N5a1hP0wPIU7MHQHu91zbUW6onq8KaVEuGwAfgM9OsGpzf7oBsWWHzEsgQlT1r//Z LqoykkptsQtcNPKMMAK9v7HDXh2zvqNqZwefAT1VygzUSvjxXam994s0U3zX7VWzn/8U MeTOJLAZbvfR0+xyqAuilSALzAuTJRZh1SYrWY/IeXnCMNoS0IqHV8YEXGCz7l3xuNe7 n9p05l4dglyG41np3SjrZEW72Rm1PD9oFjKEMnGHuSO0nf4PDQdnmUMMuiXMAwv8JLvC s2hw== 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 59si1931529ple.291.2019.02.07.04.58.35; Thu, 07 Feb 2019 04:58:36 -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 S1727309AbfBGM6e (ORCPT + 31 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(-) -- 2.17.1 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]))