Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1436293imm; Thu, 12 Jul 2018 01:42:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeyUSiZVU10MJLto2bqqzC1HvxNZwRucVz8hWevC7hp8rOnNdg0EQprAk3WN8NcbKcq0yLF X-Received: by 2002:a65:4c41:: with SMTP id l1-v6mr1292171pgr.310.1531384927452; Thu, 12 Jul 2018 01:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531384927; cv=none; d=google.com; s=arc-20160816; b=wydo6heME9yhRMoQKXKLzU2Xhe9v0VYLL/EzC7dOYAR6FapTkAiZaeN/+r/Ltv5nnm isTuTXQIfx7BklKd26sM64J7y7kjUSVUXpdcCTU083MgoDBE796FynDCKRJbB1VZdJsc ytJyXRAORloZpzGMgcVp+qr5rDm1B9LYuZSOOEsmWVI+lmS/2k0Qck1+i6QYleinz817 zKR4/ZBzRnMkc3qqRDykhEqP0VYWwwUWTEyYf76m77xZhU1xHncX1nLCWz26mtiBfg/L vMoChkheZkHzwGXd3vb0kjAkKYWOv4dK04KxHAm6hJshYAGuEKmhrEqpB/0zYdGVit94 w70g== 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=/Jcia/6RdTo1f61k1V6jn6EIFW590aCTA6rf2xM6d8g=; b=QfbOEsRvKDNG/lnj6j6b+AUznMsdc81yOQxECiAwa5NQbB1re22ST6UFxYtoJXupB+ mFN0h5oYIg1fb/kJxOROVj13F/k2cIyesQasiY5hWpZ3AZZaFwZRUzvCwgild+zT5NyV BKk15uDULw0ZwaoO3cVKgg85Tiy4704rgxcJ6Wme2+xZ5Vxj3vAGt0Y9xuuSUBX0pJQd mz+Polq2ecHLFVcBMqTwN5mUSRGNGV831IsFPDrS3S0hH1UlwPrtR0PNXGyOK87VplA9 dBpHNWvcG3SwF0wnFV5t5rSI4m4Fb9rmvgkWp+vUF2aTPCACres2y4OBwX6TmGKlvMqV Diog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tcb3f1EJ; 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 g7-v6si20832069plt.149.2018.07.12.01.41.52; Thu, 12 Jul 2018 01:42:07 -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=Tcb3f1EJ; 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 S1732499AbeGLIsr (ORCPT + 99 others); Thu, 12 Jul 2018 04:48:47 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34517 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732484AbeGLIsq (ORCPT ); Thu, 12 Jul 2018 04:48:46 -0400 Received: by mail-wm0-f68.google.com with SMTP id s13-v6so1484077wmc.1 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=l/iK4RWjs1gBXdyRlxDFty8hwaj4Bs7ZXbp8e1FpmfKlEfGYSQ8zaZFKvF5FCGTfpW +ohGg+6FPzcCKnjB+2wzSFd+zcsNhpP6R3+/44bzQjaJorTMjTmqtfgPETiwGMbp6Lba f9AI7/J43KgQlG8Q5pnuUqUdG1TmBHRDLKLRx/ahpnan5hHNPZgOfSIhstclhFxXktQb OYinmBKz8HsIfWVRiBPNpwNhztiPKmv2aknmRXgnilBqzWWOKWDuEFxe2NO+Yn4HkPon IcKkH2ea5fEUvHLR3/Y2zesjqKTSogt7QVKQMaZBmQZhSa8xxKF70l1yWI1moWYNpTgG JjmA== X-Gm-Message-State: AOUpUlE1phpA8RDyt5aFYAxFyn6mmeS+GlhK8jJq6azmsn+RTCQH2E5Z yGsE4vYe1grFnWv008JVBXqBUWrMJ+g= 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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%) 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, }; -- 2.7.4