From patchwork Wed Mar 20 13:18:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 160690 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp283592jan; Wed, 20 Mar 2019 06:20:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGSXkfNmvAcUrafoVkCHswOv0kfw0bOO8XKYk1XwOjBxoy63cYaPKnwBxwS0xBBxRg3UUG X-Received: by 2002:a17:902:56a:: with SMTP id 97mr8110805plf.320.1553088008418; Wed, 20 Mar 2019 06:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553088008; cv=none; d=google.com; s=arc-20160816; b=U5liKTB9Xvfajssx31K9zU+yS4aXtPvin2I6RQVHT7u0RSuk5wLz1fNG36npVEYlIo rlEvY9zVAkNnr2VDz8MGN7+rbUpEjHGWD+qNfabv9b8iX4EIcQxoEofeARiP2RYNjmou lTZjm8APUqZ2rMuv3b0h/wpgYdk/SMi5qLN7inJ7NjhvgJQRk3bGxzwQZ+lruBCl+NOB so8xEwF//c+KwcLBoAhGeZd5EhrQ6FFosAThELQXmf5bI8pcvXzhgh83YfR/Goloq6Hs G+vUQlRs0UDkFMFIBaQ56KGJFMrICkgQgmZKIxH/PdJgulzwwlR7V5hJzuTcT8V8hoWt 9FFg== 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=GVi7i1fu8KbnbyWsTfjd8QUIqgKKnoJhlGlhThXxZVI=; b=yJi4eFZhZeobErUKD8UGBFi3b2L8fuif81c0ELa3hP1C91VOOvAJvReIKszvRoCasG 85LyHWU08/3MPYM35PiMpI9uFR7+Lpm8hzR8+PyPuVxmU3z0OsI6/LWkv9ij089roYD7 InytbgOBTXE5PUE0A6urdZtIJRulUhlKMMuBdboUDvtW9cAhwsnagLXYCLvarHyV6ThZ pK8yC9OOU93gaA/SL65RKnPRRKdi3bF/4chjDSI1PCbb6r3jgbGXmcB8IIv3kP7cyolM akE+LNx5xTX157HX1volw/omgKc9akXLg8nZJ55DfG1PLn8n9EQb54Zkn7XqCgUtRURi hlHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QxWhhvs9; 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 b92si1946107plb.348.2019.03.20.06.20.07; Wed, 20 Mar 2019 06:20:08 -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=QxWhhvs9; 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 S1728409AbfCTNUG (ORCPT + 31 others); Wed, 20 Mar 2019 09:20:06 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43476 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728095AbfCTNUF (ORCPT ); Wed, 20 Mar 2019 09:20:05 -0400 Received: by mail-pf1-f194.google.com with SMTP id c8so1915436pfd.10 for ; Wed, 20 Mar 2019 06:20:04 -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=GVi7i1fu8KbnbyWsTfjd8QUIqgKKnoJhlGlhThXxZVI=; b=QxWhhvs9fzVqRx7Kpd8qxvYSOFIiZlI3DXyPaoP0NSjKnJUun+4YUbo5VdJyXnPVws UKHzV/uLAG1e09tvwe+uuA9XnEBDkTxg6Sl0EHYEEvuZxffgVv57v8Rg52KEXYHuf7Ia qrAk41s7BbbjRbus1etKoTIZKoPL8YMIIuWun+pjNRQh/hTe0LYzVG3D6XFgYIgSARbT zXpNnc2AsL6HbGherrKtQoLthSo0YXpzSkY9j3YnBfRPByjLkJosVbehfzil8ox/dlPg 6rWhqjEdXO2+1UN/lyn7HIkGj47aUWhCEwZ2J4bOhovjwxzqz7f8CSdWAgfpc+aFNGTD tS6Q== 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=GVi7i1fu8KbnbyWsTfjd8QUIqgKKnoJhlGlhThXxZVI=; b=LTF+zNjU+jVOU3QoOg4bl7batLtWYwoDWHQe2K3fL5HeXlEBRlxnWylA8oVFHKmOPT b/j43Sfd8xRV3AX0gTTtE942x75joiEgegjo+7DLeTjchyfB1JTd4cfHVZd+Ro5hXLrk 8cMzSTo7d/5tzlrZq5elj2x+gtHO/YqX2d9qrJsJphpYEa05ftst7k9KXfg5X/rhlgW/ LHyMA8d4dYWKXwaPbGTv3So5wZ+KBhJnPBqzfvshykJpMLlw6GQ86rRvRdnxT7PjVEpr J0qh2zLv91YTPTQbNhyLFM58E0mh1EKU89Qu2+sQZ1FLtXZcmt/voZMhtnDmMYIJBxDx ZyJA== X-Gm-Message-State: APjAAAXiFhcs/7IZHcpVlXMxx6gBT5jU5Equ7t8kYF1xxVi4meiYH0U5 V+LLMezPgKKFDNUK6M72H625ITAXXqo= X-Received: by 2002:a17:902:8d93:: with SMTP id v19mr31497487plo.271.1553088003936; Wed, 20 Mar 2019 06:20:03 -0700 (PDT) Received: from localhost ([114.143.122.221]) by smtp.gmail.com with ESMTPSA id o38sm3577958pgm.36.2019.03.20.06.20.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Mar 2019 06:20:02 -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 23/23] drivers: thermal: tsens: Move calibration constants to header file Date: Wed, 20 Mar 2019 18:48:03 +0530 Message-Id: <4e32e37db0a62dbf399dce6e7f7927823313d281.1553086065.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 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 This will allow calibration routines to correctly include the constants from anywhere and allow more code sharing. Signed-off-by: Amit Kucheria --- drivers/thermal/qcom/tsens-common.c | 5 ----- drivers/thermal/qcom/tsens.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 92747ccb2850..928e8e81ba69 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -12,11 +12,6 @@ #include #include "tsens.h" -#define CAL_DEGC_PT1 30 -#define CAL_DEGC_PT2 120 -#define SLOPE_FACTOR 1000 -#define SLOPE_DEFAULT 3200 - char *qfprom_read(struct device *dev, const char *cname) { struct nvmem_cell *cell; diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index d648fba235cf..eefe3844fb4e 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -9,6 +9,11 @@ #define ONE_PT_CALIB 0x1 #define ONE_PT_CALIB2 0x2 #define TWO_PT_CALIB 0x3 +#define CAL_DEGC_PT1 30 +#define CAL_DEGC_PT2 120 +#define SLOPE_FACTOR 1000 +#define SLOPE_DEFAULT 3200 + #include #include