From patchwork Wed Mar 24 21:43:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 408334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3072AC433E2 for ; Wed, 24 Mar 2021 21:45:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A8D461A1E for ; Wed, 24 Mar 2021 21:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238590AbhCXVoh (ORCPT ); Wed, 24 Mar 2021 17:44:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234508AbhCXVoO (ORCPT ); Wed, 24 Mar 2021 17:44:14 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF1A6C06174A; Wed, 24 Mar 2021 14:44:13 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id w3so35342356ejc.4; Wed, 24 Mar 2021 14:44:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fu81fKlLAFW3uWu/bLxRNDUvKBG2yYeAnb3WyHS2HYs=; b=i2D9Kvc38yv1+9Yg84HLOFvIj9mFhkPa4EQeF5f2pXhvHbMBxjLllQwMPXJr4UFr/y cfI4n/BFe00XtdBB75mU84a4W4d4neWyIqhcS0GKiXU3jfJStFqi1mI7Mi2q6+6lN1qh j1J+fmiqLPot13NcFuv98Qw/vZNk3kKN6M3JwP7pkB2Yq4ei60MmlKUVAD2VVa9w8nbz N5TIgEAE9Eg0nVCIHEx2NRetF36wk4pYrsi8LbM0eoVbbWuwvdcV3jh5GeKov1RfGGqv Ix6qYpgXOCB39/8CRmalzTqb9im5rGaFrTKUKgUUCW3+XK4TNsStCkUZjJyrprCfnImR YwvQ== 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:mime-version:content-transfer-encoding; bh=fu81fKlLAFW3uWu/bLxRNDUvKBG2yYeAnb3WyHS2HYs=; b=kQthNVpxwLT5DNlZjlStQOhpBhv31eyqx+lDXTUuqrpiKbz9XfcXXD0vGi6JNfYK/n RivZXmlGt3FdEp8BwqvHYUvq7861KPPayaWkVcYxcbMZOqqrBiZruq9tGeJjTcka4M8N eYbKZdnugLF9kHqO6lcarl33KfqzMz9lDRXefhJ8QunrDETisIf/ffR1qcAoBqn9rpxL rkRexl+8BGODLAiZnbkbUKm3RDIV6FcNQ7G6b1BJYyjbyy/vMn4U4PMsr8UogV3AwWIY azBo3TaKoowLsrKNbXqFByRUB2YwVmf3/NSDJHK0r3It2mSUBAVH7N4PnHRw5MYK14mz +Aqg== X-Gm-Message-State: AOAM532l0F6ODvtzSBdUZ9PiVz4I3M1GgFRd24EcWYl2GsN3LbeV30Ic +R0gAM8LertjH0EzHPpCKa4= X-Google-Smtp-Source: ABdhPJw1Bh3uTOzY3WJs21ahYpj3zCQzEsKR1F92diGcN0Y5rVLTdvEvatOTRqX0BfdYFVq3ERGFkQ== X-Received: by 2002:a17:907:119b:: with SMTP id uz27mr5822994ejb.464.1616622252580; Wed, 24 Mar 2021 14:44:12 -0700 (PDT) Received: from Ansuel-xps.localdomain (host-79-34-220-97.business.telecomitalia.it. [79.34.220.97]) by smtp.googlemail.com with ESMTPSA id z9sm1871211edr.75.2021.03.24.14.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 14:44:12 -0700 (PDT) From: Ansuel Smith To: Thara Gopinath Cc: Ansuel Smith , Amit Kucheria , Andy Gross , Bjorn Andersson , Zhang Rui , Daniel Lezcano , Rob Herring , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v13 3/9] drivers: thermal: tsens: Convert msm8960 to reg_field Date: Wed, 24 Mar 2021 22:43:57 +0100 Message-Id: <20210324214404.798-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210324214404.798-1-ansuelsmth@gmail.com> References: <20210324214404.798-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Convert msm9860 driver to reg_field to use the init_common function. Signed-off-by: Ansuel Smith Acked-by: Thara Gopinath --- drivers/thermal/qcom/tsens-8960.c | 80 ++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 2a28a5af209e..3f4fc1ffe679 100644 --- a/drivers/thermal/qcom/tsens-8960.c +++ b/drivers/thermal/qcom/tsens-8960.c @@ -51,11 +51,22 @@ #define MIN_LIMIT_TH 0x0 #define MAX_LIMIT_TH 0xff -#define S0_STATUS_ADDR 0x3628 #define INT_STATUS_ADDR 0x363c #define TRDY_MASK BIT(7) #define TIMEOUT_US 100 +#define S0_STATUS_OFF 0x3628 +#define S1_STATUS_OFF 0x362c +#define S2_STATUS_OFF 0x3630 +#define S3_STATUS_OFF 0x3634 +#define S4_STATUS_OFF 0x3638 +#define S5_STATUS_OFF 0x3664 /* Sensors 5-10 found on apq8064/msm8960 */ +#define S6_STATUS_OFF 0x3668 +#define S7_STATUS_OFF 0x366c +#define S8_STATUS_OFF 0x3670 +#define S9_STATUS_OFF 0x3674 +#define S10_STATUS_OFF 0x3678 + static int suspend_8960(struct tsens_priv *priv) { int ret; @@ -269,6 +280,71 @@ static int get_temp_8960(const struct tsens_sensor *s, int *temp) return -ETIMEDOUT; } +static struct tsens_features tsens_8960_feat = { + .ver_major = VER_0, + .crit_int = 0, + .adc = 1, + .srot_split = 0, + .max_sensors = 11, +}; + +static const struct reg_field tsens_8960_regfields[MAX_REGFIELDS] = { + /* ----- SROT ------ */ + /* No VERSION information */ + + /* CNTL */ + [TSENS_EN] = REG_FIELD(CNTL_ADDR, 0, 0), + [TSENS_SW_RST] = REG_FIELD(CNTL_ADDR, 1, 1), + /* 8960 has 5 sensors, 8660 has 11, we only handle 5 */ + [SENSOR_EN] = REG_FIELD(CNTL_ADDR, 3, 7), + + /* ----- TM ------ */ + /* INTERRUPT ENABLE */ + /* NO INTERRUPT ENABLE */ + + /* Single UPPER/LOWER TEMPERATURE THRESHOLD for all sensors */ + [LOW_THRESH_0] = REG_FIELD(THRESHOLD_ADDR, 0, 7), + [UP_THRESH_0] = REG_FIELD(THRESHOLD_ADDR, 8, 15), + /* MIN_THRESH_0 and MAX_THRESH_0 are not present in the regfield + * Recycle CRIT_THRESH_0 and 1 to set the required regs to hardcoded temp + * MIN_THRESH_0 -> CRIT_THRESH_1 + * MAX_THRESH_0 -> CRIT_THRESH_0 + */ + [CRIT_THRESH_1] = REG_FIELD(THRESHOLD_ADDR, 16, 23), + [CRIT_THRESH_0] = REG_FIELD(THRESHOLD_ADDR, 24, 31), + + /* UPPER/LOWER INTERRUPT [CLEAR/STATUS] */ + /* 1 == clear, 0 == normal operation */ + [LOW_INT_CLEAR_0] = REG_FIELD(CNTL_ADDR, 9, 9), + [UP_INT_CLEAR_0] = REG_FIELD(CNTL_ADDR, 10, 10), + + /* NO CRITICAL INTERRUPT SUPPORT on 8960 */ + + /* Sn_STATUS */ + [LAST_TEMP_0] = REG_FIELD(S0_STATUS_OFF, 0, 7), + [LAST_TEMP_1] = REG_FIELD(S1_STATUS_OFF, 0, 7), + [LAST_TEMP_2] = REG_FIELD(S2_STATUS_OFF, 0, 7), + [LAST_TEMP_3] = REG_FIELD(S3_STATUS_OFF, 0, 7), + [LAST_TEMP_4] = REG_FIELD(S4_STATUS_OFF, 0, 7), + [LAST_TEMP_5] = REG_FIELD(S5_STATUS_OFF, 0, 7), + [LAST_TEMP_6] = REG_FIELD(S6_STATUS_OFF, 0, 7), + [LAST_TEMP_7] = REG_FIELD(S7_STATUS_OFF, 0, 7), + [LAST_TEMP_8] = REG_FIELD(S8_STATUS_OFF, 0, 7), + [LAST_TEMP_9] = REG_FIELD(S9_STATUS_OFF, 0, 7), + [LAST_TEMP_10] = REG_FIELD(S10_STATUS_OFF, 0, 7), + + /* No VALID field on 8960 */ + /* TSENS_INT_STATUS bits: 1 == threshold violated */ + [MIN_STATUS_0] = REG_FIELD(INT_STATUS_ADDR, 0, 0), + [LOWER_STATUS_0] = REG_FIELD(INT_STATUS_ADDR, 1, 1), + [UPPER_STATUS_0] = REG_FIELD(INT_STATUS_ADDR, 2, 2), + /* No CRITICAL field on 8960 */ + [MAX_STATUS_0] = REG_FIELD(INT_STATUS_ADDR, 3, 3), + + /* TRDY: 1=ready, 0=in progress */ + [TRDY] = REG_FIELD(INT_STATUS_ADDR, 7, 7), +}; + static const struct tsens_ops ops_8960 = { .init = init_8960, .calibrate = calibrate_8960, @@ -282,4 +358,6 @@ static const struct tsens_ops ops_8960 = { struct tsens_plat_data data_8960 = { .num_sensors = 11, .ops = &ops_8960, + .feat = &tsens_8960_feat, + .fields = tsens_8960_regfields, }; From patchwork Wed Mar 24 21:43:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 408333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3AADC433EA for ; Wed, 24 Mar 2021 21:45:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B347461A1E for ; Wed, 24 Mar 2021 21:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238575AbhCXVoi (ORCPT ); Wed, 24 Mar 2021 17:44:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234512AbhCXVoQ (ORCPT ); Wed, 24 Mar 2021 17:44:16 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A10E6C06174A; Wed, 24 Mar 2021 14:44:15 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id ce10so35337093ejb.6; Wed, 24 Mar 2021 14:44:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EDfaDBQwdj1r2Yr+BxzE8VnBhjB9D9cT/n8UjW/MV9w=; b=vUXsXDLLIPz+dHxIs1qyHqah5P5b6zDER3POEv9knK5+lCfGyLOvAnuGO7Fotqpkjf URaWkj1nIB04yBouJXBa5QBOKhLB+bQw84WRg3zMOfpbiTy8r42/ZBGT9i3S+6IkLH5U r5wLQCOJjFOPXFUhDQH+xkl/YcaZ86TUXBUmFUHdVUPTw6Fnyhh5mbTyQH/ClATgW2GR 6LrkZvX8pOTDgMWn0xyHZrQJfPpvVSyFgaBHqRuqaxFenKWgwsrV24hLJR6lP6U9/X5c ATLEJLSgGHFRy1J5qLqkfe3S9tJaShuIJdmUKRyibhgXuVk83JUs6kg2kaQT8rDPR3tO erkw== 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:mime-version:content-transfer-encoding; bh=EDfaDBQwdj1r2Yr+BxzE8VnBhjB9D9cT/n8UjW/MV9w=; b=PoF52dT8WqPToxZzSNVLqBzSn9khic67AkYkTBvaxeY4aZl2Y6zvlKqz6dR0rsH7Px Nb1Mrr0/qmNu8pR9cBD+lP/QLePRQNgcOfjsIfq9mXbATkuBMqjImWyjfQ3Xn3LuJSpT w2357k32Fky+kMv1+GvmsxtsQQw+y63rZFbQEe79N7R0E3mkYeFiWuq3a6kiyku6zBVF +yw8txlmR9reWndaIV/t2Q2Glt3PqJokBI5YnaZnSR1B0FPMprjITiOr5l2TRAt8xeI3 ZYL8OuR38deEWZ09P0LLJw82CUTa9gcCcG/DpA/k6KBuB7WhYXES+djP8TYnETfjYw6D Og/w== X-Gm-Message-State: AOAM530dYbvS6VqOvANH4yREdwfXf8ST73/HKep9eKRwdJZkz4LWsqEu zbN9yLoe0GMqJ4P5dt6RCnU= X-Google-Smtp-Source: ABdhPJwY7GWFxpCGZwvWuF/yUS/E1vr2fJcgOqVNypr/NxEg+g1LyDTWJME5qMHrDPSrt0yl4Wz6dQ== X-Received: by 2002:a17:906:7842:: with SMTP id p2mr6204945ejm.87.1616622254196; Wed, 24 Mar 2021 14:44:14 -0700 (PDT) Received: from Ansuel-xps.localdomain (host-79-34-220-97.business.telecomitalia.it. [79.34.220.97]) by smtp.googlemail.com with ESMTPSA id z9sm1871211edr.75.2021.03.24.14.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 14:44:13 -0700 (PDT) From: Ansuel Smith To: Thara Gopinath Cc: Ansuel Smith , Andy Gross , Bjorn Andersson , Amit Kucheria , Zhang Rui , Daniel Lezcano , Rob Herring , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v13 4/9] drivers: thermal: tsens: Use init_common for msm8960 Date: Wed, 24 Mar 2021 22:43:58 +0100 Message-Id: <20210324214404.798-5-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210324214404.798-1-ansuelsmth@gmail.com> References: <20210324214404.798-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Use init_common and drop custom init for msm8960. Signed-off-by: Ansuel Smith Reviewed-by: Thara Gopinath --- drivers/thermal/qcom/tsens-8960.c | 52 +------------------------------ 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 3f4fc1ffe679..86585f439985 100644 --- a/drivers/thermal/qcom/tsens-8960.c +++ b/drivers/thermal/qcom/tsens-8960.c @@ -173,56 +173,6 @@ static void disable_8960(struct tsens_priv *priv) regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl); } -static int init_8960(struct tsens_priv *priv) -{ - int ret, i; - u32 reg_cntl; - - priv->tm_map = dev_get_regmap(priv->dev, NULL); - if (!priv->tm_map) - return -ENODEV; - - /* - * The status registers for each sensor are discontiguous - * because some SoCs have 5 sensors while others have more - * but the control registers stay in the same place, i.e - * directly after the first 5 status registers. - */ - for (i = 0; i < priv->num_sensors; i++) { - if (i >= 5) - priv->sensor[i].status = S0_STATUS_ADDR + 40; - priv->sensor[i].status += i * 4; - } - - reg_cntl = SW_RST; - ret = regmap_update_bits(priv->tm_map, CNTL_ADDR, SW_RST, reg_cntl); - if (ret) - return ret; - - if (priv->num_sensors > 1) { - reg_cntl |= SLP_CLK_ENA | (MEASURE_PERIOD << 18); - reg_cntl &= ~SW_RST; - ret = regmap_update_bits(priv->tm_map, CONFIG_ADDR, - CONFIG_MASK, CONFIG); - } else { - reg_cntl |= SLP_CLK_ENA_8660 | (MEASURE_PERIOD << 16); - reg_cntl &= ~CONFIG_MASK_8660; - reg_cntl |= CONFIG_8660 << CONFIG_SHIFT_8660; - } - - reg_cntl |= GENMASK(priv->num_sensors - 1, 0) << SENSOR0_SHIFT; - ret = regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl); - if (ret) - return ret; - - reg_cntl |= EN; - ret = regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl); - if (ret) - return ret; - - return 0; -} - static int calibrate_8960(struct tsens_priv *priv) { int i; @@ -346,7 +296,7 @@ static const struct reg_field tsens_8960_regfields[MAX_REGFIELDS] = { }; static const struct tsens_ops ops_8960 = { - .init = init_8960, + .init = init_common, .calibrate = calibrate_8960, .get_temp = get_temp_8960, .enable = enable_8960, From patchwork Wed Mar 24 21:44:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 408332 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B602C433F1 for ; Wed, 24 Mar 2021 21:45:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7738661A39 for ; Wed, 24 Mar 2021 21:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230468AbhCXVok (ORCPT ); Wed, 24 Mar 2021 17:44:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233614AbhCXVoT (ORCPT ); Wed, 24 Mar 2021 17:44:19 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBD8AC06174A; Wed, 24 Mar 2021 14:44:18 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id jy13so35313728ejc.2; Wed, 24 Mar 2021 14:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eiZ/OUht/kOLQVInECTqjo/bGxXXWMawhAot8IzJzB8=; b=VbbDJdRCpNaCCNPNYmuFR7FvSYuGVigTDdkuML0ukmfdNFDPmLTFym3RJq9FBOykSM bNC2KmyH5CWf2ESliwWpjAsxm4otVWaLFr0q6h8fCiaCUgCtbKO//t5cgu5LcHrw49A0 7G0px/oL40qoQGXbHMBreMCKerVwFfHStuuU/TKSYrzOce73c/424EhsRqT2Eg+Oxoxe 9/EKKsUHwUcUSFdYGQz9h0PR/gLvDEw0apJI1xNZJ8zuLfh56RUalZxsuj7wT14TKsly vpxlGJpLpV3bXEP87QSW7nlIGKfzgWCSRiZUFYEFUkcakKBLoljbwy8SQsW1NbFfWIe0 ypTw== 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:mime-version:content-transfer-encoding; bh=eiZ/OUht/kOLQVInECTqjo/bGxXXWMawhAot8IzJzB8=; b=ChYfXHsAFBUqfnCK83rfCczNmcI1V8mKrWY2FdunZWq2OiN+UfIDiWZ/xF3607Hvs/ cb6pEHQ5LqGA8C3fVnnyNRu9Usd8gq+ZvS0uKXTuBrRmzzff5IPk4ayy1gUJG5AcAwYG x4m1kYEZFo6eeMzmcq9OrETqgdFBOMly0t8+FoOFgxbRzd3oMgzcW4A7JxA61t5V5aNn lmPXoldA7IFszeR+81arXTfwKkQ2FN3l28EUTzc9NVwb7YSdjz7Sp6Ctnv/w4gbT0fYW a7qYLJ0UD7wjcblDhTv+djvsbCAKsRgBufeBuUCZflH4eBw2c3ttCnbj5jAiYEkptiYR +5jQ== X-Gm-Message-State: AOAM5311E1LTXgjU3yNCbk/NopR0NwjykUPPdvgVtnecgNcqH/2VQ90N u7dFPI2L9zDjvu6TlXSH++k= X-Google-Smtp-Source: ABdhPJw0657aWt0rjTjUMXuSidEn8WNuq/LYrmKuVSe/+dggYcg5MMIhhqObVRRHGG0RhYa+M9R2Rw== X-Received: by 2002:a17:906:6bd1:: with SMTP id t17mr6003777ejs.319.1616622257378; Wed, 24 Mar 2021 14:44:17 -0700 (PDT) Received: from Ansuel-xps.localdomain (host-79-34-220-97.business.telecomitalia.it. [79.34.220.97]) by smtp.googlemail.com with ESMTPSA id z9sm1871211edr.75.2021.03.24.14.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 14:44:17 -0700 (PDT) From: Ansuel Smith To: Thara Gopinath Cc: Ansuel Smith , Amit Kucheria , Andy Gross , Bjorn Andersson , Zhang Rui , Daniel Lezcano , Rob Herring , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v13 6/9] drivers: thermal: tsens: Replace custom 8960 apis with generic apis Date: Wed, 24 Mar 2021 22:44:00 +0100 Message-Id: <20210324214404.798-7-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210324214404.798-1-ansuelsmth@gmail.com> References: <20210324214404.798-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Rework calibrate function to use common function. Derive the offset from a missing hardcoded slope table and the data from the nvmem calib efuses. Drop custom get_temp function and use generic api. Signed-off-by: Ansuel Smith Acked-by: Thara Gopinath --- drivers/thermal/qcom/tsens-8960.c | 56 +++++++++---------------------- 1 file changed, 15 insertions(+), 41 deletions(-) diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 95fcccafae14..9cc8a7dd23ae 100644 --- a/drivers/thermal/qcom/tsens-8960.c +++ b/drivers/thermal/qcom/tsens-8960.c @@ -67,6 +67,13 @@ #define S9_STATUS_OFF 0x3674 #define S10_STATUS_OFF 0x3678 +/* Original slope - 200 to compensate mC to C inaccuracy */ +static u32 tsens_msm8960_slope[] = { + 976, 976, 954, 976, + 911, 932, 932, 999, + 932, 999, 932 + }; + static int suspend_8960(struct tsens_priv *priv) { int ret; @@ -194,9 +201,7 @@ static int calibrate_8960(struct tsens_priv *priv) { int i; char *data; - - ssize_t num_read = priv->num_sensors; - struct tsens_sensor *s = priv->sensor; + u32 p1[11]; data = qfprom_read(priv->dev, "calib"); if (IS_ERR(data)) @@ -204,49 +209,18 @@ static int calibrate_8960(struct tsens_priv *priv) if (IS_ERR(data)) return PTR_ERR(data); - for (i = 0; i < num_read; i++, s++) - s->offset = data[i]; + for (i = 0; i < priv->num_sensors; i++) { + p1[i] = data[i]; + priv->sensor[i].slope = tsens_msm8960_slope[i]; + } + + compute_intercept_slope(priv, p1, NULL, ONE_PT_CALIB); kfree(data); return 0; } -/* Temperature on y axis and ADC-code on x-axis */ -static inline int code_to_mdegC(u32 adc_code, const struct tsens_sensor *s) -{ - int slope, offset; - - slope = thermal_zone_get_slope(s->tzd); - offset = CAL_MDEGC - slope * s->offset; - - return adc_code * slope + offset; -} - -static int get_temp_8960(const struct tsens_sensor *s, int *temp) -{ - int ret; - u32 code, trdy; - struct tsens_priv *priv = s->priv; - unsigned long timeout; - - timeout = jiffies + usecs_to_jiffies(TIMEOUT_US); - do { - ret = regmap_read(priv->tm_map, INT_STATUS_ADDR, &trdy); - if (ret) - return ret; - if (!(trdy & TRDY_MASK)) - continue; - ret = regmap_read(priv->tm_map, s->status, &code); - if (ret) - return ret; - *temp = code_to_mdegC(code, s); - return 0; - } while (time_before(jiffies, timeout)); - - return -ETIMEDOUT; -} - static struct tsens_features tsens_8960_feat = { .ver_major = VER_0, .crit_int = 0, @@ -315,7 +289,7 @@ static const struct reg_field tsens_8960_regfields[MAX_REGFIELDS] = { static const struct tsens_ops ops_8960 = { .init = init_common, .calibrate = calibrate_8960, - .get_temp = get_temp_8960, + .get_temp = get_temp_common, .enable = enable_8960, .disable = disable_8960, .suspend = suspend_8960, From patchwork Wed Mar 24 21:44:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 408330 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E5BEC4345E for ; Wed, 24 Mar 2021 21:45:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BBCB61A1E for ; Wed, 24 Mar 2021 21:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238614AbhCXVol (ORCPT ); Wed, 24 Mar 2021 17:44:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238576AbhCXVoU (ORCPT ); Wed, 24 Mar 2021 17:44:20 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DAB4C06174A; Wed, 24 Mar 2021 14:44:20 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id h13so136613eds.5; Wed, 24 Mar 2021 14:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SSBymFhhyIOqT321UgDWQ2JC+SXzbKlWvarnWPwT9jc=; b=eRRGczY/AFREH2iz5vPYz933QY+0K3hTmtDIqPlIqoa8VRJUc7wEjomilHoIBz3+sH YqJldE72EyxJzlm/3+khPDvW8XwqmA9fayrLuUeJiPOBjoxEHVF8b4S09stHrZQ7req5 bglgZylgBcJ4L20sup4+fShG+3yB0qNv8ENurZ8R5DBa0bmUDV4f8jcgxC+Pi1bw9xBc TmcQa1yLje5wIRZZEiMsERQ7QKU88cTGZyLtZgXMz7BfVRNLe+CP/n/cCl0ll6QtymDk hxd8GgjAF70Eal/Tv1FvgQw3J34tPsvEWqmXTvvhwVXNkR+ZBJONF3qUxNTrTd4pAatV dRfw== 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:mime-version:content-transfer-encoding; bh=SSBymFhhyIOqT321UgDWQ2JC+SXzbKlWvarnWPwT9jc=; b=bOjK+C3qDZ3kRsd6XofsisKdPxGFJV98o5jPbN+1tyldvj74o3KxUMot1BOuWvCn79 5W0/F+IdVKEzy9esNRQ5DqiCMYPwqxLLr1k/+MjmDQK/V8Kx1QQbsnT8u4xKpE7unSYU tiSkVcs0EdalzDqIJoa9rvjyKHvsYhy9W0LJrUNJLuhj3Af0gjbSyD1E1jEgPHsLCwz0 GEIryj/IdCMrf0P9OdozeWgBN6So0zCbImUxROpAeCOQefSI5fEhfAy4YcWONRV6Bv4y PzL7ejcErdsYlisttjtsPdQxHBM1WCq+63nT6Oif2fgJ4kHnCTHSREG+KkrzOnvzuQid 5ADg== X-Gm-Message-State: AOAM531BQE67gUZFZiXMJ8oXFw7ypcYBnvhyluEoGXweaoDPrL0CjaBe ivt07CX5ZJSvBRjeeOKFIHM64u0Nqj4= X-Google-Smtp-Source: ABdhPJx3QR9xcwie7j9XRJMhlK9MmTzjUKCvEa4+RYsQzoqNy1NEl4+bQ4jYoisCA78Vi6JGNwgl7g== X-Received: by 2002:aa7:c3c4:: with SMTP id l4mr5583334edr.335.1616622259008; Wed, 24 Mar 2021 14:44:19 -0700 (PDT) Received: from Ansuel-xps.localdomain (host-79-34-220-97.business.telecomitalia.it. [79.34.220.97]) by smtp.googlemail.com with ESMTPSA id z9sm1871211edr.75.2021.03.24.14.44.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 14:44:18 -0700 (PDT) From: Ansuel Smith To: Thara Gopinath Cc: Ansuel Smith , Andy Gross , Bjorn Andersson , Amit Kucheria , Zhang Rui , Daniel Lezcano , Rob Herring , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v13 7/9] drivers: thermal: tsens: Drop unused define for msm8960 Date: Wed, 24 Mar 2021 22:44:01 +0100 Message-Id: <20210324214404.798-8-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210324214404.798-1-ansuelsmth@gmail.com> References: <20210324214404.798-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Drop unused define for msm8960 replaced by generic api and reg_field. Signed-off-by: Ansuel Smith Reviewed-by: Thara Gopinath --- drivers/thermal/qcom/tsens-8960.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 9cc8a7dd23ae..58d09e927383 100644 --- a/drivers/thermal/qcom/tsens-8960.c +++ b/drivers/thermal/qcom/tsens-8960.c @@ -10,8 +10,6 @@ #include #include "tsens.h" -#define CAL_MDEGC 30000 - #define CONFIG_ADDR 0x3640 #define CONFIG_ADDR_8660 0x3620 /* CONFIG_ADDR bitmasks */ @@ -21,39 +19,19 @@ #define CONFIG_SHIFT_8660 28 #define CONFIG_MASK_8660 (3 << CONFIG_SHIFT_8660) -#define STATUS_CNTL_ADDR_8064 0x3660 #define CNTL_ADDR 0x3620 /* CNTL_ADDR bitmasks */ #define EN BIT(0) #define SW_RST BIT(1) -#define SENSOR0_EN BIT(3) + #define MEASURE_PERIOD BIT(18) #define SLP_CLK_ENA BIT(26) #define SLP_CLK_ENA_8660 BIT(24) #define SENSOR0_SHIFT 3 -/* INT_STATUS_ADDR bitmasks */ -#define MIN_STATUS_MASK BIT(0) -#define LOWER_STATUS_CLR BIT(1) -#define UPPER_STATUS_CLR BIT(2) -#define MAX_STATUS_MASK BIT(3) - #define THRESHOLD_ADDR 0x3624 -/* THRESHOLD_ADDR bitmasks */ -#define THRESHOLD_MAX_LIMIT_SHIFT 24 -#define THRESHOLD_MIN_LIMIT_SHIFT 16 -#define THRESHOLD_UPPER_LIMIT_SHIFT 8 -#define THRESHOLD_LOWER_LIMIT_SHIFT 0 - -/* Initial temperature threshold values */ -#define LOWER_LIMIT_TH 0x50 -#define UPPER_LIMIT_TH 0xdf -#define MIN_LIMIT_TH 0x0 -#define MAX_LIMIT_TH 0xff #define INT_STATUS_ADDR 0x363c -#define TRDY_MASK BIT(7) -#define TIMEOUT_US 100 #define S0_STATUS_OFF 0x3628 #define S1_STATUS_OFF 0x362c From patchwork Wed Mar 24 21:44:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 408331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ACC2C43446 for ; Wed, 24 Mar 2021 21:45:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D762061A21 for ; Wed, 24 Mar 2021 21:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238622AbhCXVom (ORCPT ); Wed, 24 Mar 2021 17:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238577AbhCXVoY (ORCPT ); Wed, 24 Mar 2021 17:44:24 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAEE0C06174A; Wed, 24 Mar 2021 14:44:23 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id l18so113077edc.9; Wed, 24 Mar 2021 14:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=21TRq5T7n/YlJzaiHd/rYW7/ONn9U06XAcWKZPDtNYI=; b=kF+NCah/EVPAXGmpxeftPScbCYp5REz87xSOKWqgMpHa7eWAklrqHZlsFaN1y8/4jO AVcbJ1wfXLc2/b+ytYDQ0Qu5dFHlyj+w+f6yruJW9OjDJPgKX8+yq4bIu3uoBA4i3i1U Tjm5mFinBmqHoAARKHE48JD+LUIogVRvwrEJhBgYh7PyPNhI9FQQMbjpknBgIKPWtxvb oK76ogwZ96JNAIcl+QBIa28Dd7WdTU7UDUwlG4FZhaxTn6wOkbUk2BK6WspCm15fVIMi IGjGlD5hHDGORwlbkFvjUXYUJLM7nQoZJSyq8m+Vsd4DAMuhUj9KyQLTRuNK1d2Vp/kY aqSg== 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:mime-version:content-transfer-encoding; bh=21TRq5T7n/YlJzaiHd/rYW7/ONn9U06XAcWKZPDtNYI=; b=I6FcKVxAte9y2PtinI2ee9AFxkd7axTTSwO5tH3DCl5CWbUvLR7253caZAQmN/VxAx mG+YnjCFoXMvM2CW2DJLCd2boukI2E/8TuvRUmzDUKA7mjiEbd4ffP2faLmcf3K4Gh0r YK7+vcNASNzqVUdsPBwzU/vG4V9LIuAWDy7rx6bVRT+XaTZUX7ojPePmAvq487zp/moH +BLhKZ88ckSsl+5phYol02TbL+9JmkNdNIOHnPbQ6Pumrs21YBRmSoS21K2ClgN53/Um /oSpo3oavjSgHhWQRAehGvpsiLaG5g6ZWyeK4EdMmlcOq/hHjzdqK4ZYNL7BRYyGM0hC atVw== X-Gm-Message-State: AOAM5325+HEH9Jq1aDe9udhCykwU8HosaX9DoqpajHz+WVWiV42Xd2BA JnWzKM7yVoNg1YLH2zDW3cE= X-Google-Smtp-Source: ABdhPJyaTpezBnijEbWtNHFTUtQrYf2y5z/n6gFhEZlmw+gU6i6JN5lWNChqXNqExTeW6A1ECP+sjA== X-Received: by 2002:aa7:c14a:: with SMTP id r10mr5474571edp.132.1616622262403; Wed, 24 Mar 2021 14:44:22 -0700 (PDT) Received: from Ansuel-xps.localdomain (host-79-34-220-97.business.telecomitalia.it. [79.34.220.97]) by smtp.googlemail.com with ESMTPSA id z9sm1871211edr.75.2021.03.24.14.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 14:44:22 -0700 (PDT) From: Ansuel Smith To: Thara Gopinath Cc: Ansuel Smith , Rob Herring , Andy Gross , Bjorn Andersson , Amit Kucheria , Zhang Rui , Daniel Lezcano , Rob Herring , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v13 9/9] dt-bindings: thermal: tsens: Document ipq8064 bindings Date: Wed, 24 Mar 2021 22:44:03 +0100 Message-Id: <20210324214404.798-10-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210324214404.798-1-ansuelsmth@gmail.com> References: <20210324214404.798-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Document the use of bindings used for msm8960 tsens based devices. msm8960 use the same gcc regs and is set as a child of the qcom gcc. Signed-off-by: Ansuel Smith Reviewed-by: Rob Herring --- .../bindings/thermal/qcom-tsens.yaml | 56 ++++++++++++++++--- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml index 95462e071ab4..1785b1c75a3c 100644 --- a/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml +++ b/Documentation/devicetree/bindings/thermal/qcom-tsens.yaml @@ -19,6 +19,11 @@ description: | properties: compatible: oneOf: + - description: msm9860 TSENS based + items: + - enum: + - qcom,ipq8064-tsens + - description: v0.1 of TSENS items: - enum: @@ -73,7 +78,9 @@ properties: maxItems: 2 items: - const: calib - - const: calib_sel + - enum: + - calib_backup + - calib_sel "#qcom,sensors": description: @@ -88,12 +95,20 @@ properties: Number of cells required to uniquely identify the thermal sensors. Since we have multiple sensors this is set to 1 +required: + - compatible + - interrupts + - interrupt-names + - "#thermal-sensor-cells" + - "#qcom,sensors" + allOf: - if: properties: compatible: contains: enum: + - qcom,ipq8064-tsens - qcom,msm8916-tsens - qcom,msm8974-tsens - qcom,msm8976-tsens @@ -114,17 +129,42 @@ allOf: interrupt-names: minItems: 2 -required: - - compatible - - reg - - "#qcom,sensors" - - interrupts - - interrupt-names - - "#thermal-sensor-cells" + - if: + properties: + compatible: + contains: + enum: + - qcom,tsens-v0_1 + - qcom,tsens-v1 + - qcom,tsens-v2 + + then: + required: + - reg additionalProperties: false examples: + - | + #include + // Example msm9860 based SoC (ipq8064): + gcc: clock-controller { + + /* ... */ + + tsens: thermal-sensor { + compatible = "qcom,ipq8064-tsens"; + + nvmem-cells = <&tsens_calib>, <&tsens_calib_backup>; + nvmem-cell-names = "calib", "calib_backup"; + interrupts = ; + interrupt-names = "uplow"; + + #qcom,sensors = <11>; + #thermal-sensor-cells = <1>; + }; + }; + - | #include // Example 1 (legacy: for pre v1 IP):