From patchwork Tue Jun 12 10:54:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 138310 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5190192lji; Tue, 12 Jun 2018 03:55:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLZRYQqWL5qtlWkwbAh0AdWOrWacGqOgCYXFAnoJOkYN9tCGz0yynhQ2OiUliygrEQdDeG3 X-Received: by 2002:a62:1f45:: with SMTP id f66-v6mr3275192pff.253.1528800957605; Tue, 12 Jun 2018 03:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528800957; cv=none; d=google.com; s=arc-20160816; b=wl4wyvjiZVC9ItwOfiehnxP5xFPD5A015QYnk/W8ULwfHCNjoVlCqRgDiVtvxOnT3M RoBMj3KLyca2vQf19OY0V6ph/Orx74o1h4rz4cihwdwgF4mRLGwKGMMmXvoY5zmOTXo4 LXRsNvx2XyV/r8uarNOREB29vq3Cfi7vEYvKDXyckvPoiUx/Yf9ix4bwMOqG1F4KXz64 hVnWyQIoFPVQG5MW8SD5tlfGD8Q3ZrbHHqc4HBPCbAIh0mTG/YtG4xg9TlUT0isyUZjq F4aEVskd2DWJFIBO1gtENz6VAdQgiDASN/JHeNrf5jy5yjGmdOgWeChvZ7vAmAzwJHx9 8ZlA== 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=ZU3YeEU8NY37ah8kUZqdRgYcmcdIceilqJcD26/ugtA=; b=S+XyDi7gjQ0jVX9rW6r73RvXUrOqSTxNa+ahhLwRZAIkYu/3ufug1INo92+TyGrt3M wG/UmacsK7CvYP/vF52p7rg3EwiASBEI2wC/MLOz8oTNMgxOVUmYKDDy/hzV1helTarT Y56um8RoDrA7Kfu2Gyeg5+uxwWnHlz7w6hWk/MgYa9nkt2LHFQyUvFOxSy7kZMH0P7uZ w0cD7rNII57Ifd6kSzHIHnzMXF3WluduFehJzo8kNCMvDETwAI03CgDlfug8mdNa/S6r ZvMc/3/tHLIfZyOhxL8CnvuY0bXXh4weDdUlojKaOsIz/M87etV0Rf0nkmKKeFO48CWb zL5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TNCzBA9n; 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 g9-v6si628592plt.232.2018.06.12.03.55.57; Tue, 12 Jun 2018 03:55:57 -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=TNCzBA9n; 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 S933392AbeFLKzz (ORCPT + 30 others); Tue, 12 Jun 2018 06:55:55 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:38029 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933277AbeFLKzw (ORCPT ); Tue, 12 Jun 2018 06:55:52 -0400 Received: by mail-lf0-f65.google.com with SMTP id i83-v6so35293125lfh.5 for ; Tue, 12 Jun 2018 03:55: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=ZU3YeEU8NY37ah8kUZqdRgYcmcdIceilqJcD26/ugtA=; b=TNCzBA9nlVNF9zMGGflcePqzSP0AuUh5G5L6KQ11c4UonGfOQKgdcA1i4EKZDqOtNt jpLKEmGCXuBsJl/Z8Ut+mNU6BhTPmUDsQl8SGmRKge+8RupkVyglgHPNybmYoIGnH4kt xzdF/TeGj+zCjSiBC2RDNA0uY8kB4VuyLvvY8= 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=ZU3YeEU8NY37ah8kUZqdRgYcmcdIceilqJcD26/ugtA=; b=lfKhn8hUgO37UEshmq2dnbMNJ8F2NudoojgnDPy5/Zu/yP5bKUBljI9yLLDv5qxaEh 97LZx2ayAYhSyQra2D4eYBcK4j1/o1WlPFhQ6wnM0SFrN77JWW7OzJCmDw631fJ2xqjp gWya6UW2B2meArmvFHJUpzt24v1OilBCD7YdqzLI5fH8DjqZ9ziwo+t3x4kRfW3mJWql dYuMNKHG/Bs88q+hVQg/lsUXcA0H89k7mk2VJn+Jjz0N+3JDiUbO/sBfwxm3F++tvQAe MKbHzj+KdjVSG/iDl/WlOaKB+94ooGN4uBLEvp0lziPifHPaK7Qvwe+70bQCojzjvRPC P5iA== X-Gm-Message-State: APt69E0R5nc0rYisTu4dIpfvNk0I5gdU/cN7oAMATwNxm6gQ/ZGqbAgm DBUriu0Esgu+N/tWxeJoIl4qFLE2GJc= X-Received: by 2002:a2e:1d59:: with SMTP id d86-v6mr2145279ljd.104.1528800950694; Tue, 12 Jun 2018 03:55:50 -0700 (PDT) Received: from localhost (85-76-96-64-nat.elisa-mobile.fi. [85.76.96.64]) by smtp.gmail.com with ESMTPSA id o11-v6sm163996lji.0.2018.06.12.03.55.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 03:55: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, Zhang Rui , Rob Herring , Mark Rutland , linux-pm@vger.kernel.org (open list:THERMAL), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) Subject: [PATCH v2 4/5] thermal: tsens: Add support for SDM845 Date: Tue, 12 Jun 2018 13:54:56 +0300 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 the TSENS v2 IP block Signed-off-by: Amit Kucheria --- Documentation/devicetree/bindings/thermal/qcom-tsens.txt | 1 + drivers/thermal/qcom/Makefile | 2 +- drivers/thermal/qcom/tsens-sdm845.c | 15 +++++++++++++++ drivers/thermal/qcom/tsens.c | 3 +++ drivers/thermal/qcom/tsens.h | 5 ++++- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 drivers/thermal/qcom/tsens-sdm845.c -- 2.7.4 diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt index 292ed89..8652499 100644 --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.txt +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.txt @@ -5,6 +5,7 @@ Required properties: - "qcom,msm8916-tsens" : For 8916 Family of SoCs - "qcom,msm8974-tsens" : For 8974 Family of SoCs - "qcom,msm8996-tsens" : For 8996 Family of SoCs + - "qcom,sdm845-tsens" : For SDM845 Family of SoCs - reg: Address range of the thermal registers - #thermal-sensor-cells : Should be 1. See ./thermal.txt for a description. diff --git a/drivers/thermal/qcom/Makefile b/drivers/thermal/qcom/Makefile index 2cc2193..dc9f169 100644 --- a/drivers/thermal/qcom/Makefile +++ b/drivers/thermal/qcom/Makefile @@ -1,2 +1,2 @@ obj-$(CONFIG_QCOM_TSENS) += qcom_tsens.o -qcom_tsens-y += tsens.o tsens-common.o tsens-8916.o tsens-8974.o tsens-8960.o tsens-8996.o +qcom_tsens-y += tsens.o tsens-common.o tsens-8916.o tsens-8974.o tsens-8960.o tsens-8996.o tsens-sdm845.o diff --git a/drivers/thermal/qcom/tsens-sdm845.c b/drivers/thermal/qcom/tsens-sdm845.c new file mode 100644 index 0000000..a647265 --- /dev/null +++ b/drivers/thermal/qcom/tsens-sdm845.c @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2018, Linaro Limited + */ + +#include "tsens.h" + +static const struct tsens_ops ops_sdm845 = { + .init = init_common, + .get_temp = get_temp_tsens_v2, +}; + +const struct tsens_data data_sdm845 = { + .ops = &ops_sdm845, +}; diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 3f9fe6a..314a20f 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,sdm845-tsens", + .data = &data_sdm845, }, {} }; diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 80b273d..e4c0a38 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -88,6 +88,9 @@ int init_common(struct tsens_device *); int get_temp_common(struct tsens_device *, int, int *); int get_temp_tsens_v2(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_sdm845; #endif /* __QCOM_TSENS_H__ */