Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp180464imm; Tue, 17 Jul 2018 23:46:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfHNSbyLt/ZUs3AGe/o1V//34oTu9wLCJvCCJZhMjrQ8EcM/3o6K9C5WY1cwSqHwtdeUMIz X-Received: by 2002:a17:902:a9ca:: with SMTP id b10-v6mr4726091plr.275.1531896385213; Tue, 17 Jul 2018 23:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531896385; cv=none; d=google.com; s=arc-20160816; b=POgOaUp1qYmYlEjupQgoqdv/cLR+oYbyBqnmREuR2LJZrgMrhG9pJRSETZ7f/m2pyj 6IRArCeyS+0WM5e3HfMuym9l1osGuMN2Um+/EE40RxFX/7qyFrAXnhlK+IetQYjh/Jpf hWE6/XWqErzQWIcmq3uoWFhWzR7sagh1GPexX9T+uO0SZ5W0mRJzJnpQhk8OWpEdxuCV yfxiqDlHip6vf+sdgrQ4y8Pd2LXFpeb8R10Lly3UQAcw5k5HcT7HoXxKtXq9gvNW+EJp 4/5BDvxm5eyu2IEBlrp5Hotj3GJ/8v8I3a3uxJsNyOwlm/l0ZrP4EFSqKWdAKrLBhJBx uvOA== 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=v7ifTUzkyvVtGx5wt0pGx0Zah3Qa2i6PSQqCHrSBSkU=; b=cZcF5O6JTEpJmVBlCSdvPlqpTqT0xBUIAyX8LYtPRIJR9ZGE9juYLMLlhNNGrz5ITn MCUBy7GqVhc72Av0Bdomz6yy8oOnpZnSAI+kINUQsVReULMVRYcrnNyyWLhMOz1WIIYu QlKvOTim8nlkym/ZyQJRtBm8Omwp4oM2UlvAJ52ViEl4wio1LNYC9PCi+11ryKO+eTm+ Q+IRPT9s1uz+ixPtb4trnK9H+/1woteePFDbdmgTELIby5e9hpa5eU+VU80pFvyrnwru DcEw3aYRpTMpBe5ov/3wyNc/zmFw1oMkWtu60QIilNbqXnenoBt5SLHCgDh87SNDzueL bZaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T6dmlguk; 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 b2-v6si2830135pge.114.2018.07.17.23.46.10; Tue, 17 Jul 2018 23:46:25 -0700 (PDT) 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=T6dmlguk; 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 S1730094AbeGRHUo (ORCPT + 99 others); Wed, 18 Jul 2018 03:20:44 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33787 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729753AbeGRHUo (ORCPT ); Wed, 18 Jul 2018 03:20:44 -0400 Received: by mail-pg1-f196.google.com with SMTP id r5-v6so1560362pgv.0 for ; Tue, 17 Jul 2018 23:44:25 -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=v7ifTUzkyvVtGx5wt0pGx0Zah3Qa2i6PSQqCHrSBSkU=; b=T6dmlguk24aBlZ6ctNglJS2Gx1gJKrcspfIbnkRUlXpf8SpxJ8Pet6vtzeqgDk236u FNKKjFonXyOUrsOV/UClu7WRvnvjsIYoWuE2oN+g+DVoUxeBzCZbPqBnSrzRr0rDCAUC aFEKf5fwFV4B3CPie6AUKSiCFEJkjpbEN/bQ8= 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=v7ifTUzkyvVtGx5wt0pGx0Zah3Qa2i6PSQqCHrSBSkU=; b=tvil6M/ZlZJ3lvYS4q0XBRfV3SxErCIDmSWeYlSETdudS8zqL6A0S0eh/0L9y8qWFH 4Q81rbbK/CeEVBmRA/vUIJi+5eHa8dHF4lSpNkfR7+VgX7iAKlYYOlWecanIWXb6IBU0 8pW8yr41MSinO0yeJ/D1c+bbnbPqcrrxTonp5+hzeGHn7CyV7O6BBSYZi6poqfQOFihR 2eE9fKa1ZvqDM70KweuUl3OO5yxY+XwR0i1/v3Gg/AcEqx4UKxMJjTvtKKAOnzI2czVh h6Tq1XiPjzET3TKZaz17kn0L/XKQIIYNiRIEkdUsRFR/Q+s2HiLvIwYLXSjzzfByxMw/ Xa3A== X-Gm-Message-State: AOUpUlH/ypWMsZnX3uZjvUZrqRYIwTggRMzpXMW2zh6sFOlY78uyiitX wscTxxXDtMleX3FR7FskRIE36WnUuTo= X-Received: by 2002:a62:4a41:: with SMTP id x62-v6mr3951433pfa.45.1531896265134; Tue, 17 Jul 2018 23:44:25 -0700 (PDT) Received: from localhost ([103.249.91.115]) by smtp.gmail.com with ESMTPSA id z8-v6sm4054244pfe.163.2018.07.17.23.44.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jul 2018 23:44:24 -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, dianders@chromium.org, mka@chromium.org, Zhang Rui , Kees Cook , linux-pm@vger.kernel.org Subject: [PATCH v8 6/7] thermal: tsens: Add generic support for TSENS v2 IP Date: Wed, 18 Jul 2018 12:13:12 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 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 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 Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- drivers/thermal/qcom/tsens-v2.c | 5 +++++ drivers/thermal/qcom/tsens.c | 3 +++ drivers/thermal/qcom/tsens.h | 5 ++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index 44d3736..f40150f 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -69,6 +69,11 @@ 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__ */ -- 2.7.4