From patchwork Thu Feb 28 12:20:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 159352 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp574228jad; Thu, 28 Feb 2019 04:24:34 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaea3RR3P6TS4BIXiyJSBpvaCzpSFfgOiBItV0ynKo4sn1bEBk1uFBqw6YbzW1ED8bO8dCf X-Received: by 2002:a17:902:7889:: with SMTP id q9mr7861808pll.305.1551356674338; Thu, 28 Feb 2019 04:24:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551356674; cv=none; d=google.com; s=arc-20160816; b=UHc0t7UfP6ZDsn9aNzixKmMWMWx9m7rTzP8VOdizIXyBmh6ytKvGOOmOEAQSvPWrqg G3EqnSPqwCbHiX3y20GsRCgF3WoSrKN2d/bCOZqXwL/EyGMi1M/MUKVzglei+3SX7B+O LZKdo1dkzgQlU4lGakdwmn4tWfLBhPX4JnPFpmDylAKo2Eq/IAdGDLb+tAzTKDSdg3Yt kqs7Epwd+e0wiFQ/HEQlm+LQXWeXtBYweAKOKo/X4cPA4q0jRzT4uSSv6lW21Z2ur7JR gSHdGc7sjXGuKh9EmjbDtzgKgV3wDEI6JceWtoB/MH/k40MzjvemobYlwS+DXcKTLmaw Q6ew== 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; bh=s/+Bl7ZGzK0cL5xDzP2iXR4sdWkOPpcYJr4QjVnhB2E=; b=SNfhG7D1Ba5bQmdfwpLMybfqheqKDmzBhAYRCNAe6pVbM1Ifm+pOaem07ddf6wEIfe jWvjeEbtRozy0m5BD2DHPnDOpRboqLn0c5EjBy7HcD5JLlO2Xxx/JMdDxP53R3av8FI6 xc6ZEOX0BTvvZjbewdiKvwkUBSEDgRhHZutUHLJNgbbQllP9fIHEcursVFPz44lt1pld V9Xio2onfvX8Q6XoMODZhGIRYaxIw+x+1OOQ0YuXehPGciwRXjKdOWpEcIhfGK6lBqrz jRiQlFuyupR8RwYTs6h3UUQn39a8xBW9KdWoW2tBh4uB4gug1DDrBHGfHRlEy++fnTGU eOfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="FHv5/3Qs"; 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=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 d37si18027945pla.71.2019.02.28.04.24.34; Thu, 28 Feb 2019 04:24:34 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b="FHv5/3Qs"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727983AbfB1MYd (ORCPT + 15 others); Thu, 28 Feb 2019 07:24:33 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:40207 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727045AbfB1MYd (ORCPT ); Thu, 28 Feb 2019 07:24:33 -0500 Received: by mail-wr1-f66.google.com with SMTP id q1so21746651wrp.7 for ; Thu, 28 Feb 2019 04:24:31 -0800 (PST) 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=s/+Bl7ZGzK0cL5xDzP2iXR4sdWkOPpcYJr4QjVnhB2E=; b=FHv5/3QsYZsBwUeIBgPR5t5jkcQPpkYT+0oAjA7sbdOf4GNbAOAXyYZaek77Q/BZGG LSxBO4H40P62B2pFtiUD+8j6gk3Sx34QrrVN97TdKxBOSY/AIEMElPDoguGzfKhXJ2P4 vVaH4hWmMpTdfW4dRlm+augjxfvQDhyoLLoT34K6NUkIdZF5f+qC8li/NDl7q6zORycZ t2/7KRKNLG/ZpBG6aPazAXpLWTwe64YeuwzJWmqW03jMeWJqWf2Ql2o6XdU32sNxwZ+2 SBOvSz9CTpT9AamQgVf3+/RHljoufsLmDSbMattOmjLqxl+cYXPWz6tye1zkGcFz+8Nf cKgw== 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=s/+Bl7ZGzK0cL5xDzP2iXR4sdWkOPpcYJr4QjVnhB2E=; b=riKZgLNd7Rd68fyeaHIk+NnHOMZkaU/ObPAq3AUKmPcoBW/ERvcfBTGaLxGph9DdRN HAM0jAkR8+WHa/PLRkQKb7zvbsrZMPSp9LsajqbnySjj+3JQ1FXjHfUp2y0V7rFcYBW1 /8xTIpmP6XjZ578ZdRjGhHdJSFIq6BSZy+cp99lDO1JfYqLdhbhUGxQNfelwJHNxXfhn wRr0FP5BoCXHdDGsejRWFLP9O3P5UdteBEnL+i0beRBUNplytj/sSyj5Fvpsn53aizu9 ZDXTMHbqvVgUjEsQSek2ImsMD01Yp3Q6qPVnmvno2KNUeCqWjfNBlvFgATNGTjpRm+GL /xeg== X-Gm-Message-State: APjAAAXj9tBeYfk2Gb49iZxhhVMkzhYg6tCwChOCdX2ljFSjYL4CQSrL KVPQ1h5+5uunwYOo0KjI7deZLg== X-Received: by 2002:adf:df0d:: with SMTP id y13mr5951104wrl.69.1551356670903; Thu, 28 Feb 2019 04:24:30 -0800 (PST) Received: from localhost ([49.248.54.130]) by smtp.gmail.com with ESMTPSA id s3sm24901915wrt.81.2019.02.28.04.24.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 04:24:30 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org, edubezval@gmail.com, andy.gross@linaro.org, Daniel Lezcano , David Brown , Zhang Rui Cc: linux-pm@vger.kernel.org Subject: [PATCH v2 08/24] drivers: thermal: tsens: Rename constants to prepare to merge with tsens-8974 Date: Thu, 28 Feb 2019 17:50:58 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 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 Some #defines in tsens-v_0_1.c clash with those in tsens-8974.c. Prefix them with 8916 to avoid the clash so we can merge the two files. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-v0_1.c | 88 +++++++++++++++---------------- 1 file changed, 44 insertions(+), 44 deletions(-) -- 2.17.1 diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c index d4ad4082c800..30909594b1cf 100644 --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c @@ -7,37 +7,37 @@ #include "tsens.h" /* eeprom layout data for 8916 */ -#define BASE0_MASK 0x0000007f -#define BASE1_MASK 0xfe000000 -#define BASE0_SHIFT 0 -#define BASE1_SHIFT 25 - -#define S0_P1_MASK 0x00000f80 -#define S1_P1_MASK 0x003e0000 -#define S2_P1_MASK 0xf8000000 -#define S3_P1_MASK 0x000003e0 -#define S4_P1_MASK 0x000f8000 - -#define S0_P2_MASK 0x0001f000 -#define S1_P2_MASK 0x07c00000 -#define S2_P2_MASK 0x0000001f -#define S3_P2_MASK 0x00007c00 -#define S4_P2_MASK 0x01f00000 - -#define S0_P1_SHIFT 7 -#define S1_P1_SHIFT 17 -#define S2_P1_SHIFT 27 -#define S3_P1_SHIFT 5 -#define S4_P1_SHIFT 15 - -#define S0_P2_SHIFT 12 -#define S1_P2_SHIFT 22 -#define S2_P2_SHIFT 0 -#define S3_P2_SHIFT 10 -#define S4_P2_SHIFT 20 - -#define CAL_SEL_MASK 0xe0000000 -#define CAL_SEL_SHIFT 29 +#define MSM8916_BASE0_MASK 0x0000007f +#define MSM8916_BASE1_MASK 0xfe000000 +#define MSM8916_BASE0_SHIFT 0 +#define MSM8916_BASE1_SHIFT 25 + +#define MSM8916_S0_P1_MASK 0x00000f80 +#define MSM8916_S1_P1_MASK 0x003e0000 +#define MSM8916_S2_P1_MASK 0xf8000000 +#define MSM8916_S3_P1_MASK 0x000003e0 +#define MSM8916_S4_P1_MASK 0x000f8000 + +#define MSM8916_S0_P2_MASK 0x0001f000 +#define MSM8916_S1_P2_MASK 0x07c00000 +#define MSM8916_S2_P2_MASK 0x0000001f +#define MSM8916_S3_P2_MASK 0x00007c00 +#define MSM8916_S4_P2_MASK 0x01f00000 + +#define MSM8916_S0_P1_SHIFT 7 +#define MSM8916_S1_P1_SHIFT 17 +#define MSM8916_S2_P1_SHIFT 27 +#define MSM8916_S3_P1_SHIFT 5 +#define MSM8916_S4_P1_SHIFT 15 + +#define MSM8916_S0_P2_SHIFT 12 +#define MSM8916_S1_P2_SHIFT 22 +#define MSM8916_S2_P2_SHIFT 0 +#define MSM8916_S3_P2_SHIFT 10 +#define MSM8916_S4_P2_SHIFT 20 + +#define MSM8916_CAL_SEL_MASK 0xe0000000 +#define MSM8916_CAL_SEL_SHIFT 29 static int calibrate_8916(struct tsens_priv *priv) { @@ -54,27 +54,27 @@ static int calibrate_8916(struct tsens_priv *priv) if (IS_ERR(qfprom_csel)) return PTR_ERR(qfprom_csel); - mode = (qfprom_csel[0] & CAL_SEL_MASK) >> CAL_SEL_SHIFT; + mode = (qfprom_csel[0] & MSM8916_CAL_SEL_MASK) >> MSM8916_CAL_SEL_SHIFT; dev_dbg(priv->dev, "calibration mode is %d\n", mode); switch (mode) { case TWO_PT_CALIB: - base1 = (qfprom_cdata[1] & BASE1_MASK) >> BASE1_SHIFT; - p2[0] = (qfprom_cdata[0] & S0_P2_MASK) >> S0_P2_SHIFT; - p2[1] = (qfprom_cdata[0] & S1_P2_MASK) >> S1_P2_SHIFT; - p2[2] = (qfprom_cdata[1] & S2_P2_MASK) >> S2_P2_SHIFT; - p2[3] = (qfprom_cdata[1] & S3_P2_MASK) >> S3_P2_SHIFT; - p2[4] = (qfprom_cdata[1] & S4_P2_MASK) >> S4_P2_SHIFT; + base1 = (qfprom_cdata[1] & MSM8916_BASE1_MASK) >> MSM8916_BASE1_SHIFT; + p2[0] = (qfprom_cdata[0] & MSM8916_S0_P2_MASK) >> MSM8916_S0_P2_SHIFT; + p2[1] = (qfprom_cdata[0] & MSM8916_S1_P2_MASK) >> MSM8916_S1_P2_SHIFT; + p2[2] = (qfprom_cdata[1] & MSM8916_S2_P2_MASK) >> MSM8916_S2_P2_SHIFT; + p2[3] = (qfprom_cdata[1] & MSM8916_S3_P2_MASK) >> MSM8916_S3_P2_SHIFT; + p2[4] = (qfprom_cdata[1] & MSM8916_S4_P2_MASK) >> MSM8916_S4_P2_SHIFT; for (i = 0; i < priv->num_sensors; i++) p2[i] = ((base1 + p2[i]) << 3); /* Fall through */ case ONE_PT_CALIB2: - base0 = (qfprom_cdata[0] & BASE0_MASK); - p1[0] = (qfprom_cdata[0] & S0_P1_MASK) >> S0_P1_SHIFT; - p1[1] = (qfprom_cdata[0] & S1_P1_MASK) >> S1_P1_SHIFT; - p1[2] = (qfprom_cdata[0] & S2_P1_MASK) >> S2_P1_SHIFT; - p1[3] = (qfprom_cdata[1] & S3_P1_MASK) >> S3_P1_SHIFT; - p1[4] = (qfprom_cdata[1] & S4_P1_MASK) >> S4_P1_SHIFT; + base0 = (qfprom_cdata[0] & MSM8916_BASE0_MASK); + p1[0] = (qfprom_cdata[0] & MSM8916_S0_P1_MASK) >> MSM8916_S0_P1_SHIFT; + p1[1] = (qfprom_cdata[0] & MSM8916_S1_P1_MASK) >> MSM8916_S1_P1_SHIFT; + p1[2] = (qfprom_cdata[0] & MSM8916_S2_P1_MASK) >> MSM8916_S2_P1_SHIFT; + p1[3] = (qfprom_cdata[1] & MSM8916_S3_P1_MASK) >> MSM8916_S3_P1_SHIFT; + p1[4] = (qfprom_cdata[1] & MSM8916_S4_P1_MASK) >> MSM8916_S4_P1_SHIFT; for (i = 0; i < priv->num_sensors; i++) p1[i] = (((base0) + p1[i]) << 3); break;