From patchwork Thu Jul 12 08:39:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 141804 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1242190ljj; Thu, 12 Jul 2018 01:40:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdsF5WvF0u+q0AbQ6XXzFGp6XD9jmZap41dBzSXXYsfyKPpEw0qzhoQVMflS6VRmORD8zII X-Received: by 2002:a65:428b:: with SMTP id j11-v6mr1240391pgp.200.1531384813172; Thu, 12 Jul 2018 01:40:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531384813; cv=none; d=google.com; s=arc-20160816; b=etS4+Sg5WPTpsl04DwUZ3Bm9Va7vWYfwQo8pysFPbia4Gpu57ftmfnYGpFlzc4AiO6 VJF0vlWgF0yCvx1cVP7c2xNWeYYLpQboQU5XA5W1Fk0WSGg1N7kxbDl8oNo4aDXqIvl4 9AA5WvOuxCyzoZMzk3Z+RWuMCpSbVqAnEBu6hs3ihrrAyowu8oLrgc71rjrEpyGcLVPC m31j1jnvyd2hNOn8pW93Lu347xoV6I4wVambJhMBRO+35CT9xZoZd3D92KQEScl3QSaF r27cxg+buvnDTuF3YtqZXBOgJEqQZ8w09ig8x7c+OdKHPdBMcuMoRGbV6VkJxEo0EKnt HZhA== 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=0fzH3pVjhD56x3Jj0wgn5u0Bcn1PKQEEcsMM2JK+1Fw=; b=nQUamjDKrNSy894TG0/xG5zorpVD5yGfoindX5PZ866vio1trnqU7wOuW0IUdBnEo3 V22MjInhgUe86dKpcz3iIG/zwioLATDY4LnKEuRQR6AhGa0Oc6tn8MDAkHPRD6y+QJwb ClSrI4nSCvk/y3FIylYlmdDyvmQAWNdLlLx1Zp1fV9eVLQ7Xdu0kF9JOJ8eLS9qHP67g WuceaE1pVjPr1SNffQ0cvNSrmU+hCwHPPGVzuCqZaP3Sg5pl+MHFFSct7TxKoBQNqmvp HoLaRgqmOAAqCTQheK3Kpttabq16zVopiSIZSUghcIDjjLuXL7X0uYBo3CBujfn2wYPs VdlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Tcb3f1EJ; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (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 s22-v6si20930307plr.498.2018.07.12.01.40.12; Thu, 12 Jul 2018 01:40:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Tcb3f1EJ; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732488AbeGLIsq (ORCPT + 13 others); Thu, 12 Jul 2018 04:48:46 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33284 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732449AbeGLIsq (ORCPT ); Thu, 12 Jul 2018 04:48:46 -0400 Received: by mail-wm0-f67.google.com with SMTP id z6-v6so1488772wma.0 for ; Thu, 12 Jul 2018 01:40:10 -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=/Jcia/6RdTo1f61k1V6jn6EIFW590aCTA6rf2xM6d8g=; b=Tcb3f1EJ1khAr5wXHhY6J/8jm8GT6vjNrKuf7orWkO5GIP1AH+8XsXIJ67qgBYznt4 li84hbj0LvP7Vq6OGQkZpU1jOqeCepOtn0MaX1Hpb0qV7KY0q/+wSZ9Han1bS7rGu3wz f947CHj093qKhEEycz15qsMxdfS7uc2gAJqNI= 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=/Jcia/6RdTo1f61k1V6jn6EIFW590aCTA6rf2xM6d8g=; b=CUHzKOW7ZnRYKNrKIpTUWDpXo9WQIGp3xXAFcoshIQKEJgoQHXHfetM9K+9nffyJbD mHX41aUlua402ZH2nlt7Mo1Axh41xKnpEgavg2XZDslN1BYgDdflxFm1BysdavawYtzK yz1rejN/rm+f6LmpalrxWndAVBrAwyi1GD9OPauNg2Xi3O0OOyUY1IaoxO22L4EjLQcg u0whX4S2bPFHTgNjAjdVN+RCtCZF62NamyCPHmjr0Atu+lIT9R8J6Ky4tT5GAJIcRJe8 KtgcTWa9DOce0qAssPO0wDmy72L5+zrMNDSAImXr3Surb73h5/8wr6F2li9qiYdxGk0X fEIg== X-Gm-Message-State: AOUpUlFkYsTwwxR+c+k8W2yaw6zUz0/VG2Sxt8PfnuPNYeMMokEBO86Y tkX8jqwpxQqqqVnUcLYQqzTH1g== X-Received: by 2002:a1c:1802:: with SMTP id 2-v6mr696778wmy.81.1531384809847; Thu, 12 Jul 2018 01:40:09 -0700 (PDT) Received: from localhost ([103.249.91.93]) by smtp.gmail.com with ESMTPSA id r17-v6sm22764677wrt.44.2018.07.12.01.40.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 01:40:09 -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 , linux-pm@vger.kernel.org Subject: [PATCH v7 4/7] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse Date: Thu, 12 Jul 2018 14:09:05 +0530 Message-Id: <3bd2c05db1bfe6fd3891abd87b0c767152346a1d.1531384019.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The TSENS block inside the 8996 is internally classified as version 2 of the IP. Several other SoC families use this block and can share this code. We rename get_temp() to reflect that it can be used across the v2 family. Signed-off-by: Amit Kucheria Reviewed-by: Bjorn Andersson Tested-by: Matthias Kaehlcke --- drivers/thermal/qcom/Makefile | 2 +- drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c} | 25 ++++++++--------------- 2 files changed, 9 insertions(+), 18 deletions(-) rename drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c} (66%) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Matthias Kaehlcke diff --git a/drivers/thermal/qcom/Makefile b/drivers/thermal/qcom/Makefile index 2cc2193..a821929 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-v2.o diff --git a/drivers/thermal/qcom/tsens-8996.c b/drivers/thermal/qcom/tsens-v2.c similarity index 66% rename from drivers/thermal/qcom/tsens-8996.c rename to drivers/thermal/qcom/tsens-v2.c index 3e60cec..44d3736 100644 --- a/drivers/thermal/qcom/tsens-8996.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -1,27 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2015, The Linux Foundation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 and - * only version 2 as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * + * Copyright (c) 2018, Linaro Limited */ -#include #include #include "tsens.h" -#define STATUS_OFFSET 0xa0 -#define LAST_TEMP_MASK 0xfff +#define STATUS_OFFSET 0xa0 +#define LAST_TEMP_MASK 0xfff #define STATUS_VALID_BIT BIT(21) #define CODE_SIGN_BIT BIT(11) -static int get_temp_8996(struct tsens_device *tmdev, int id, int *temp) +static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp) { struct tsens_sensor *s = &tmdev->sensor[id]; u32 code; @@ -73,12 +64,12 @@ static int get_temp_8996(struct tsens_device *tmdev, int id, int *temp) return 0; } -static const struct tsens_ops ops_8996 = { +static const struct tsens_ops ops_generic_v2 = { .init = init_common, - .get_temp = get_temp_8996, + .get_temp = get_temp_tsens_v2, }; const struct tsens_data data_8996 = { .num_sensors = 13, - .ops = &ops_8996, + .ops = &ops_generic_v2, };