From patchwork Mon Jul 9 11:27:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 141378 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2548254ljj; Mon, 9 Jul 2018 04:28:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflSYP9r42pP4rqBwlsl7+hZHuCf55M0PR72vDR2U5L9h8o5W9aX7P1VB8kPcYc9MYp45E3 X-Received: by 2002:a62:da07:: with SMTP id c7-v6mr20898645pfh.106.1531135697262; Mon, 09 Jul 2018 04:28:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531135697; cv=none; d=google.com; s=arc-20160816; b=Kbsm7LugDJnBKiud2N9NwlFRHJEtWHVPnt4kWceFJTI+yMHdvepbaZvBstm4jw/amU OiFM4HpEHQR72Vk5po4Aq0MeeJkjS4+APM5Obtn/qb7k4ghTs/7Zxe3dl31AHQ5f/1kW 1o1xUfrQ5zwgRBMohBmxxlV/6S7M7KMaG3K8TLecDC4/yy/lUn5MNsLQC8hHdsMSp509 BKctdlhNky8STA8RXJCIC6tbS0xvPk52Ele+yAaIajrSNaLn+Tly7y6d9t2VXXxCB5Sz m8bPyBdo+l2hwa3+zQSqUNII+M8n9kZi5oH1G2qYc731j9LEvrAXWOpz24wTBYIta2hQ 0gFg== 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 :arc-authentication-results; bh=RqHvCXWgQNEn4X6AU/ZqYttyBtBVtMakbjX0moav5Ps=; b=StU1s/uTt0VVfiIFBo4oNV3zRRyIp2VrndITkEmFVeKPF+AacHxGG8f502ULYw4apc ZL6mMvLWrgU6JRQdn1pZUsrXjV6vm1/x80e31RVKFjNG0jTw3Bmc2IvdkC4J3/2FFJXR Bs3FM3xkaGRgRCi0koTE9ccv/WV5+cFnts2VT/KRuhDUWSWrWRtyo9npjPdK03TBT+Jf 3X3at4H80OiDwFG+WruVJNFSwl5dmuYB8Zaf1hBfe3Ev+mMvNCz+BaLURPdGMW4/g5cZ rEdwhzvY79gxmcvI56zHwc/g4DpxPb+fCJ3EHtFg5NkF2wQX85bO5+xcTMBV9bf5127M QBpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZtbkqstD; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 h21-v6si12323264pgi.430.2018.07.09.04.28.17; Mon, 09 Jul 2018 04:28:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=ZtbkqstD; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S932617AbeGIL2O (ORCPT + 10 others); Mon, 9 Jul 2018 07:28:14 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37043 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932583AbeGIL2M (ORCPT ); Mon, 9 Jul 2018 07:28:12 -0400 Received: by mail-wr1-f67.google.com with SMTP id q10-v6so10595874wrd.4 for ; Mon, 09 Jul 2018 04:28:11 -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=RqHvCXWgQNEn4X6AU/ZqYttyBtBVtMakbjX0moav5Ps=; b=ZtbkqstDXIt1wd5jPPhvSO45ko4JglnNNr11mtK/Lw0Kz48LhzxWr5wgqCP1WJySjv V+TPJ+o2DIiCz3EovzkQj8lPyV613gltVlezLBvs/cVvyC3ksQ1jmfHHMG+8yVCj+2pY 8RkfD/UIOvf6YNVT5t+wEipIPjQ5090z6psuc= 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=RqHvCXWgQNEn4X6AU/ZqYttyBtBVtMakbjX0moav5Ps=; b=g/Xn7Y7FlsrEOqVSxD9fkbpsJbIwyRKbrVRXzOS1DQEqpO+lJdEzBvqnJw7tiYeZ3D 8Cbqe6uC6gKIwpMCGRcQCmPeEWXMGG+agQ6s1Vv/9rMS/1ylAE/1Rmy+oOZVpQmOlUsa kP7O79yJpSEsHs8+aYqTXLINDovLQhVS73sHQipP9AQdGp6Gdka9vcgXIG1I8fXkvWzU WImo45IliQB1tH9cgsZh6DlK9ANXNRsUg8sEsPbXCcUMkA/U52aHWVcmZKgmaphZQ7CK fz0q9AfiAQDb2oeRJpbCQtHj+SDn44SDN5mBgyUUckPXPT/yMnbCp0QWpMLwVmzBNVR5 FDvg== X-Gm-Message-State: APt69E3iMboaE2gdkcaFAVeFkUN7bDlRCf7reJ1InaEQpcjgMeRHsJmw 7LhNuM8rVEb2brW/xESlI3gYCg== X-Received: by 2002:adf:9d1c:: with SMTP id k28-v6mr15390586wre.29.1531135691055; Mon, 09 Jul 2018 04:28:11 -0700 (PDT) Received: from localhost ([49.248.189.240]) by smtp.gmail.com with ESMTPSA id u135-v6sm1981330wmf.2.2018.07.09.04.28.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 04:28:10 -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, vivek.gautam@codeaurora.org, andy.gross@linaro.org, Zhang Rui , linux-pm@vger.kernel.org Subject: [PATCH v5 1/7] thermal: tsens: Get rid of unused fields in structure Date: Mon, 9 Jul 2018 16:57:34 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 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 status_field and trdy are unused in any of the tsens drivers. Remove them. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Acked-by: Rajendra Nayak --- drivers/thermal/qcom/tsens.h | 2 -- 1 file changed, 2 deletions(-) -- 2.7.4 diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 911c197..dc56e1e 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -77,9 +77,7 @@ struct tsens_device { struct device *dev; u32 num_sensors; struct regmap *map; - struct regmap_field *status_field; struct tsens_context ctx; - bool trdy; const struct tsens_ops *ops; struct tsens_sensor sensor[0]; }; From patchwork Mon Jul 9 11:27:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 141382 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2548765ljj; Mon, 9 Jul 2018 04:28:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcBNvTE0uQYv3vsa0KZ0sV37GIseXqioqbIXqCtr2yCq9uFbO0V5NuA4sUYPV+yBaL4pDqo X-Received: by 2002:a63:4203:: with SMTP id p3-v6mr18533803pga.184.1531135735635; Mon, 09 Jul 2018 04:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531135735; cv=none; d=google.com; s=arc-20160816; b=WkC14ExVJKoakBCV35nC8Rj7quA3ZIM+WbRarycBZTi3Isq+01vOL/rowoCTLoLgmS YGmz6/5bycWA/I05OPXX0pMj0w8wa+tJMSqKeNDiRQv1M6h/8loy/mNGAs1lmszQWAbU GWE22D7WNhRFjuP377PeQC10iVcYn/vIuuB0XaIARkTWtyWpJvf1hE4rI9phuwNWFKrQ clNftsurYqycpl8Zl8voV/PxZDqY76v9uaWa9lYIeFWvUFAr4+4Fgdq8CZ8QEyN7vpHU 1AI5usMyjtNWrysUMU7Syh4xFQFMuhgUSfQyr1/Uz5/IADnPJncrTqQjEQxt0dfszDyW Q/gA== 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 :arc-authentication-results; bh=wik4a7EH1S7fZsbVdZxGmOdjNtd0gVTKmBfpirkIe5U=; b=eMx+yyqB1l02GVS71nGJht8EG5DMZn7aVS0afEv0j6kumjjagqOm9nzxVpoXoaSLoJ W/225YM640h9S+0he9l60xShV4SIstd2oR3Uqb8sqrUt/wWXJlcGuoUhER2B2w9+/T1P GPQ6eaKsmRPuyCwZnQd71cnxagQYTN9nZyjdTRdMAUnWJo/rZ2lqYEExQCtjvTYN42W8 4ep+L37F5nb+J/FnzBGyvdLUrZJeAdhYZCJfcjIDiZavxGAYprFTZmpzle8kPi+a6Hyx LIr+xyOR0+39dQosKToChPKFqUZgYu7LNf9Xr/2cg6Nwefrux9sJDc0IUDlR5GAAaor+ fdQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Avs/+0JM"; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 h25-v6si9711323pgh.119.2018.07.09.04.28.55; Mon, 09 Jul 2018 04:28:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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="Avs/+0JM"; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S932940AbeGIL2x (ORCPT + 10 others); Mon, 9 Jul 2018 07:28:53 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34623 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932601AbeGIL2v (ORCPT ); Mon, 9 Jul 2018 07:28:51 -0400 Received: by mail-wr1-f65.google.com with SMTP id c13-v6so10556134wrt.1 for ; Mon, 09 Jul 2018 04:28:51 -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=wik4a7EH1S7fZsbVdZxGmOdjNtd0gVTKmBfpirkIe5U=; b=Avs/+0JMgpotgk9mBEh+JoC/aewIrEjzDltB1HmwrScXyGcWwBfKEhsMomjGQ2ZyxA p7S8UjGgLgmOqxokWDSNpy1MJ3lJ+/koJzO7P0O+NIwxLeQUSskEt5RMT2DOfePbT3Q+ qoT4UMBWIb3n63/GeBOKE1p0oRfLdR/4ZAZ24= 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=wik4a7EH1S7fZsbVdZxGmOdjNtd0gVTKmBfpirkIe5U=; b=gGqvC/Dle4hYiyfJ1OKIZk67ct3h0Po7wf5B9w1+r89HW4Lk6qVlixSFDHut4JEQtX 8dr3iqRNLuCvuRrBZsyGKAHQaWkxENlCz5qQ+Po0JmhwTWBZOmvuQdabEg028f9Wiv+U eokw1hyVjQCs4TdForZTb5rhBiWXqD5lYlf2T88B/l7H7VoKhCFySoSOhOJrhhKoLnvb CG9Qu5q1MmZSMtOJndTPcfvFnxEoYA3tV6hvJK2Jk0T0Ql3Jf/L7dI3OQrsG6DteLp5D y682oQzIPwymYFGeYgsBFcOdVJ4OCZPawep2C0poLp5Tz12vK/KiOHjCUtgXDs+Rh5m1 y4iA== X-Gm-Message-State: APt69E3WAKNBLS8Wfl6XyFTQrimyAekZnwyTf7VByZ68eSeVss4AbhIK mz3sv8evJB711N4DAvhDEI7pqQ== X-Received: by 2002:adf:ef8c:: with SMTP id d12-v6mr15581410wro.195.1531135730658; Mon, 09 Jul 2018 04:28:50 -0700 (PDT) Received: from localhost ([49.248.189.240]) by smtp.gmail.com with ESMTPSA id w2-v6sm25161592wme.45.2018.07.09.04.28.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 04:28: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, vivek.gautam@codeaurora.org, andy.gross@linaro.org, Zhang Rui , Rob Herring , Kees Cook , linux-pm@vger.kernel.org Subject: [PATCH v5 5/7] thermal: tsens: Add generic support for TSENS v2 IP Date: Mon, 9 Jul 2018 16:57:38 +0530 Message-Id: <278b59d6a25f874a087995368cecec2572b5be89.1531133612.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.7.4 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 SDM845 uses v2 of the TSENS IP block but the get_temp() function appears to be identical across v2.x.y in code seen so far. We use the generic get_temp() function defined as part of ops_generic_v2. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-v2.c | 6 +++++- drivers/thermal/qcom/tsens.c | 3 +++ drivers/thermal/qcom/tsens.h | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index 34ba6c7..f40150f 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -69,8 +69,12 @@ static const struct tsens_ops ops_generic_v2 = { .get_temp = get_temp_tsens_v2, }; +const struct tsens_data data_tsens_v2 = { + .ops = &ops_generic_v2, +}; + +/* Kept around for backward compatibility with old msm8996.dtsi */ const struct tsens_data data_8996 = { .num_sensors = 13, .ops = &ops_generic_v2, }; - diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 3440166c..a2c9bfa 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -72,6 +72,9 @@ static const struct of_device_id tsens_table[] = { }, { .compatible = "qcom,msm8996-tsens", .data = &data_8996, + }, { + .compatible = "qcom,tsens-v2", + .data = &data_tsens_v2, }, {} }; diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index d785b37..14331eb 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -88,6 +88,9 @@ void compute_intercept_slope(struct tsens_device *, u32 *, u32 *, u32); int init_common(struct tsens_device *); int get_temp_common(struct tsens_device *, int, int *); -extern const struct tsens_data data_8916, data_8974, data_8960, data_8996; +/* TSENS v1 targets */ +extern const struct tsens_data data_8916, data_8974, data_8960; +/* TSENS v2 targets */ +extern const struct tsens_data data_8996, data_tsens_v2; #endif /* __QCOM_TSENS_H__ */