From patchwork Thu Dec 29 03:00: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: 13083286 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 85678C3DA7A for ; Thu, 29 Dec 2022 03:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbiL2DBh (ORCPT ); Wed, 28 Dec 2022 22:01:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233039AbiL2DBV (ORCPT ); Wed, 28 Dec 2022 22:01:21 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DC5712A87 for ; Wed, 28 Dec 2022 19:01:19 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id 1so25908873lfz.4 for ; Wed, 28 Dec 2022 19:01:19 -0800 (PST) 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 :message-id:reply-to; bh=ic31fMG7ujfaKO2qUrY+ZPMHyXpn2xzjXgAqSzwYmrU=; b=VY+MDugTOt9wQyAMuq55q3JOzHqSo3LgGY648d/9OuhxiI5IzT46m1dSDICQRubLU2 ckQFYdHKkyAf3t7LxsPZls0uz2l6tJciROyQNYbeWsJJZ8BXwBWweGgboaKhMqLyGegu CTg4E6mG57zg0xNIVVoXqbSJkor7gqE2lBIQWPHjLP+b+GpwSRFbCH3YAM2BqC9frUUD SbaU9xoPCrc7zwV8hfRGWXL26eStIVITdigNYq+jjgLWjsDYeO5dgP0XtwLP8k+cUd/h cQBllebZ7I/haE0r+0Y08KFm70Xgvsv06a30kqn/mfhngoeZ21EpwKE/JrT/870ZPmoQ pchw== 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:message-id:reply-to; bh=ic31fMG7ujfaKO2qUrY+ZPMHyXpn2xzjXgAqSzwYmrU=; b=7rtbxe2/NqnYInqOkzGse8suQeT9jxuC0DfyriGGI2QLLs5bCylYwU1VzHbnCFNw4J 6+bgEBL3C9cXoxwLsk2OJ/NmugFoLjm3HC1V10em9Bz5lo2v7fhAqTJTwGjyAUVVrPSp 86sw2XDubPBdReSI/GoAgjBvPb9MAzpP2ToDzZZzMSPYULFRq0ji0gI4l3BzLwSpNFMh RXP42xEoXE3NoC15YSY8jZreb2wplUy17wV8xQfOSmuieoU5nBVME/jIRyGtzmxsRW+u T8r/142zqQ0tLm5zh1QX5kNdfgzCGIyG6E55oom1D8jO+fnJ7B66Im39/S+7HuItc3jI OLpg== X-Gm-Message-State: AFqh2koFOJFzhcQeVW7+vPYR7di99NIISGcW+ZkdyExC7Bu+TaHa4Fx0 Yvbx4ivQ8pSymGqM7EfBIXtzVg== X-Google-Smtp-Source: AMrXdXunXIL2hDL8yZL8qn6r+1xgXtJSgnN7gJXFddcjuDsRfl0wgvuOee9o20YbedCDVFdta55bIQ== X-Received: by 2002:a05:6512:ac1:b0:4b5:9dc4:e785 with SMTP id n1-20020a0565120ac100b004b59dc4e785mr8392430lfu.45.1672282877742; Wed, 28 Dec 2022 19:01:17 -0800 (PST) Received: from eriador.lan (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id b11-20020a056512024b00b004b57277474esm2883070lfo.106.2022.12.28.19.01.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 19:01:17 -0800 (PST) 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: "Bryan O'Donoghue" , Shawn Guo , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v5 12/20] thermal/drivers/tsens: Drop single-cell code for mdm9607 Date: Thu, 29 Dec 2022 05:00:58 +0200 Message-Id: <20221229030106.3303205-13-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221229030106.3303205-1-dmitry.baryshkov@linaro.org> References: <20221229030106.3303205-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org There is no dtsi file for mdm9607 in the kernel sources. Drop the compatibility with unofficial dtsi and remove support for handling the single-cell calibration data on mdm9607. Cc: Konrad Dybcio Reviewed-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/thermal/qcom/tsens-v0_1.c | 38 ++++++------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/drivers/thermal/qcom/tsens-v0_1.c b/drivers/thermal/qcom/tsens-v0_1.c index f8b50bf14190..9488416b568c 100644 --- a/drivers/thermal/qcom/tsens-v0_1.c +++ b/drivers/thermal/qcom/tsens-v0_1.c @@ -267,30 +267,6 @@ static int calibrate_8974(struct tsens_priv *priv) return 0; } -static int calibrate_9607(struct tsens_priv *priv) -{ - u32 p1[5], p2[5]; - u32 *qfprom_cdata; - int mode, ret; - - ret = tsens_calibrate_common(priv); - if (!ret) - return 0; - - qfprom_cdata = (u32 *)qfprom_read(priv->dev, "calib"); - if (IS_ERR(qfprom_cdata)) - return PTR_ERR(qfprom_cdata); - - mode = tsens_read_calibration_legacy(priv, &tsens_9607_nvmem, - p1, p2, - qfprom_cdata, NULL); - - compute_intercept_slope(priv, p1, p2, mode); - kfree(qfprom_cdata); - - return 0; -} - static int __init init_8939(struct tsens_priv *priv) { priv->sensor[0].slope = 2911; priv->sensor[1].slope = 2789; @@ -355,6 +331,12 @@ static const struct reg_field tsens_v0_1_regfields[MAX_REGFIELDS] = { [TRDY] = REG_FIELD(TM_TRDY_OFF, 0, 0), }; +static const struct tsens_ops ops_v0_1 = { + .init = init_common, + .calibrate = tsens_calibrate_common, + .get_temp = get_temp_common, +}; + static const struct tsens_ops ops_8916 = { .init = init_common, .calibrate = calibrate_8916, @@ -398,15 +380,9 @@ struct tsens_plat_data data_8974 = { .fields = tsens_v0_1_regfields, }; -static const struct tsens_ops ops_9607 = { - .init = init_common, - .calibrate = calibrate_9607, - .get_temp = get_temp_common, -}; - struct tsens_plat_data data_9607 = { .num_sensors = 5, - .ops = &ops_9607, + .ops = &ops_v0_1, .feat = &tsens_v0_1_feat, .fields = tsens_v0_1_regfields, };