Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp180400imm; Tue, 17 Jul 2018 23:46:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeIAxddeJJyQRFFbBvqXjqOKbBXf/iU1d4+gLelpUP62ER0Os5QQe/8U+8MmodAbS7ovP20 X-Received: by 2002:a62:c1:: with SMTP id 184-v6mr3993722pfa.100.1531896378906; Tue, 17 Jul 2018 23:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531896378; cv=none; d=google.com; s=arc-20160816; b=baaaamgEs9rt2nJaAqgvEqzRomPsebrPDFlkxNTWqoteaNpI75g4nqUUc19sZFRd7+ UdwP01N3ghFgzp1dTuc/7Is1iSUeOQcW33/NgoVwQmljwWkrV0/XecwzLRjR/pUE+6X7 5s2Pnoe3h2CftrlLR5Dv3GJXU4166Llv3YVTCSYFzgoxjM8rfD90CprKY/wqC+4WnidV 1hB6JAr3Ntk+EanLMGEUonRyOziEQYO4tjC9ltg8wQAibWBUNYP6ckq91Fhn+zJs378+ /lct6lk5hd4kh8wFySe4yL89ps3iFCqOpofggxNa/t9Xd+LBei9FVIGn4i1a1BW7Jctl mGOg== 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=raVj4mm1Q1ZaAVWpnDqhGG1LI3uXrzTE+7YpEmBVaYA=; b=tAxSJyoAstHgluyN9Fj8O4TErFt2+dHOj0G/MrGg3g5kq6cw7MuYVvlKRj47XmUdOT 84SqjpymAdwsthqfqkf+XSLzTccaPed72Nt/EvnHDoUiq9nlnP3xY163Co5+9jnCmpFG wwB+EPeTF+9xS1R4TzAL4V1Q03X4CMvbZkUxljMnvib1C/BHOoytG692jHZ6QTPIuL8U yXW2xYrTydQHoC+siGUG54J31NpeVxbBm4xM6H+1pBgfVuk7a/yUI1fGbjI6OdYfY9Jq q30206/AvIKEUoV3lg7AEpr8wieTPhsIYtJLvO65HWoqNBbKnIM6HbaXi3YSkH7pGbCt Fwgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PoMfg8UJ; 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 i1-v6si2468279plt.183.2018.07.17.23.46.04; Tue, 17 Jul 2018 23:46:18 -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=PoMfg8UJ; 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 S1729970AbeGRHUg (ORCPT + 99 others); Wed, 18 Jul 2018 03:20:36 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45260 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729753AbeGRHUg (ORCPT ); Wed, 18 Jul 2018 03:20:36 -0400 Received: by mail-wr1-f66.google.com with SMTP id c4-v6so3408422wrs.12 for ; Tue, 17 Jul 2018 23:44:17 -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=raVj4mm1Q1ZaAVWpnDqhGG1LI3uXrzTE+7YpEmBVaYA=; b=PoMfg8UJrRkpQpeINHPAZslsXCQ2QTEN6capaRmJhix+eRImwcBCm6aVDH70rjwvVe pa7e+xjWRO03X1z/ZT+NN2pamr07xaWng5vSgcZDRD1ZVEy/r5cIPzR6OQQNfcyMVP2f 1WJRG544RLxFlPuwY563h7MyZM3e/rcUqusu4= 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=raVj4mm1Q1ZaAVWpnDqhGG1LI3uXrzTE+7YpEmBVaYA=; b=Xbag5jiNc1lhI9z8fFCqjL18qTEoSrMUeqOr3hhrB3Cey2FX9CHbYZ30UAsPMT4Yqv nCibfAIGQYB1QBYNVcyfbzPqWFjrRxiNsJGRFRQhBU6xfC4kdp4Sl1Ud2xT0gJ/YZ8xh 44MjkYo0yYEQbg/zDOVMbcibppLgX+dsNFXlMI5NNyq5myvg7oIR5OS2b+tdHVWIL/T3 V0w8Fjk2JvlgVkBUQmwChV1A7nnFmIk3Eo1edC9xUcugdR9Kj6D5XTMR4+YR5n9b1tz9 Ad6sxCSXTJ+9Gc6JZTZwn99KiPisADp0vSwKPoaC/lpbdIhvIltPqipEi2v3ylmWxzra VsqQ== X-Gm-Message-State: AOUpUlE8P7xB3PO8jsQyFNyF/q1UU0BHImauWELRkLDGc8wQS6UR2kx7 v59Gqc9wwaB4+E05S+DCrKHWFd0BBcE= X-Received: by 2002:adf:b2f4:: with SMTP id g107-v6mr3517316wrd.53.1531896256281; Tue, 17 Jul 2018 23:44:16 -0700 (PDT) Received: from localhost ([103.249.91.115]) by smtp.gmail.com with ESMTPSA id h2-v6sm1191353wmf.28.2018.07.17.23.44.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jul 2018 23:44:15 -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 v8 5/7] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse Date: Wed, 18 Jul 2018 12:13:11 +0530 Message-Id: <7f2da230d5612ebb6f5e5397cc4b9d1054757823.1531895128.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 Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- 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