From patchwork Wed Mar 20 13:17:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 160675 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp282363jan; Wed, 20 Mar 2019 06:19:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU/qphH88GxeLpCSP97w+kh4gsfy57xBaDFTHcotFO8CESqYIoFhN/8cr7Gg/nTy81yhYc X-Received: by 2002:a63:2c3:: with SMTP id 186mr7340011pgc.161.1553087941751; Wed, 20 Mar 2019 06:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553087941; cv=none; d=google.com; s=arc-20160816; b=SBSfrFTjpzvGmFDJw3QNh4Fk0IGWfIp/k4WIpuf8fQk5hMvkXnHeYb3OWdG5UaNuBP BPcoPDGVxe4bH9VVw/MEJQbcA68zMsa6HBs57xCbnSdbQQqBoIsq8c7rVZWbsJd0GWAu iXXKSq79YCSdTXqPEHyuvNYS4/5pawEOeI3I9kgmcbez+eK5K+4ihsclXKjmmlzWvPNi HZjk85BR0gkR4amZ4g7e5/ChGPri5nzTKVMNnIHu7wkP0chIKD5WVXy5K4Y0uxfdbJF3 7N4p4bcn/wFuCP/4mKXANg7lkNH52a7auWh9Bp3qlI1n15HFgztwYJS5TUSU4JQhMnbB tX+A== 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=dYCkYXRAlN277z81/eOTOExG0eADYg75lNPjMwcPq3+30q2lwMukfkTiMceFy22Z+H k9IX4BSFFUwHKn5r5zXKqRJBhsdkoS+YFFow7Lmt7rYGZ3xhqL6y+x8xjWaMhzgtmDbi J/wpi7OnNWaY/2/MlejRfjse9GAjiUdAcgjcNLroAFQAU4gSmdq0uovNpRro4M0GCT0C idQ076eg79QNqu6qla/b4AaEzLi7zlmlTbaOLaxL1tGt6U/IfqquMCO3NEbkz4jwCRp6 TnC58/ScytRfnuO2LOTvgThzn8vP/08cIPhh1L99fTWC2XNJ+WBjKpm7wxrx7NtsE82w n97w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b9S59dYT; 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 l14si1700121pfj.112.2019.03.20.06.19.01; Wed, 20 Mar 2019 06:19:01 -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=pass header.i=@linaro.org header.s=google header.b=b9S59dYT; 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 S1728196AbfCTNTA (ORCPT + 15 others); Wed, 20 Mar 2019 09:19:00 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45978 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727269AbfCTNTA (ORCPT ); Wed, 20 Mar 2019 09:19:00 -0400 Received: by mail-pf1-f193.google.com with SMTP id v21so1901533pfm.12 for ; Wed, 20 Mar 2019 06:18:59 -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=s/+Bl7ZGzK0cL5xDzP2iXR4sdWkOPpcYJr4QjVnhB2E=; b=b9S59dYTFY3WccOujlrOlQhCiFsoEOIbyiHxVdBpJxeap37XgzNDGATF3GRbLzzwo9 +vDVTBBlbkPwvJjrD3YwLLakl082XP8sfOZ80/DtuO3cHdTZoojom1KHH3+uuXu29BBS 2qFE1fsnmgkyaagnGQY9KagPpi5VtIWTQCqlt/E9Y4Uh0XLRFM1Pzr4bmTT8lI3AFH1k HEU9Chjhj53c1eTNnJUaRALmBkVeHjCpWJuKEPWSZ9YxEWiS0xJw9w0MfmWSa1G5QWEa UPFbEeFqq5NWZDGKcZZNCmjnZOIwbZRYHMwyK4Jycs5Yg0TRx0p+OhGjC1juCPhyWYiV DtQw== 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=pajHv1shqzmwhvsg9inlEvUExfNinUexEf3eo4nMQQgBjK3DjL71ySb7C4VCZX63q9 M6FIYEZ5I1xq+XVSCQ3gemQOi0AoC5ChTsErbVcwTfBWDnI6dZSR302gUJAEtR2svFpW dKQxfSymTD2JIgqkFzmM+Odoy2klglFne/yzJcLXl8Z5C/0OUID0+HgK6l8z8oFPtDIP RqQgA3lWhnRB3hiw9F2H5iXC3y/0KE42uVF7arb/WLv0RcoueXEs4vYSZG8b2lgz8N/E E+vJ+ugo58oj2hcfSgjSg5nARZjbll+Yw09KuC37oHO9S6Viq/KkxiAbBYNru++Fvo/I +5dQ== X-Gm-Message-State: APjAAAVi7/mVq4RTJzmkLrFciiwEXn5Rd3xCPgfoPdWZt5dcMC+ajfXp uP/2FRu3kGlPEzXzGyqEQyQOkJjNbAQ= X-Received: by 2002:a63:6e02:: with SMTP id j2mr7397195pgc.229.1553087939194; Wed, 20 Mar 2019 06:18:59 -0700 (PDT) Received: from localhost ([114.143.122.221]) by smtp.gmail.com with ESMTPSA id b15sm7370229pfj.167.2019.03.20.06.18.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 06:18:58 -0700 (PDT) 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: [PATCHv3 08/23] drivers: thermal: tsens: Rename constants to prepare to merge with tsens-8974 Date: Wed, 20 Mar 2019 18:47:48 +0530 Message-Id: <934cc97c81ebe8e5f19eb99ce5b37debcc15f585.1553086065.git.amit.kucheria@linaro.org> 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;