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__ */