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: 10801119 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEF1913A4 for ; Thu, 7 Feb 2019 12:58:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FB382D40C for ; Thu, 7 Feb 2019 12:58:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9418A2D424; Thu, 7 Feb 2019 12:58:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EA222D41B for ; Thu, 7 Feb 2019 12:58:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727317AbfBGM6d (ORCPT ); Thu, 7 Feb 2019 07:58:33 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34929 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727272AbfBGM6c (ORCPT ); Thu, 7 Feb 2019 07:58:32 -0500 Received: by mail-pg1-f195.google.com with SMTP id s198so4468218pgs.2 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=Oa5WcROi3vuMZLBIs2bPDCK5WqdInd8aT2C6HmiLxaYONMrhXXqelXThQnBj2fvO/B BfsIEX7Fa0yOnTwl4M3AJ/vQLoR/am0mE0DKLBE1hoQ/PkCTBV8+5MyeXYER6XB+jAI8 BQZKPdReUQfiuNl6d2b/owmZHSR/5BojAMIY09i7pPpaBLGYaypqdYE9dWtkkm1QMsaE Ed3GB2vt/WTbuPCFZOS5fVxBmvWZrDKbZbK4jPgelHmNJHHNIztHTB6gFdqNDjvkUSTI 29GrwAHiBOAdMivcyVjjrcR9qpVbJkrswsskUuKoAgHle49CQLcL97e33QL2GiX5/KL5 bjTA== X-Gm-Message-State: AHQUAua0SenDrDgZwBDdiJjsULzSN2usb0znlO0Bs1WVcumsZe7z9/7v E6MeU/m7amuHQblhGF9BdKCWHA== X-Google-Smtp-Source: AHgI3IbGBmEb5KLi4nO/yhkb8wczZTbJNTwbsRRrk/oZ9jpoN2IZ7QHubxpPrsbVEsZ02E4tSFD/iA== 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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]))