From patchwork Sat Sep 10 12:46:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 604639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74A02C6FA90 for ; Sat, 10 Sep 2022 12:47:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229543AbiIJMrO (ORCPT ); Sat, 10 Sep 2022 08:47:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbiIJMrM (ORCPT ); Sat, 10 Sep 2022 08:47:12 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB9B578B2 for ; Sat, 10 Sep 2022 05:47:10 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id bt10so7293135lfb.1 for ; Sat, 10 Sep 2022 05:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=iVerlQTTcxJMwK/BNvAaXP01NQN8ZnVuUMJYdnIxVhU=; b=xxq2Elz2E7FDCRN2HEyRBRas8SZ2ONtz5fP0EATlf+pcHiU5lxV359TzPL33YESAxG F2pOk4jgKlxfrVZY/56tu4CJ93wFJ6QOfp2hZnFou5pReM+/OE0rBHd26Qvcqt/Be/IH m230C277sH+TLUffHOomnVFgd/2xVzaDgKMeS0sKD88EeaZQIR03aDxp5OH0JvQGlbWe 1r9kYtdc7e4Mn/1pUh59M8kf+xkdsdzfpqn9k0qZdKmpnwIntdo3dejcVKvfU6zMFl7s ezU4NluOOt2IigJTI/XGsylPdiagqR9uTj1QJLE9KERpHrY9CwOdkMLyOAdgQHtY6Vj/ A6yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=iVerlQTTcxJMwK/BNvAaXP01NQN8ZnVuUMJYdnIxVhU=; b=zHlkybSBeYlN2WngIXW1imdD8CIQFjQU7j9Olu1wOh6r0oD/VyY1BRxZAI4Lum6Io3 otry9+iDo/8W5tAejtjENQDBi1bJipvEY6zBrGQRK/+rh4dNyB6/XDEE2LiGhM7LB63z WkALRi2bmTOqlkaocQ/b1dC7uFbeRd2ZrJ9V3Y2OpkIR2CVnvxZVMirP7VTfQtGCBobg u0+ktGHlcVXr1EAPbqkpHGAUSF5H+VwrSaBHLpXRHH+Jb/kc4pHY8yx5zTGM+RQhdQTg xpafrvV0xJ6TaHp/Vd5deMstBnNEqMfre9pmMfFNe8U7GsgK44KbPimMYEIi43+aDeAC xM7A== X-Gm-Message-State: ACgBeo3c+0HtLChfiGVNmRavtr3bm112AXeTf44aGE3654DZ4ahD22zn iT4ES4tNYXHZGXVgHhO0Q53rtA== X-Google-Smtp-Source: AA6agR4xMg+Po6UpG5t3LGegh4TK+Ju54mDhNlHUH9LMgRR/gINyI4YmT8cyrsRIhAUWO0NKZ8Fjmw== X-Received: by 2002:a05:6512:22c7:b0:497:3512:2c28 with SMTP id g7-20020a05651222c700b0049735122c28mr6557230lfu.357.1662814028483; Sat, 10 Sep 2022 05:47:08 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id k14-20020a2e920e000000b002677a3ad1d9sm327463ljg.76.2022.09.10.05.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Sep 2022 05:47:08 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Amit Kucheria , Thara Gopinath , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui Cc: linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [RFC PATCH 07/10] thermal/drivers/tsens: use tsens_calibrate_nvmem for msm8976 calibration Date: Sat, 10 Sep 2022 15:46:58 +0300 Message-Id: <20220910124701.4060321-8-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220910124701.4060321-1-dmitry.baryshkov@linaro.org> References: <20220910124701.4060321-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Call tsens_calibrate_nvmem() for parsing msm8976 calibration data in addition to parsing the blob manually. Signed-off-by: Dmitry Baryshkov --- drivers/thermal/qcom/tsens-v1.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/thermal/qcom/tsens-v1.c b/drivers/thermal/qcom/tsens-v1.c index 11363a318ae8..2a4440a34735 100644 --- a/drivers/thermal/qcom/tsens-v1.c +++ b/drivers/thermal/qcom/tsens-v1.c @@ -213,6 +213,11 @@ static int calibrate_8976(struct tsens_priv *priv) u32 p1[11], p2[11]; int mode = 0, tmp = 0; u32 *qfprom_cdata; + int ret; + + ret = tsens_calibrate_nvmem(priv, 2); + if (!ret) + return 0; qfprom_cdata = (u32 *)qfprom_read(priv->dev, "calib"); if (IS_ERR(qfprom_cdata))