Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp869974imm; Wed, 11 Jul 2018 12:24:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe6vwGa65IiEBwjBMkgGb/nCpTcIUF4vulVJxGtYa0fGxbZYhCFf6s+Q/UoN+A5jQSRrCc6 X-Received: by 2002:a62:da07:: with SMTP id c7-v6mr31302360pfh.106.1531337077617; Wed, 11 Jul 2018 12:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531337077; cv=none; d=google.com; s=arc-20160816; b=QPUgOStU8N+w+Rqc+Jf0AQ14pNeC3IegTPMZuAYiTlkBY4r0EllbKddVROfxwY6eJb SmXA+IjLPSp0Zy5Ogf1rs+JXpsuyLHcmVbzDDKvHVuH+M0U7omA78BG95Bp1pXC1fQa0 OlgKX55szhxtaS/8K/ZnTE71flRkN3W1t4pwY2yoLpPHIPyF6LXmLyMRSaxwBcyGA6G5 skXe3UCHfpjy9F4V6N5sY57UMOPP/9YNL82ZMZra92Ad6HACiF4TS7Ou6S66glg20Un/ BaIF2LsRuv5NCgN3d7OHYtBh01fsTYgnSTbFbzaSJarTtZF+C0Q4OZp5FeBnztALNatD Vz/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=5QQdlwZ3HXGVjRH2NE3/TOnB2m3mlq1cly8orSYcxDM=; b=wp96ohD29DPMj1MYAS9BWM1e/0dVhJa6N1dRuy6sLurhho02mjKTsXvoVQFmuXMf87 mnmuVHgb6lZPnV7I/u6TNNMZ82DxTO9Q6aV+kmkZw8B9VfGORMcdDsI2IqwhoePI/fBY hvGHMRbioRYGw/zWlsB2T+pzBnqXSGRRVBkQx8eqT+yCitclSQxqRdQ3I8RuiRRSsAVR gyfukvUl48GGM1s9PY9P6wyc3aMilAffOTfvbXXT7tuHUFAMkjDBjn20jOtuz7NFJPcE 2tkXlyo/cxIBOCtiCDrU6/I2xZz0Mbw6iS7xPdoelZ9GkQa/6MMkPi6VXUHVUDKZJIfS hJJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dXRU8gOH; 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 e9-v6si19044572pgu.636.2018.07.11.12.24.22; Wed, 11 Jul 2018 12:24:37 -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=dXRU8gOH; 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 S2389476AbeGKQmZ (ORCPT + 99 others); Wed, 11 Jul 2018 12:42:25 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:33645 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732191AbeGKQmZ (ORCPT ); Wed, 11 Jul 2018 12:42:25 -0400 Received: by mail-pl0-f67.google.com with SMTP id 6-v6so9397475plb.0 for ; Wed, 11 Jul 2018 09:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5QQdlwZ3HXGVjRH2NE3/TOnB2m3mlq1cly8orSYcxDM=; b=dXRU8gOH9M4yF0NzRsTm+eaBenuYlHyASPIcNzwIdVcByjXw3M+NG336E6fAIyOZvC 9J5ybVeAUA90NPFkKn3SvdVUKPs/vBWFaTW9xfnokbe2pgflkrfDLrbnWy3l5Q5GR/IU oqKzl+OSWapOfQXyrNC72z1LYiJxAjMLp2XKA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5QQdlwZ3HXGVjRH2NE3/TOnB2m3mlq1cly8orSYcxDM=; b=jQVYjtCox/Q8oiIwhV+oVx4yRYy2c/Rh/XrVCXMdNW6P7vlUKfofJG0y6ug1Ou0qV9 piewu3PjrihFrN1OLAhq0TTvoUFUaV5wMf4a1xNm47MZ6iFIvp8tGcItvUp/j1PHxz6N WuW8/njvEF/5oVkZx4Yq/2g0Z8VyhJoZaQnbX1SdA/wkrnGD+Q4oSwZqum32gHbrK6+j rXgsu9SV+C4xiS+5JIL4irRL65hwjYzPFT0Is4TTJ3AYnDTLmLO32v1dAhORgryCaCjc ko6S3hJ0kKCwv3A8VhstvSTdPWr7SJciEcLNTNo1go0CM/6rCyF+qybK50ib4EjZUBc5 ApKw== X-Gm-Message-State: APt69E2LMaC08kAAHqffEHXfdsND+Y0IwkYenLEJ/w/PUDeQE3BacJJG 98vPM49jy/rzXJm9X51teFzpmg== X-Received: by 2002:a17:902:900b:: with SMTP id a11-v6mr29545365plp.143.1531327036485; Wed, 11 Jul 2018 09:37:16 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id j23-v6sm31827569pfi.137.2018.07.11.09.37.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 09:37:15 -0700 (PDT) Date: Wed, 11 Jul 2018 09:39:57 -0700 From: Bjorn Andersson To: Amit Kucheria Cc: linux-kernel@vger.kernel.org, rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, edubezval@gmail.com, smohanad@codeaurora.org, vivek.gautam@codeaurora.org, andy.gross@linaro.org, Zhang Rui , linux-pm@vger.kernel.org Subject: Re: [PATCH v6 4/7] thermal: tsens: Rename tsens-8996 to tsens-v2 for reuse Message-ID: <20180711163957.GC545@tuxbook-pro> References: <910ed3e440a5612f4113318c66ae2395f53abaae.1531135999.git.amit.kucheria@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <910ed3e440a5612f4113318c66ae2395f53abaae.1531135999.git.amit.kucheria@linaro.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 09 Jul 04:43 PDT 2018, Amit Kucheria wrote: > 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 Regards, Bjorn > --- > drivers/thermal/qcom/Makefile | 2 +- > drivers/thermal/qcom/{tsens-8996.c => tsens-v2.c} | 26 ++++++++--------------- > 2 files changed, 10 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 60765b1..34ba6c7 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 0x10a0 > -#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,13 @@ 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 >