From patchwork Wed Sep 12 09:52:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10597261 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 BCF9B13BF for ; Wed, 12 Sep 2018 09:53:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADC092982F for ; Wed, 12 Sep 2018 09:53:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1BE929834; Wed, 12 Sep 2018 09:53:35 +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 396A22982F for ; Wed, 12 Sep 2018 09:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbeILO5O (ORCPT ); Wed, 12 Sep 2018 10:57:14 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:39636 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbeILO5O (ORCPT ); Wed, 12 Sep 2018 10:57:14 -0400 Received: by mail-ed1-f67.google.com with SMTP id h4-v6so1253783edi.6 for ; Wed, 12 Sep 2018 02:53:27 -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=ZveZRZ6ez2WFXt4vWZSNreLB4c6rXEn4jTnJUKvsQDk=; b=QxsYTz7wjLzAywPKeME/lb8Kr8KJSddcqY8CX2VtPjYdD8sXXSX1X4DuI0Rj7+/Ij1 LeU55vndWr0mBFKqCMwePkISgioxpm3ga2vVaqwJxehCslUgTO/6f3LPJqh8XdtJsG2D em7bAXoBOxPifhvgQrTGzKstdmo8MhwIUQlrQ= 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=ZveZRZ6ez2WFXt4vWZSNreLB4c6rXEn4jTnJUKvsQDk=; b=sQ7DEeqRClaUxQYiddbjyCI4ralQgH2AvIysCUqAQ+m/aP8p0OWd9P7JsPn27/YLYT dfVwaOPErhwblLDFY5XJM8QVmx0qLFjNwmHyNcy4FCPCzWg8o/CRBcZtqRd+L31bJmeu dqld6X6o3ebow409hg/HhzAXXVPqgdCR6TlN6ZHoQKrafdn5hnHA4d43veld+ZWTO0m5 PvgtR40nPd34YmO9Is91z7zXJavOvmwEJFzEekKgYsX5MjzJkeoEap17kxFn04UZeMgs yWs6IDyqTvtuK0ijOXU3bnLyiV3ROrdmAwY+pHlIhTltaVl2P8ZsOjz/K/J+9romUJyC dz9A== X-Gm-Message-State: APzg51DC/YEA7o8L7UkLMajUcyUG0psaIOD8LXgrmcm5bZR/fdMTM22I gwqoLCTJXeU8IInZPmxKN3Wvxg== X-Google-Smtp-Source: ANB0VdbezJYA1okTuxZA969YIcAwld6Dr6dbeD2oN/IUevWxzHdxu8xzerKB+QUIvDhTctj33Irkww== X-Received: by 2002:a50:f297:: with SMTP id f23-v6mr1870386edm.40.1536746006441; Wed, 12 Sep 2018 02:53:26 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id a33-v6sm433189eda.2.2018.09.12.02.53.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:53:25 -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, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH v3 01/16] thermal: tsens: Prepare 8916 and 8974 tsens to use SROT and TM address space Date: Wed, 12 Sep 2018 15:22:46 +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 We've already converted over the devicetree of platforms using v2 version of the TSENS IP to use two address spaces. Now prepare to convert over the 8916 and 8974 platforms to use separate SROT and TM address spaces. This patch will work with device trees with one or two address spaces because we set the tm_offset in commit 5b1283984fa3 ("thermal: tsens: Add support to split up register address space into two"). Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke --- drivers/thermal/qcom/tsens-common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 6207d8d92351..478739543bbc 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -21,7 +21,7 @@ #include #include "tsens.h" -#define S0_ST_ADDR 0x1030 +#define STATUS_OFFSET 0x30 #define SN_ADDR_OFFSET 0x4 #define SN_ST_TEMP_MASK 0x3ff #define CAL_DEGC_PT1 30 @@ -107,8 +107,9 @@ int get_temp_common(struct tsens_device *tmdev, int id, int *temp) unsigned int status_reg; int last_temp = 0, ret; - status_reg = S0_ST_ADDR + s->hw_id * SN_ADDR_OFFSET; + status_reg = tmdev->tm_offset + STATUS_OFFSET + s->hw_id * SN_ADDR_OFFSET; ret = regmap_read(tmdev->map, status_reg, &code); + if (ret) return ret; last_temp = code & SN_ST_TEMP_MASK; From patchwork Wed Sep 12 09:52:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10597263 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 B6C33920 for ; Wed, 12 Sep 2018 09:53:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A29762982F for ; Wed, 12 Sep 2018 09:53:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9441D29834; Wed, 12 Sep 2018 09:53:38 +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=ham 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 058502982F for ; Wed, 12 Sep 2018 09:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbeILO5V (ORCPT ); Wed, 12 Sep 2018 10:57:21 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44691 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbeILO5V (ORCPT ); Wed, 12 Sep 2018 10:57:21 -0400 Received: by mail-ed1-f67.google.com with SMTP id s10-v6so1233886edb.11 for ; Wed, 12 Sep 2018 02:53:33 -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=C01eNk3NwvsIILRxSmGNc2O1AsfcJ/1SiL94aPpnU1o=; b=BnpNtCrcNgH4c+El2+edawnt/IUENWb+siPT2y+6maMo5vKcXvDkyX2bLiuKQO/GhT J6F0WSeue+xIu+MOHmGhL3KFA7mLSykVs5czobeMSyvTT7m0hY1I3ExIrebHJ/7w8KoW 5OMwNFJkBCPEps5rPBI5trL7nERNkApfOIYr8= 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=C01eNk3NwvsIILRxSmGNc2O1AsfcJ/1SiL94aPpnU1o=; b=XAW8fclkyE14ZwhYwy3AiU4NGsN6v+5x36MpVyo1QvgTO1FPB6GA21QOwq8zsRHlG+ fk/z4xSciek8yoZnsiWIdughidfnRImctobZxLVbPNGVluTqqMb420G7L0ImcuG47GXQ QwbDViTjTxgSqe5WFGi+bXbewTRpWFN1FJOKj/8TV6aTFwSwUM0TTCO7uwIVVWbNo+l8 GbV6ymu7gZfBxBBjQ0tjVJvnJd9decWoAWPIy7JQY+rIhTP/ie2bxdUfLoaGQafoFzgq bHDUkHfhTCCxVi6pC6Et364h1lAjrxmSw19/HiLgIlmtIMCat2it6oEEjcw8VeF0ieFL xs9g== X-Gm-Message-State: APzg51DIm7LfkvFI2WL4Abdid2f2BbhklrqvwlWxLBDr3UDlUygB1qSG x4dpICRRa7n+09OI6+ISdR6DSg== X-Google-Smtp-Source: ANB0VdaCE4LTtrOtpLtWYuDeHE2LKO3u8wLJBjIucnmBwckKdc8GleR9u9ZVl/276yu7WZhmE8SuPw== X-Received: by 2002:a50:fd84:: with SMTP id o4-v6mr1746928edt.116.1536746012859; Wed, 12 Sep 2018 02:53:32 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id g20-v6sm328160edm.36.2018.09.12.02.53.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:53:32 -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, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH v3 02/16] thermal: tsens: Add SPDX license identifiers Date: Wed, 12 Sep 2018 15:22:47 +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 The TSENS drivers use a GPL-2.0 license. Replace with equivalent SPDX tags and delete the full license text. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens-8916.c | 11 +---------- drivers/thermal/qcom/tsens-8960.c | 11 +---------- drivers/thermal/qcom/tsens-8974.c | 11 +---------- drivers/thermal/qcom/tsens-common.c | 11 +---------- drivers/thermal/qcom/tsens.c | 11 +---------- drivers/thermal/qcom/tsens.h | 11 ++--------- 6 files changed, 7 insertions(+), 59 deletions(-) diff --git a/drivers/thermal/qcom/tsens-8916.c b/drivers/thermal/qcom/tsens-8916.c index fdf561b8b81d..c4955c85e922 100644 --- a/drivers/thermal/qcom/tsens-8916.c +++ b/drivers/thermal/qcom/tsens-8916.c @@ -1,15 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 0451277d3a8f..4af76de7dc2e 100644 --- a/drivers/thermal/qcom/tsens-8960.c +++ b/drivers/thermal/qcom/tsens-8960.c @@ -1,15 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include diff --git a/drivers/thermal/qcom/tsens-8974.c b/drivers/thermal/qcom/tsens-8974.c index 9baf77e8cbe3..7e149edbfeb6 100644 --- a/drivers/thermal/qcom/tsens-8974.c +++ b/drivers/thermal/qcom/tsens-8974.c @@ -1,15 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 478739543bbc..303e3fdaca98 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -1,15 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index a2c9bfae3d86..90bb431cf740 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -1,15 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * */ #include diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 14331eb45a86..8207610f326a 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -1,15 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. */ + #ifndef __QCOM_TSENS_H__ #define __QCOM_TSENS_H__ From patchwork Wed Sep 12 09:52:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10597269 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 BB7BC920 for ; Wed, 12 Sep 2018 09:53:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC2A32982F for ; Wed, 12 Sep 2018 09:53:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A062229837; Wed, 12 Sep 2018 09:53:47 +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 5E5322982F for ; Wed, 12 Sep 2018 09:53:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727560AbeILO51 (ORCPT ); Wed, 12 Sep 2018 10:57:27 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:38287 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbeILO50 (ORCPT ); Wed, 12 Sep 2018 10:57:26 -0400 Received: by mail-ed1-f66.google.com with SMTP id h33-v6so1259457edb.5 for ; Wed, 12 Sep 2018 02:53:39 -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=RXDtbhIMyFAbtAg9tx8eCbbtVuDm61EOqgYh33KEgl8=; b=OEbotGsSjoxEa2H9/50/GxFSgmVnTAOrcJRYC3xo0w08omETCoeu6rMeaVS14mbkKL pXKHYSn2IZReT9u3hUPQ401KMAu+qZDFMUzchNNrOxEnHRXF3VW7hssbdF7k6YhkhcSp 3TmTi2ykfyR4GwPfx4Ay+skd12teQHBTW+nYE= 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=RXDtbhIMyFAbtAg9tx8eCbbtVuDm61EOqgYh33KEgl8=; b=psJdXtGQp5RJNvX51zPmwoeZyEXMl4pnVq17zu4qm1v+Eedxm+iLurehbRmrsb0CeX eYXEwPE3FVxHS1r/uF2tPhJqjUbDGn6zV7cZEIhd7EoQl5HKmkKU5LGxP92mWrEnFHfd wpmUC0cewq0kF+2AkwjizK2ucX+1pryDjEFiQUFEqFf/mAXccrm/mQbUE6iQLECn9BrA QM7Vm+H7wTa/tAp1PNNzTJWvMsmI90j4WFBEWviKlJCnXebbCrzaFVCvH8ZuZSBAVf5G VWIIQQiKWrfQfLWeBMquy2WfE9eP7VlLlxyQfPk8TF7jf5HWXGbxSPkJRBh2ARLL+i7+ ureA== X-Gm-Message-State: APzg51AKbssNq9e5JhfcrHKQsVIphAm3IrFgU8FYafcmivVS5Q46xzpl vMx/h9n1HIbabcYvaK9MyDubVw== X-Google-Smtp-Source: ANB0VdbX+ZJr3SFGG70Zfh2Ct/HD1a7yxuSJ0YJb9YkUrm7kd0tpgl3e/O2DeaCbvd6ILh7Civo3/w== X-Received: by 2002:a50:d798:: with SMTP id w24-v6mr1883556edi.19.1536746019244; Wed, 12 Sep 2018 02:53:39 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id e30-v6sm390310ede.91.2018.09.12.02.53.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:53:38 -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, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH v3 03/16] thermal: tsens: Get rid of dead code Date: Wed, 12 Sep 2018 15:22:48 +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 hw_id is dynamically allocated but not used anywhere. Get rid of dead code. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 90bb431cf740..9a8e8f7b4ae1 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -80,11 +80,6 @@ static int tsens_register(struct tsens_device *tmdev) { int i; struct thermal_zone_device *tzd; - u32 *hw_id, n = tmdev->num_sensors; - - hw_id = devm_kcalloc(tmdev->dev, n, sizeof(u32), GFP_KERNEL); - if (!hw_id) - return -ENOMEM; for (i = 0; i < tmdev->num_sensors; i++) { tmdev->sensor[i].tmdev = tmdev; From patchwork Wed Sep 12 09:52:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10597273 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 7A78D17DF for ; Wed, 12 Sep 2018 09:53:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AFCE29834 for ; Wed, 12 Sep 2018 09:53:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E3A729832; Wed, 12 Sep 2018 09:53:49 +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 C9F5E29834 for ; Wed, 12 Sep 2018 09:53:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726876AbeILO5d (ORCPT ); Wed, 12 Sep 2018 10:57:33 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:39662 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726993AbeILO5d (ORCPT ); Wed, 12 Sep 2018 10:57:33 -0400 Received: by mail-ed1-f68.google.com with SMTP id h4-v6so1254553edi.6 for ; Wed, 12 Sep 2018 02:53:46 -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=oyVR9VDnhTvKXOKbw7Astf9ffMSp3grLTh5jlc+BE/A=; b=QU4pw6y9+0GKgLiHyhWPqMcNv2aMn2tDfMsI0xLKkwcdSIHWUrJFkKmu6dw2eA85M/ g55mMSWvV9x2zVc2encA1WZ4VAFistP1Vw/Q6omqgjtoKqWcT72wGEXCika0s7Cqw7uy jjqg/MTalyFk0acXBUuDfb/6/90Zx7IOrHsoE= 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=oyVR9VDnhTvKXOKbw7Astf9ffMSp3grLTh5jlc+BE/A=; b=iyh7aehnWdzilCwn0ajZyoec/O5A20C65pvdIMJn2TnS+G4pTWhkmlg61bG42Ek1U7 XOpSTmt6HriiVfXg5j9gq5RXSjIs6aKcvLde+1EmSlKEWB1R3m5HFRlxrYJTrXL0pMxH TIq/78c3qwbVxPrwpGJ8e2ClPFCR9bwZ64vEiLFm23/Tx4Tjf2RnzjGWJBiITvD1IfXZ Wi8EUgvbrA/2Gu/OiwWtZZ956ndbvHTSjcGrxzrLIWFmH4oPx4ZWL3rSUKezxMJnTsQb EzWelHeCIQqVBE6gtDJ6dtO+gwJ332vUc8JI3nutuSQE+TmHJCMscea5ETCzrCb6WuY/ 0kvw== X-Gm-Message-State: APzg51DKQm85LE/G1olwbf/ttSl23uTMxUn2gVa0Z9vJFCKbjpiBV+xV cOE7S91pmXpusRB0Peuu7Lgnkg== X-Google-Smtp-Source: ANB0VdY4OhJFNrcgDSanzb6ISPPI+4j7/fKLhB2uFqW2mUesA2hy/KgBML6TdvK80JPDbjOl2KjS/Q== X-Received: by 2002:a50:a3cb:: with SMTP id t11-v6mr1879712edb.238.1536746025572; Wed, 12 Sep 2018 02:53:45 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id z30-v6sm460597edb.4.2018.09.12.02.53.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:53:44 -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, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH v3 04/16] thermal: tsens: Rename map field in order to add a second address map Date: Wed, 12 Sep 2018 15:22:49 +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 The TSENS driver currently only uses a limited set of registers from the TM address space. So it was ok to map just that set of registers and call it "map". We'd now like to map a second set: SROT registers to introduce new functionality. Rename the "map" field to a more appropriate "tm_map". The 8960 doesn't have a clear split between TM and SROT registers. To avoid complicating the data structure, it will switchover to using tm_map for its maps. There is no functional change with this patch. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens-8960.c | 30 ++++++++++++++--------------- drivers/thermal/qcom/tsens-common.c | 17 ++++++++-------- drivers/thermal/qcom/tsens-v2.c | 6 +++--- drivers/thermal/qcom/tsens.h | 2 +- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 4af76de7dc2e..0f0adb302a7b 100644 --- a/drivers/thermal/qcom/tsens-8960.c +++ b/drivers/thermal/qcom/tsens-8960.c @@ -60,7 +60,7 @@ static int suspend_8960(struct tsens_device *tmdev) { int ret; unsigned int mask; - struct regmap *map = tmdev->map; + struct regmap *map = tmdev->tm_map; ret = regmap_read(map, THRESHOLD_ADDR, &tmdev->ctx.threshold); if (ret) @@ -85,7 +85,7 @@ static int suspend_8960(struct tsens_device *tmdev) static int resume_8960(struct tsens_device *tmdev) { int ret; - struct regmap *map = tmdev->map; + struct regmap *map = tmdev->tm_map; ret = regmap_update_bits(map, CNTL_ADDR, SW_RST, SW_RST); if (ret) @@ -117,12 +117,12 @@ static int enable_8960(struct tsens_device *tmdev, int id) int ret; u32 reg, mask; - ret = regmap_read(tmdev->map, CNTL_ADDR, ®); + ret = regmap_read(tmdev->tm_map, CNTL_ADDR, ®); if (ret) return ret; mask = BIT(id + SENSOR0_SHIFT); - ret = regmap_write(tmdev->map, CNTL_ADDR, reg | SW_RST); + ret = regmap_write(tmdev->tm_map, CNTL_ADDR, reg | SW_RST); if (ret) return ret; @@ -131,7 +131,7 @@ static int enable_8960(struct tsens_device *tmdev, int id) else reg |= mask | SLP_CLK_ENA_8660 | EN; - ret = regmap_write(tmdev->map, CNTL_ADDR, reg); + ret = regmap_write(tmdev->tm_map, CNTL_ADDR, reg); if (ret) return ret; @@ -148,7 +148,7 @@ static void disable_8960(struct tsens_device *tmdev) mask <<= SENSOR0_SHIFT; mask |= EN; - ret = regmap_read(tmdev->map, CNTL_ADDR, ®_cntl); + ret = regmap_read(tmdev->tm_map, CNTL_ADDR, ®_cntl); if (ret) return; @@ -159,7 +159,7 @@ static void disable_8960(struct tsens_device *tmdev) else reg_cntl &= ~SLP_CLK_ENA_8660; - regmap_write(tmdev->map, CNTL_ADDR, reg_cntl); + regmap_write(tmdev->tm_map, CNTL_ADDR, reg_cntl); } static int init_8960(struct tsens_device *tmdev) @@ -167,8 +167,8 @@ static int init_8960(struct tsens_device *tmdev) int ret, i; u32 reg_cntl; - tmdev->map = dev_get_regmap(tmdev->dev, NULL); - if (!tmdev->map) + tmdev->tm_map = dev_get_regmap(tmdev->dev, NULL); + if (!tmdev->tm_map) return -ENODEV; /* @@ -184,14 +184,14 @@ static int init_8960(struct tsens_device *tmdev) } reg_cntl = SW_RST; - ret = regmap_update_bits(tmdev->map, CNTL_ADDR, SW_RST, reg_cntl); + ret = regmap_update_bits(tmdev->tm_map, CNTL_ADDR, SW_RST, reg_cntl); if (ret) return ret; if (tmdev->num_sensors > 1) { reg_cntl |= SLP_CLK_ENA | (MEASURE_PERIOD << 18); reg_cntl &= ~SW_RST; - ret = regmap_update_bits(tmdev->map, CONFIG_ADDR, + ret = regmap_update_bits(tmdev->tm_map, CONFIG_ADDR, CONFIG_MASK, CONFIG); } else { reg_cntl |= SLP_CLK_ENA_8660 | (MEASURE_PERIOD << 16); @@ -200,12 +200,12 @@ static int init_8960(struct tsens_device *tmdev) } reg_cntl |= GENMASK(tmdev->num_sensors - 1, 0) << SENSOR0_SHIFT; - ret = regmap_write(tmdev->map, CNTL_ADDR, reg_cntl); + ret = regmap_write(tmdev->tm_map, CNTL_ADDR, reg_cntl); if (ret) return ret; reg_cntl |= EN; - ret = regmap_write(tmdev->map, CNTL_ADDR, reg_cntl); + ret = regmap_write(tmdev->tm_map, CNTL_ADDR, reg_cntl); if (ret) return ret; @@ -252,12 +252,12 @@ static int get_temp_8960(struct tsens_device *tmdev, int id, int *temp) timeout = jiffies + usecs_to_jiffies(TIMEOUT_US); do { - ret = regmap_read(tmdev->map, INT_STATUS_ADDR, &trdy); + ret = regmap_read(tmdev->tm_map, INT_STATUS_ADDR, &trdy); if (ret) return ret; if (!(trdy & TRDY_MASK)) continue; - ret = regmap_read(tmdev->map, s->status, &code); + ret = regmap_read(tmdev->tm_map, s->status, &code); if (ret) return ret; *temp = code_to_mdegC(code, s); diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 303e3fdaca98..0585084630b3 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -99,8 +99,7 @@ int get_temp_common(struct tsens_device *tmdev, int id, int *temp) int last_temp = 0, ret; status_reg = tmdev->tm_offset + STATUS_OFFSET + s->hw_id * SN_ADDR_OFFSET; - ret = regmap_read(tmdev->map, status_reg, &code); - + ret = regmap_read(tmdev->tm_map, status_reg, &code); if (ret) return ret; last_temp = code & SN_ST_TEMP_MASK; @@ -118,7 +117,7 @@ static const struct regmap_config tsens_config = { int __init init_common(struct tsens_device *tmdev) { - void __iomem *base; + void __iomem *tm_base; struct resource *res; struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node); @@ -134,13 +133,13 @@ int __init init_common(struct tsens_device *tmdev) } res = platform_get_resource(op, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(&op->dev, res); - if (IS_ERR(base)) - return PTR_ERR(base); + tm_base = devm_ioremap_resource(&op->dev, res); + if (IS_ERR(tm_base)) + return PTR_ERR(tm_base); - tmdev->map = devm_regmap_init_mmio(tmdev->dev, base, &tsens_config); - if (IS_ERR(tmdev->map)) - return PTR_ERR(tmdev->map); + tmdev->tm_map = devm_regmap_init_mmio(tmdev->dev, tm_base, &tsens_config); + if (IS_ERR(tmdev->tm_map)) + return PTR_ERR(tmdev->tm_map); return 0; } diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index 44da02f594ac..1bdef92e4521 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -21,7 +21,7 @@ static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp) int ret; status_reg = tmdev->tm_offset + STATUS_OFFSET + s->hw_id * 4; - ret = regmap_read(tmdev->map, status_reg, &code); + ret = regmap_read(tmdev->tm_map, status_reg, &code); if (ret) return ret; last_temp = code & LAST_TEMP_MASK; @@ -29,7 +29,7 @@ static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp) goto done; /* Try a second time */ - ret = regmap_read(tmdev->map, status_reg, &code); + ret = regmap_read(tmdev->tm_map, status_reg, &code); if (ret) return ret; if (code & STATUS_VALID_BIT) { @@ -40,7 +40,7 @@ static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp) } /* Try a third/last time */ - ret = regmap_read(tmdev->map, status_reg, &code); + ret = regmap_read(tmdev->tm_map, status_reg, &code); if (ret) return ret; if (code & STATUS_VALID_BIT) { diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 8207610f326a..58e98c4d3a8b 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -69,7 +69,7 @@ struct tsens_context { struct tsens_device { struct device *dev; u32 num_sensors; - struct regmap *map; + struct regmap *tm_map; u32 tm_offset; struct tsens_context ctx; const struct tsens_ops *ops; From patchwork Wed Sep 12 09:52:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10597275 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 C4046920 for ; Wed, 12 Sep 2018 09:54:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2F1A29832 for ; Wed, 12 Sep 2018 09:54:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A44392982F; Wed, 12 Sep 2018 09:54:00 +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=ham 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 3C9D62982F for ; Wed, 12 Sep 2018 09:54:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727686AbeILO5k (ORCPT ); Wed, 12 Sep 2018 10:57:40 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:34208 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727650AbeILO5j (ORCPT ); Wed, 12 Sep 2018 10:57:39 -0400 Received: by mail-ed1-f67.google.com with SMTP id u1-v6so1276997eds.1 for ; Wed, 12 Sep 2018 02:53:52 -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=FjREbFGVR4U2BlmcUg5I3xLlSlYd4TVVX+ZjdpIMju8=; b=gSDuBvzg5L1d1hFDoKnmjQix+KFeP1cO2uVFU56g2/qrZxMTvgh2xfjzWq5lb0E0Tk Wvv+qDIhwcL7lBs/wnayTmppcEG2rfEQkaD8auHl1nwy1UgBRHa9C4uWrT3LQB29XTgS eP+tbT6VRGAjL5x8b42lx36NpdXb7tRSIlNTo= 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=FjREbFGVR4U2BlmcUg5I3xLlSlYd4TVVX+ZjdpIMju8=; b=DjBFY5fz/neIx87YRogbaVeV0XR3e8uYJgG4IiopcCworWOnbtyEpgVt9QjITqN7EP bNlXooTIdw5NsgAzW1ZeLbFiQVu1/Eg+ESqxnTcXZp9nYkz7hn0f5J6HRX7uAKOIwrBU 1SJsEK15BF0RDTOz1rm6usGFSBQTL0nDKBvZZl2lrVbKB4fKb2QIkApen4L1g4D1b9Ti l6V+ri1sD08RUqxRpasB4mykkrMnwrbfbe6hKutxhmvcrO9wo2AA7zN1aXoMMrivuEAX YiUAcv3L0B3/0aQopgWQpcK/yKsob3rhLFZeHW46LrNGNMitJSiA27fL0k8nTRd1Rnur 15cw== X-Gm-Message-State: APzg51CltF2kEy2gAhix4EPeyb0OliW/6y4p1vwsVxybeZcc0yvQR53o GFirY7zGR8T+Mry9dYZy6fx3EMvtgGc= X-Google-Smtp-Source: ANB0VdYlqb3HRo8aP5ClmwxcBK3IK1VPxxiE7ngroUoagHKqfYqJNBJLtL7vp8BYdd9dEVfZHNLKRA== X-Received: by 2002:a50:86b5:: with SMTP id r50-v6mr1736811eda.201.1536746031759; Wed, 12 Sep 2018 02:53:51 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id a19-v6sm481328edd.69.2018.09.12.02.53.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:53:50 -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, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH v3 05/16] thermal: tsens: Add the SROT address map Date: Wed, 12 Sep 2018 15:22:50 +0530 Message-Id: <2900c1006e7e978403b1b95448f9c959c7ae486a.1536744310.git.amit.kucheria@linaro.org> 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 platforms whose device trees specify two address spaces for TSENS, the second one points to the SROT registers. Initialise the SROT map on those platforms. Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens-common.c | 14 ++++++++++++-- drivers/thermal/qcom/tsens.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 0585084630b3..0b8a793f15f4 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -117,16 +117,26 @@ static const struct regmap_config tsens_config = { int __init init_common(struct tsens_device *tmdev) { - void __iomem *tm_base; + void __iomem *tm_base, *srot_base; struct resource *res; struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node); if (!op) return -EINVAL; - /* The driver only uses the TM register address space for now */ if (op->num_resources > 1) { + /* DT with separate SROT and TM address space */ tmdev->tm_offset = 0; + res = platform_get_resource(op, IORESOURCE_MEM, 1); + srot_base = devm_ioremap_resource(&op->dev, res); + if (IS_ERR(srot_base)) + return PTR_ERR(srot_base); + + tmdev->srot_map = devm_regmap_init_mmio(tmdev->dev, + srot_base, &tsens_config); + if (IS_ERR(tmdev->srot_map)) + return PTR_ERR(tmdev->srot_map); + } else { /* old DTs where SROT and TM were in a contiguous 2K block */ tmdev->tm_offset = 0x1000; diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 58e98c4d3a8b..b9c4bcf255fa 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -70,6 +70,7 @@ struct tsens_device { struct device *dev; u32 num_sensors; struct regmap *tm_map; + struct regmap *srot_map; u32 tm_offset; struct tsens_context ctx; const struct tsens_ops *ops; From patchwork Wed Sep 12 09:52:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10597283 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 C332013BF for ; Wed, 12 Sep 2018 09:54:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B42E32982F for ; Wed, 12 Sep 2018 09:54:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A622729832; Wed, 12 Sep 2018 09:54:17 +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 45CEE29832 for ; Wed, 12 Sep 2018 09:54:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726606AbeILO6C (ORCPT ); Wed, 12 Sep 2018 10:58:02 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34816 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726677AbeILO6C (ORCPT ); Wed, 12 Sep 2018 10:58:02 -0400 Received: by mail-ed1-f66.google.com with SMTP id y20-v6so1275455edq.2 for ; Wed, 12 Sep 2018 02:54:15 -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=f5bkI9k4W2c9XfxovD/lpb7m212pStl1rJ1cHBfU/w8=; b=VdS5xPkqWD6huuj6drH9txEG/ptP+bfjajMdOn+cz2qpUtJh5vgHCFhg8v7ObU0t1D OxcIdFHzjrQIscgwb1WYW5ZTRfRNEN0eFsNsLjpJJ2P5KLWhHBfCQyQRjagq5jxRMyMB DQLwd/g2rjIrv71lJ+mmjLQbtv3Z0mHGx+rys= 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=f5bkI9k4W2c9XfxovD/lpb7m212pStl1rJ1cHBfU/w8=; b=bgeInmCqJVb6+wBd7wSfaler1VOJ1COECvVJz4PRSvoj7RMGHTfzbcsbr7EA92z5A3 SjCV3m2Kx85Rhvkopch3Z9X1eHO1YHgdrtKcUMZ3XxCmcPAUq0J6sbH63haRUuzgMMxO 2dauLEVVFVFua0536kJEQ3DA+8etbrdfr4p21FvUHkjnU2PTpZhk7bJuAoP8kLa9kIRY 2p7wtGaqN2KpoKpe/MN+mB7B6lPvdnHkbrX0GZiDJBR4TmtTsNDkPwoNxA+CicvJWUY/ uhQ5yXT92ViyikiS2AsFOGWChK6binEfKmYZdG9bFQxMzACn7GoIM8BN6CfuR72pO5Bt Xmpw== X-Gm-Message-State: APzg51DD2802ONMFYlDXhUOIZ9rAr4/KutDJz4ge5F9tNEumEFwkCQcE box5S1YYOuSUNZlj8P+3Sg9ivg== X-Google-Smtp-Source: ANB0Vda6nzPa9Nf5fkD2j1meLN4TlS0Av8gySTdcrZ+8tMwv417kv8e5jHmghUsxHV1rb4UllTUIPA== X-Received: by 2002:a50:a804:: with SMTP id j4-v6mr1808568edc.105.1536746054401; Wed, 12 Sep 2018 02:54:14 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id h8-v6sm400574edi.68.2018.09.12.02.54.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:54:13 -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, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH v3 07/16] thermal: tsens: Pass register offsets as private data Date: Wed, 12 Sep 2018 15:22:52 +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 Registers have moved around across TSENS generations. For example, the CTRL register was at offset 0x0 in the SROT region on msm8916 but is at offset 0x4 in newer v2 based TSENS HW blocks. Allow passing offsets of important registers so that we can continue to use common functions. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens-8916.c | 1 + drivers/thermal/qcom/tsens-8974.c | 1 + drivers/thermal/qcom/tsens-v2.c | 2 ++ drivers/thermal/qcom/tsens.c | 3 +++ drivers/thermal/qcom/tsens.h | 9 +++++++++ 5 files changed, 16 insertions(+) diff --git a/drivers/thermal/qcom/tsens-8916.c b/drivers/thermal/qcom/tsens-8916.c index c4955c85e922..c6dd620ac029 100644 --- a/drivers/thermal/qcom/tsens-8916.c +++ b/drivers/thermal/qcom/tsens-8916.c @@ -100,5 +100,6 @@ static const struct tsens_ops ops_8916 = { const struct tsens_data data_8916 = { .num_sensors = 5, .ops = &ops_8916, + .reg_offsets = { [SROT_CTRL_OFFSET] = 0x0 }, .hw_ids = (unsigned int []){0, 1, 2, 4, 5 }, }; diff --git a/drivers/thermal/qcom/tsens-8974.c b/drivers/thermal/qcom/tsens-8974.c index 7e149edbfeb6..3d3fda3d731b 100644 --- a/drivers/thermal/qcom/tsens-8974.c +++ b/drivers/thermal/qcom/tsens-8974.c @@ -232,4 +232,5 @@ static const struct tsens_ops ops_8974 = { const struct tsens_data data_8974 = { .num_sensors = 11, .ops = &ops_8974, + .reg_offsets = { [SROT_CTRL_OFFSET] = 0x0 }, }; diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index 1bdef92e4521..381a212872bf 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -68,10 +68,12 @@ static const struct tsens_ops ops_generic_v2 = { const struct tsens_data data_tsens_v2 = { .ops = &ops_generic_v2, + .reg_offsets = { [SROT_CTRL_OFFSET] = 0x4 }, }; /* Kept around for backward compatibility with old msm8996.dtsi */ const struct tsens_data data_8996 = { .num_sensors = 13, .ops = &ops_generic_v2, + .reg_offsets = { [SROT_CTRL_OFFSET] = 0x4 }, }; diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 9a8e8f7b4ae1..f1ec9bbe4717 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -144,6 +144,9 @@ static int tsens_probe(struct platform_device *pdev) else tmdev->sensor[i].hw_id = i; } + for (i = 0; i < REG_ARRAY_SIZE; i++) { + tmdev->reg_offsets[i] = data->reg_offsets[i]; + } if (!tmdev->ops || !tmdev->ops->init || !tmdev->ops->get_temp) return -EINVAL; diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index b9c4bcf255fa..7b7feee5dc46 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -48,15 +48,23 @@ struct tsens_ops { int (*get_trend)(struct tsens_device *, int, enum thermal_trend *); }; +enum reg_list { + SROT_CTRL_OFFSET, + + REG_ARRAY_SIZE, +}; + /** * struct tsens_data - tsens instance specific data * @num_sensors: Max number of sensors supported by platform * @ops: operations the tsens instance supports * @hw_ids: Subset of sensors ids supported by platform, if not the first n + * @reg_offsets: Register offsets for commonly used registers */ struct tsens_data { const u32 num_sensors; const struct tsens_ops *ops; + const u16 reg_offsets[REG_ARRAY_SIZE]; unsigned int *hw_ids; }; @@ -72,6 +80,7 @@ struct tsens_device { struct regmap *tm_map; struct regmap *srot_map; u32 tm_offset; + u16 reg_offsets[REG_ARRAY_SIZE]; struct tsens_context ctx; const struct tsens_ops *ops; struct tsens_sensor sensor[0]; From patchwork Wed Sep 12 09:52:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10597287 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 3DE8F17DF for ; Wed, 12 Sep 2018 09:54:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E6692982F for ; Wed, 12 Sep 2018 09:54:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2259C29834; Wed, 12 Sep 2018 09:54:25 +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 63DC12982F for ; Wed, 12 Sep 2018 09:54:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727798AbeILO6I (ORCPT ); Wed, 12 Sep 2018 10:58:08 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:38340 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbeILO6I (ORCPT ); Wed, 12 Sep 2018 10:58:08 -0400 Received: by mail-ed1-f65.google.com with SMTP id h33-v6so1260938edb.5 for ; Wed, 12 Sep 2018 02:54:21 -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=p+l9eG3EJUvs5PqroE1oN9/c9Y5I3RjwbnuwyKuwaKQ=; b=J9L6R4gfDqVWuTaZEOBoz4A2w3TIHW5Klx19orLgDv4Sl9La0s0FWXmR7JLmcigpEW DKdX1UdAg4XCcBHHnA6xPilTPpyQPnTZrgTwqHzUH+7yNsz7VXqCYTy2XnAIoSuRiR5R Wtnd7im10Eb7dMJnSui63aISD1ETTo4synyUs= 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=p+l9eG3EJUvs5PqroE1oN9/c9Y5I3RjwbnuwyKuwaKQ=; b=YG/0ImXE/tIVDLe9WsCbcxc0tgus8QGcRBjolc96dMkCDiEk377YvcgH6ooz+2nyls TLmZ4i3MGQH7Bfg07YZhy29tmcOrSAEzEPJaMSN4nIXmE50Lul3GX4XcmRvp/Yc5P3SQ JwQzHvUqswdbB/SD79YSyMvIs/QSUDBvEND8votcaoJ4mQJCbZtqte1Hhaj1Lx1y2f8S atXfnWhYXcQD5nOA6CilxPcWqP2rBW8/dJ7Yb4ffzgSaN97g4GFHZYEkIpEu371Yfn40 28knbVA7p9e8jFI1wjxM9XJYiA2MAPUCj9xvzmKxAbzD7rE5PFELzOZ4eews2fQvGt2Z kYlw== X-Gm-Message-State: APzg51Bc4lt1jI9UZ9Q5y5s7Vf3ojTCaizqYlz6yLdEDjYB1w34puQjz BD/MNIZG0nJHkzxqPz6lp6snWA== X-Google-Smtp-Source: ANB0VdbSsex1y2ZqSJRinWn/tow2hwoiUOr+U6Mt7gKCh3qdE3OOHyCp78cosnNSvL8j2lYsgrD9rg== X-Received: by 2002:a50:de03:: with SMTP id z3-v6mr1749903edk.245.1536746060744; Wed, 12 Sep 2018 02:54:20 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id f13-v6sm690554edf.50.2018.09.12.02.54.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:54:19 -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, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org Subject: [PATCH v3 08/16] thermal: tsens: Check if the IP is correctly enabled by firmware Date: Wed, 12 Sep 2018 15:22:53 +0530 Message-Id: <140b054230a61e13995ae4b685746c8faf068d61.1536744310.git.amit.kucheria@linaro.org> 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 The SROT registers are initialised by the secure firmware at boot. We don't have write access to the registers. Check if the block is enabled before continuing. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson --- drivers/thermal/qcom/tsens-common.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 0b8a793f15f4..3be4be2e0465 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -12,6 +12,10 @@ #include #include "tsens.h" +/* SROT */ +#define TSENS_EN BIT(0) + +/* TM */ #define STATUS_OFFSET 0x30 #define SN_ADDR_OFFSET 0x4 #define SN_ST_TEMP_MASK 0x3ff @@ -119,7 +123,10 @@ int __init init_common(struct tsens_device *tmdev) { void __iomem *tm_base, *srot_base; struct resource *res; + u32 code; + int ret; struct platform_device *op = of_find_device_by_node(tmdev->dev->of_node); + u16 ctrl_offset = tmdev->reg_offsets[SROT_CTRL_OFFSET]; if (!op) return -EINVAL; @@ -151,5 +158,15 @@ int __init init_common(struct tsens_device *tmdev) if (IS_ERR(tmdev->tm_map)) return PTR_ERR(tmdev->tm_map); + if (tmdev->srot_map) { + ret = regmap_read(tmdev->srot_map, ctrl_offset, &code); + if (ret) + return ret; + if (!(code & TSENS_EN)) { + dev_err(tmdev->dev, "tsens device is not enabled\n"); + return -ENODEV; + } + } + return 0; } From patchwork Wed Sep 12 09:52:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 10597297 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 2A8A713BF for ; Wed, 12 Sep 2018 09:54:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A8C22982F for ; Wed, 12 Sep 2018 09:54:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F19E29837; Wed, 12 Sep 2018 09:54:55 +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=ham 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 A75CC29832 for ; Wed, 12 Sep 2018 09:54:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727002AbeILO6j (ORCPT ); Wed, 12 Sep 2018 10:58:39 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:41376 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbeILO6j (ORCPT ); Wed, 12 Sep 2018 10:58:39 -0400 Received: by mail-ed1-f65.google.com with SMTP id f38-v6so1246740edd.8 for ; Wed, 12 Sep 2018 02:54:52 -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=q7StzQyd+okywPPbXDjrtJCN5bAcIFHgFQlaxztz5dY=; b=bv1vaPdS27Frv9kiMDM1C8J0zLCjFcroQZ21iJ8vgCOocCsPIUyHTNVJ+Ur717+HcE +D+D1Efmfvvijv6BcOwkHJ6qhBKbVefkwuZyt9s/8oBrpDdpQcrP0HLWndHWzFixz+2X M6SiSfzreyp3uGwR0InXc1KXmJrd7kX1eW/tI= 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=q7StzQyd+okywPPbXDjrtJCN5bAcIFHgFQlaxztz5dY=; b=dsNre5ZBcKncTnX2TZfhAnVXzeHmqKX83P48v+a/bMNCb0ba+WXcCOheiAppNm2tWz siPqEoaiUMQlXFNMhuMsG/2Ok9fU9E7glI75PtFrmLsIA849Till1jS2HF+DeSnI098u E8/mrztKK/YVbP7HkAdjXpJW+8r+zaiGR0X34UL+oyoM5ogu/NnMrWfAMT0ERiyZLBSZ hYF1f+dVYSGGvfaXXajkBREtKLr7kdp9qQM2pUxKK+9uHQzwuniK9wW5HSCquUHS0D2B aHmim67RgAYdtob7mPMzEbsCbGh8qXBOh6ndnRXyD/0jQC+zRTsrv7rRKlHAeLQajG+D dbhg== X-Gm-Message-State: APzg51Ddztkb5S2xKa+jk4a8Bt6QPjDEuYqr5oDfNvlyLWORK1fOnsfx XzFMGoD7qP0yGxOaMqkzL4JWDA== X-Google-Smtp-Source: ANB0Vdbm77Mjkf/grj+hcc5T8y/aN9BwFRQLDqSnaD0UTh7LOTGD58oJldSSr1WKjRAD+c6ENGBVQw== X-Received: by 2002:a50:cb8c:: with SMTP id k12-v6mr1878289edi.171.1536746091680; Wed, 12 Sep 2018 02:54:51 -0700 (PDT) Received: from localhost ([49.248.190.214]) by smtp.gmail.com with ESMTPSA id h40-v6sm420603edh.88.2018.09.12.02.54.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 02:54:50 -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, andy.gross@linaro.org, dianders@chromium.org, mka@chromium.org, Zhang Rui , Daniel Lezcano , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v3 13/16] dt-bindings: thermal: Fix a typo in documentation Date: Wed, 12 Sep 2018 15:22:58 +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 c(1) + x(1) was actually meant to be c(1) * x(1). Signed-off-by: Amit Kucheria Reviewed-by: Matthias Kaehlcke Acked-by: Rob Herring Reviewed-by: Bjorn Andersson --- Documentation/devicetree/bindings/thermal/thermal.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt index eb7ee91556a5..ca14ba959e0d 100644 --- a/Documentation/devicetree/bindings/thermal/thermal.txt +++ b/Documentation/devicetree/bindings/thermal/thermal.txt @@ -152,7 +152,7 @@ Optional property: Elem size: one cell the sensors listed in the thermal-sensors property. Elem type: signed Coefficients defaults to 1, in case this property is not specified. A simple linear polynomial is used: - Z = c0 * x0 + c1 + x1 + ... + c(n-1) * x(n-1) + cn. + Z = c0 * x0 + c1 * x1 + ... + c(n-1) * x(n-1) + cn. The coefficients are ordered and they match with sensors by means of sensor ID. Additional coefficients are