From patchwork Mon Jul 9 11:43:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 141391 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2563543ljj; Mon, 9 Jul 2018 04:44:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeXq0EkUSgLSg9JcWgociN0/HyJPGV78UayUxGqkL05uxjvflk0aLqEIls/+boeMffl7CwK X-Received: by 2002:a63:ec14:: with SMTP id j20-v6mr18338132pgh.28.1531136674132; Mon, 09 Jul 2018 04:44:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531136674; cv=none; d=google.com; s=arc-20160816; b=P7l/zmzC6Oc6lrSh9VcEbbfrv8jUcoIK8gjuDpY+LucLK3dXWfi+JVRAu28ApMQ5cl BkVIxztuGvET0TZWYcPY9Ky/v8WtjDdTZgZQ8rR+fFnyyfFxwhje6fop2gaMGj85qegP 1tyj7YEe7S5XzqLLXx+3fQcwMC5Uej1D9w4cs0RDUfqiHQD3umOVmAmGyyqhCikqt4z8 TghmHNlljGoy0D09H1kBl78kd5VBQr/r6lboTs7HSGZHl0GILHEs0nRzj2yA5v8ZWEL4 izBCID7W5XfnOVrHQKbiMWbi9/ZRBHGldisliywFUYZWVu7YDQ1dbu9zSh8qv3bFcXux cFgw== 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=waIFvzDguuQC4xv4JOvFY7/OKpEB8t2EgrXyCL6I2CPDjgkUq5Zv6pp24gCWMgLJ/a QEK11itJnxlV9vuOtaw1b76MpCaJMvtNoebvYiYUMTVWQ15SU4bAieFltdlyw9ampjc6 j38iIQ1fQBnxIInb/2CaHhKii9TY+axfavrBNrN3Xe6so2d/jdP2rIpIYID3DvCBto44 RjZYN+4XBEcMhS3QDSwQtTbwDZjyfvcPy8SxW1qxjSB8DCh8XBhRomlJBZYgX1FGxtzY vCSMK/ekxKnZUsqCh0sIR/+ejxNW/j/irkAsHG2A2a3nLFldYKQqZChuR0CjUIOoI/yA ndig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cmxIMbpD; 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 a9-v6si14053314pgn.177.2018.07.09.04.44.33; Mon, 09 Jul 2018 04:44:34 -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=cmxIMbpD; 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 S932887AbeGILob (ORCPT + 31 others); Mon, 9 Jul 2018 07:44:31 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33226 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932842AbeGILo1 (ORCPT ); Mon, 9 Jul 2018 07:44:27 -0400 Received: by mail-pf0-f195.google.com with SMTP id b17-v6so13510843pfi.0 for ; Mon, 09 Jul 2018 04:44: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=wik4a7EH1S7fZsbVdZxGmOdjNtd0gVTKmBfpirkIe5U=; b=cmxIMbpD8tI6sHlYKfOGZTrtpbKOXwRQAZpFgJ7Tmng7kIAQwvzxbrapIaZqYRwktU vCHpfBelrhTc2r+ApsBGPEQ/DYYGVl3+BInYKvh+som3IzeI0W4wcrty+F66xvaBS6yf sQ/r7HkoUE704DVuLzOvIkWaY4248qLY3h/F8= 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=Vqif4Uzl/vwQEKulRELbMPXp1WuAIZyzu7JLat+LS1JxcKV9A2PBbCCIuqtUww6BwY EIDIca0jFtf3pl2/jVnCbPxu0bmy0lzbAgfXEwgScHsfGTw4r0ouJcACihctdS7sGEgP 1l0CDjyfm1H12X4EH4dufpcR9o4wFS5lbpai/WJMfpQFY7Unb378wmovRldGOokt00KX p7XGdbzRw/j8wrfeXiU91a0D7cClSLEU85zqr/c/U9o3BAbpzGWGe/V2GNKN0eh52met UAmHXH1PrZe557gqvnUifNJChGsCf38hq6ssD7gDZ81yQOg4xfy4G/E5EsnMxS57ncZ3 QZ2w== X-Gm-Message-State: APt69E0Mk6lt95XMUIgB2oa/m0nEJ5tWMcbGi4+lFoXN1ELnz/IWP7aP PaLks4jVQKmWLsTHpc27OX8ci5S3SNE= X-Received: by 2002:a62:c00c:: with SMTP id x12-v6mr20946530pff.216.1531136666907; Mon, 09 Jul 2018 04:44:26 -0700 (PDT) Received: from localhost ([103.249.91.93]) by smtp.gmail.com with ESMTPSA id z10-v6sm23139630pfh.83.2018.07.09.04.44.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 04:44:26 -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 , Kees Cook , Rob Herring , linux-pm@vger.kernel.org Subject: [PATCH v6 5/7] thermal: tsens: Add generic support for TSENS v2 IP Date: Mon, 9 Jul 2018 17:13:27 +0530 Message-Id: <278b59d6a25f874a087995368cecec2572b5be89.1531135999.git.amit.kucheria@linaro.org> 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 --- 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__ */