From patchwork Wed Jun 7 10:47:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 104401 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp166087vqr; Wed, 7 Jun 2023 03:58:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5rSNJ0gTMNCm8yf0pFqphJodnRb8iRW9t7YIG1k0yfJhkXGYWTs7NTFJkp7OmXOydCAR9a X-Received: by 2002:a05:6a20:42a9:b0:d5:73ad:87c2 with SMTP id o41-20020a056a2042a900b000d573ad87c2mr3001724pzj.56.1686135501034; Wed, 07 Jun 2023 03:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686135501; cv=none; d=google.com; s=arc-20160816; b=Xb+H8pM2PZ62M6ObjvRCXvQM4J2Y8Wly4jvemAqmyTFRT2rECuz7cImstbzo24YigY pgqirxt2S+jkzlDdUUqhHLxKVYwtXY1WJH+u0en4Dpa/5+uyLsxjwBexToUS6JvMlihv xCWvPmi9rbboQp1tv+sWZSCY3MY1yP1C4tEPQPkClhzCGswQfloaA6fLKbutSNrYtXo4 twXi81NzciC1QI8DVSKeX6gzr5aa0FailsgZKfD/0ROosgvD5SjAW6s+8SkqYR2Q8FmD mJ6WTFUWgai8Gprqt3B+ZJkMJxVeAyhj+q03P8Eq7vs8A2vboq5TygoTOy9riFFwtgIp 6Qjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=btVYLyMcK4pZs3PKfPyBx/fGMaLkgp9nbjbhyNmutRQ=; b=f0cr17dly2qKzk5kgAFCtXxQg/HyCC4zstGtzmCepimBnD6m5a+ofUqsJimfYVTZTT 3IqmYK/RIVpwfuwbC6n4Q9zWDXqC7gBv5tkxB+3MnIqUqWu2l6HGQ/EGp6nOm9EWFRnu 1fiXD+07UsBkxbDNBlLqls7W4wAiI++lTmRy0+iK1kfYE+YIRshXsD/258GfoRRCDqHk gJ4XT9mGKMhCkOXYZwvTS93fDDryz5/EBqC5r3zX5CM4Pgo+TnGyMwdqka1QTMu1/Km1 wc+e6ITaqmbmV0GpG2ce1AMpx8pdMm8pAgw8pBZ5C40fdsRg/macLMHFwGTNsUTsoy5s 8CzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernkonzept.com header.s=mx1 header.b=AFhP4+K9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernkonzept.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 76-20020a63004f000000b0053ef51d3fa8si8616678pga.401.2023.06.07.03.58.08; Wed, 07 Jun 2023 03:58:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernkonzept.com header.s=mx1 header.b=AFhP4+K9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernkonzept.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239099AbjFGKsT (ORCPT + 99 others); Wed, 7 Jun 2023 06:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235756AbjFGKsI (ORCPT ); Wed, 7 Jun 2023 06:48:08 -0400 Received: from mx.kernkonzept.com (serv1.kernkonzept.com [IPv6:2a01:4f8:1c1c:b490::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB9F3192; Wed, 7 Jun 2023 03:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kernkonzept.com; s=mx1; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From: Reply-To:Content-ID:Content-Description; bh=btVYLyMcK4pZs3PKfPyBx/fGMaLkgp9nbjbhyNmutRQ=; b=AFhP4+K9vYAPaZNvNgJUPiGbDK gevIJqqnSvEb7VCSy1CPpKlqmJbrVrd4ZhGvhTV6rkZMcq3eLmuNLfmk9MSWASHRXOFUp6g8HATww Y4DNmyu+msWjr5Kx5mnJQ46mCupCnJ0OUt2mhf5a7AHBEu4IFqUcI2YIsJ8FXdGkSt385PwLHACN4 7LseljBBWHeOweEdtuALjeUh56qckmhzn6rxMTq/5LZy9wL2qN3/k6nsnRRE+8KpV8cUgUCRWD0xD dFjZrzWLhYyvFX8Mg7DnX9O1PFPCYsKSxRScHOgAL7E1gGQJDE4UgIrlwgV35fWQxGO8gy3SqeGHT q8NDjD+g==; Received: from [10.22.3.24] (helo=serv1.dd1.int.kernkonzept.com) by mx.kernkonzept.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) id 1q6qhs-0069NL-1n; Wed, 07 Jun 2023 12:48:00 +0200 From: Stephan Gerhold Date: Wed, 07 Jun 2023 12:47:45 +0200 Subject: [PATCH v5 2/6] thermal: qcom: tsens-v0_1: Fix mdm9607 slope values MIME-Version: 1.0 Message-Id: <20230508-msm8909-tsens-v5-2-5eb632235ba7@kernkonzept.com> References: <20230508-msm8909-tsens-v5-0-5eb632235ba7@kernkonzept.com> In-Reply-To: <20230508-msm8909-tsens-v5-0-5eb632235ba7@kernkonzept.com> To: Daniel Lezcano Cc: Amit Kucheria , Thara Gopinath , Andy Gross , Bjorn Andersson , Konrad Dybcio , "Rafael J. Wysocki" , Zhang Rui , Dmitry Baryshkov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Stephan Gerhold , Stephan Gerhold X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768041219292626642?= X-GMAIL-MSGID: =?utf-8?q?1768041219292626642?= According to the msm-3.18 vendor kernel from Qualcomm [1], mdm9607 uses a non-standard slope value of 3000 (instead of 3200) for all sensors. Fill it properly similar to the 8939 code added recently. [1]: https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LE.UM.4.3.2.r1-04200-9x07/arch/arm/boot/dts/qcom/mdm9607.dtsi#L875 Fixes: a2149ab815fc ("thermal/drivers/qcom/tsens-v0_1: Add support for MDM9607") Reviewed-by: Konrad Dybcio Reviewed-by: Dmitry Baryshkov Signed-off-by: Stephan Gerhold --- drivers/thermal/qcom/tsens-v0_1.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c index a65f58264122..9802ae1d4fcf 100644 --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c @@ -234,6 +234,16 @@ static int __init init_8939(struct tsens_priv *priv) { return init_common(priv); } +static int __init init_9607(struct tsens_priv *priv) +{ + int i; + + for (i = 0; i < priv->num_sensors; ++i) + priv->sensor[i].slope = 3000; + + return init_common(priv); +} + /* v0.1: 8226, 8916, 8939, 8974, 9607 */ static struct tsens_features tsens_v0_1_feat = { @@ -345,9 +355,15 @@ struct tsens_plat_data data_8974 = { .fields = tsens_v0_1_regfields, }; +static const struct tsens_ops ops_9607 = { + .init = init_9607, + .calibrate = tsens_calibrate_common, + .get_temp = get_temp_common, +}; + struct tsens_plat_data data_9607 = { .num_sensors = 5, - .ops = &ops_v0_1, + .ops = &ops_9607, .feat = &tsens_v0_1_feat, .fields = tsens_v0_1_regfields, };