From patchwork Tue Apr 20 18:33:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 424850 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, 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 2D496C43461 for ; Tue, 20 Apr 2021 18:34:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA94E613D8 for ; Tue, 20 Apr 2021 18:34:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233532AbhDTSeg (ORCPT ); Tue, 20 Apr 2021 14:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233381AbhDTSef (ORCPT ); Tue, 20 Apr 2021 14:34:35 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC8F6C06138A; Tue, 20 Apr 2021 11:34:02 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id h10so46254230edt.13; Tue, 20 Apr 2021 11:34:02 -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=TsKSaKVr8eqOkpvXK9OW60ORfpfmzSRm1tZjKRVxrds=; b=d4rHJtqKlz16XoOUweOadeJsl83KmgaprZcKHJKwzLvadt3lMmoCwF17aP22OwVK8g 2/9ndF+dTV9eE2h+3jW6kWwCU/tpctjiQtuuV78FD2JoFj1IyjMgeLKIXMDcewvmC6qI 71C+/qZlTjnX47wuZYhua8qt2nfrpExvgX3Jd7NNYdLLIydrZ1n7ONj4i10JLWzuU0qX fCjvmnM5ZJr2lyajlSpf3e8UAcy7+Z8afoUopFQ8LBwJbd2Y3RYsKibMu+QwE2prqiNa dVbRiyA4H3U3vVycZnn59mRqSKtI7CUrlyROEHrqjb0Z5IOXb2SzFVAqzLNZg+Ch7Ilj XrdA== 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=TsKSaKVr8eqOkpvXK9OW60ORfpfmzSRm1tZjKRVxrds=; b=brp/h8claMexACl6ueNWiMfhXLPzB/vpkbxzRhPCMf0Jx6JDDbXBXkaa4IWkp8GNak 5aytZJ2RpPIgK1Sso8QIhgCYxB4GsWFpFJzWvObnccqEYVWE8nRTOf01drAQ+zYb5hNP YNd/irTn+e73ZXj8FA1ZPxERSjMsjjj6U8nOMuLMRFoiqZf7/Xz0nWZcJCyClcNp+1pO shnRyrhQASRU/kClSsfFH8VBJxp/lEuI9O4C6+8I8GkAgihlcPw4Vc0nkeO+2fgtzQtB 9IfP1snzoP3eYS0+iF0brSGJkTWeapYnKEvm10TKin6hQLdKXPM5eUyMqAR7qplch2Z1 gXMw== X-Gm-Message-State: AOAM5333D3f+VSVAEjRatY0gJWWONrWOkkeCnAxMdX3SUW+Nu5H91rpo 8s9kdZrHS7TFmdzaKkMxtH8= X-Google-Smtp-Source: ABdhPJwVnvlTj/f73js9LWNlyL9kTBLX28ndldorz4gVTC2TLUP3EsIuATQ2N6wfNhOe7Em877HZ/g== X-Received: by 2002:a50:eb0d:: with SMTP id y13mr6090392edp.326.1618943641591; Tue, 20 Apr 2021 11:34:01 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id n10sm13357141ejg.124.2021.04.20.11.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 11:34:01 -0700 (PDT) From: Ansuel Smith To: Daniel Lezcano Cc: Ansuel Smith , Thara Gopinath , Amit Kucheria , Andy Gross , Bjorn Andersson , Zhang Rui , Rob Herring , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [thermal PATCH v15 1/9] drivers: thermal: tsens: Don't hardcode sensor slope Date: Tue, 20 Apr 2021 20:33:35 +0200 Message-Id: <20210420183343.2272-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210420183343.2272-1-ansuelsmth@gmail.com> References: <20210420183343.2272-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Function compute_intercept_slope hardcode the sensor slope to SLOPE_DEFAULT. Change this and use the default value only if a slope is not defined. This is needed for tsens VER_0 that has a hardcoded slope table. Signed-off-by: Ansuel Smith Reviewed-by: Thara Gopinath --- drivers/thermal/qcom/tsens.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 8d3e94d2a..562c438ff 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -85,7 +85,8 @@ void compute_intercept_slope(struct tsens_priv *priv, u32 *p1, "%s: sensor%d - data_point1:%#x data_point2:%#x\n", __func__, i, p1[i], p2[i]); - priv->sensor[i].slope = SLOPE_DEFAULT; + if (!priv->sensor[i].slope) + priv->sensor[i].slope = SLOPE_DEFAULT; if (mode == TWO_PT_CALIB) { /* * slope (m) = adc_code2 - adc_code1 (y2 - y1)/ From patchwork Tue Apr 20 18:33:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 424849 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,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 4C7DAC43461 for ; Tue, 20 Apr 2021 18:34:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 104B0613E4 for ; Tue, 20 Apr 2021 18:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233574AbhDTSel (ORCPT ); Tue, 20 Apr 2021 14:34:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbhDTSej (ORCPT ); Tue, 20 Apr 2021 14:34:39 -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 BF25EC06174A; Tue, 20 Apr 2021 11:34:04 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id h10so46254313edt.13; Tue, 20 Apr 2021 11:34:04 -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=737hIwn3pods25c8zCbCGP0noOsJUI3v0XpSgnln2no=; b=rxiJGGTcBqWxKSZaTlWQtUL6gPZ1Hfbf+P0DLOZjdyP0/rcK021JJYZwkaZnXvFoMa Xs1xAc8sC0KYTO2gmjh7wftkLPkUMZUxnkXkLs3mFGE/EWOTDu9+/f5mwhcyEneDPZO7 NxvZPHbVzR+BbmtG40POUsMW2w9LxMpzeJ8tjIS2GOTJXl82qhplVtnO91UACvrO4H9m cAt3viEIw8ByPRCWq3XM0FK0JidZMKnXCxbrmWzioR5SlQLzf5NkJFbd+RE9ss9tbhg8 Zcyw19+M77jAkm2r0fGrHYW8mdOEJ8mo75YyC2c92+RgGDG0gEOB2SvrWs7P1ADCAM/Q JhUA== 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=737hIwn3pods25c8zCbCGP0noOsJUI3v0XpSgnln2no=; b=KP0JdbBYVHHfRmtd7v4T8H+nnbxk5aaLxLN8LyWjkjiQ0fQyeramV7/UdHcaGbAwr/ C1E5CN5P12cybyd4dIm13ouQ6MXQsYUcCp4+CMDQ6gbIIP8WZr+OC5BfqBeP1MUsS0Wm aohpGOFj9+jzbNi//rvawWbHtqOxWHJk6W+f59UKX1Ptk7zrAmcKAF+BE5RB/KUgLP09 T4lOWDRumdIROX6u8B85iPA+9RhGDF4zFi6tJyuAyethLNjxFPPzy3ks8HQvCH7Zubok pTO+AMC5jGGBFrvRz2UM4jev1OtpuMEHTXeIdeR6DkhiC8p8a6eY9JW9mYKxoy5mPsRH flmQ== X-Gm-Message-State: AOAM530taHPCVFqtg2hbmFOJuBlX+rtooxPOeH7W0UGMr7Dt9y6uofjx SJzv34iU3EJP6mfBCxy07vg3VNcOnKp2VA== X-Google-Smtp-Source: ABdhPJyuMrP9eVLWpML0qlk/eabKQdCAr+2D8Oi5vKhs8Zd3JzzhX0o7j8zL6PuNi2x9Nlal69SnQg== X-Received: by 2002:aa7:cd6e:: with SMTP id ca14mr17477070edb.111.1618943643368; Tue, 20 Apr 2021 11:34:03 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id n10sm13357141ejg.124.2021.04.20.11.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 11:34:02 -0700 (PDT) From: Ansuel Smith To: Daniel Lezcano Cc: Ansuel Smith , Thara Gopinath , Amit Kucheria , Andy Gross , Bjorn Andersson , Zhang Rui , Rob Herring , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [thermal PATCH v15 2/9] drivers: thermal: tsens: Convert msm8960 to reg_field Date: Tue, 20 Apr 2021 20:33:36 +0200 Message-Id: <20210420183343.2272-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210420183343.2272-1-ansuelsmth@gmail.com> References: <20210420183343.2272-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 | 73 ++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 2a28a5af2..0d0c2647d 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; @@ -179,7 +190,7 @@ static int init_8960(struct tsens_priv *priv) */ for (i = 0; i < priv->num_sensors; i++) { if (i >= 5) - priv->sensor[i].status = S0_STATUS_ADDR + 40; + priv->sensor[i].status = S0_STATUS_OFF + 40; priv->sensor[i].status += i * 4; } @@ -269,6 +280,63 @@ static int get_temp_8960(const struct tsens_sensor *s, int *temp) return -ETIMEDOUT; } +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 +350,5 @@ static const struct tsens_ops ops_8960 = { struct tsens_plat_data data_8960 = { .num_sensors = 11, .ops = &ops_8960, + .fields = tsens_8960_regfields, }; From patchwork Tue Apr 20 18:33:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 424848 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, 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 F316FC433B4 for ; Tue, 20 Apr 2021 18:34:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B8A70613DD for ; Tue, 20 Apr 2021 18:34:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233595AbhDTSep (ORCPT ); Tue, 20 Apr 2021 14:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233581AbhDTSel (ORCPT ); Tue, 20 Apr 2021 14:34:41 -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 C0322C06138A; Tue, 20 Apr 2021 11:34:06 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id l4so59719401ejc.10; Tue, 20 Apr 2021 11:34:06 -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=cgR5/mxzM1+Fj9kTK0T9EAkQTgjyT5GnY4XwENoVN7s=; b=IY4QZ7lWFo+GW2wHVUz61EMQBwUw3XHRgDxR/HJvOfWuIeuZrAdQt6A1u2azhu6rOd qZPvJ418Ac/ScU1Nzxc79fJ7edY1NMf1eB0gdVTUKsgseenCoCPdxIDoCG1mc0uVzOMj UIuEL18A1mBKYggQFWFl0bAt2Ga8K3dI398+jVP+MooLLaWaq/s0zLRhmJpnD3iWdk7z 7pVTabLKJSc0qSS0qfX07GiVC7aJ4HdRxTaSnK5Ie35e3tryHxG/apiCZchNcAqazQ+S KAyaZ72z3L28GC1yf1UbkHRVcvBJ0YHAaXRpYpMHEGUPkH0MCsmOOaY0iQpwg++v80GX C3Kg== 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=cgR5/mxzM1+Fj9kTK0T9EAkQTgjyT5GnY4XwENoVN7s=; b=N0T3KyCTVcpz5BGdLOXr7PuZYngkMhJQr661RHpZMRrt3nnpDK1KYAhD29jBqM7zwT NNuUgnN11QzO70V75kcQXBNoMFp8Pbv6U6+PlqZE5kS/rYOK13QsL7549ziNRr33AcT1 CiVPIE2N4yLadLmzw2njOlsHY/PFt/vETKKzYkQzVu5fXDRrBNkZCIMBx4EdPVR9smBD LyRlbm9y6iFcWKB5UJTAc5yM2Sz/q/3INvNyO7w6fl5ubCBjV7tJDgm6UPMrenNTwPxl RN0ysWk8P9PXmvJCwJ71lpwz20XhclNhrf6PZbsEYSHT9LszyjjwUN5ootH3E403e6dO 4a9A== X-Gm-Message-State: AOAM531ijRu10uZbrdCMXO9/41lP7l+e1RtJlGysBRvQRCskmTWt0trZ UMl00umq7FrgCpr1DtQ4/pk= X-Google-Smtp-Source: ABdhPJxLNol6C8JGwgifsVn8z4e1vEAehiBwRgbY3GliTwEEZ8URLe8sjvI6SAu3RPbh1CgIaD1tog== X-Received: by 2002:a17:907:3f9f:: with SMTP id hr31mr28658466ejc.349.1618943645397; Tue, 20 Apr 2021 11:34:05 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id n10sm13357141ejg.124.2021.04.20.11.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 11:34:04 -0700 (PDT) From: Ansuel Smith To: Daniel Lezcano Cc: Ansuel Smith , Thara Gopinath , kernel test robot , Dan Carpenter , Andy Gross , Bjorn Andersson , Amit Kucheria , Zhang Rui , Rob Herring , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [thermal PATCH v15 3/9] drivers: thermal: tsens: Add VER_0 tsens version Date: Tue, 20 Apr 2021 20:33:37 +0200 Message-Id: <20210420183343.2272-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210420183343.2272-1-ansuelsmth@gmail.com> References: <20210420183343.2272-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org VER_0 is used to describe device based on tsens version before v0.1. These device are devices based on msm8960 for example apq8064 or ipq806x. Add support for VER_0 in tsens.c and set the right tsens feat in tsens-8960.c file. Signed-off-by: Ansuel Smith Reviewed-by: Thara Gopinath Reported-by: kernel test robot Reported-by: Dan Carpenter --- drivers/thermal/qcom/tsens-8960.c | 9 ++ drivers/thermal/qcom/tsens.c | 150 ++++++++++++++++++++++++------ drivers/thermal/qcom/tsens.h | 4 +- 3 files changed, 133 insertions(+), 30 deletions(-) diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c index 0d0c2647d..0dd15e812 100644 --- a/drivers/thermal/qcom/tsens-8960.c +++ b/drivers/thermal/qcom/tsens-8960.c @@ -347,8 +347,17 @@ static const struct tsens_ops ops_8960 = { .resume = resume_8960, }; +static struct tsens_features tsens_8960_feat = { + .ver_major = VER_0, + .crit_int = 0, + .adc = 1, + .srot_split = 0, + .max_sensors = 11, +}; + struct tsens_plat_data data_8960 = { .num_sensors = 11, .ops = &ops_8960, + .feat = &tsens_8960_feat, .fields = tsens_8960_regfields, }; diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 562c438ff..be0c5931f 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -516,6 +517,15 @@ irqreturn_t tsens_irq_thread(int irq, void *data) dev_dbg(priv->dev, "[%u] %s: no violation: %d\n", hw_id, __func__, temp); } + + if (tsens_version(priv) < VER_0_1) { + /* Constraint: There is only 1 interrupt control register for all + * 11 temperature sensor. So monitoring more than 1 sensor based + * on interrupts will yield inconsistent result. To overcome this + * issue we will monitor only sensor 0 which is the master sensor. + */ + break; + } } return IRQ_HANDLED; @@ -531,6 +541,13 @@ int tsens_set_trips(void *_sensor, int low, int high) int high_val, low_val, cl_high, cl_low; u32 hw_id = s->hw_id; + if (tsens_version(priv) < VER_0_1) { + /* Pre v0.1 IP had a single register for each type of interrupt + * and thresholds + */ + hw_id = 0; + } + dev_dbg(dev, "[%u] %s: proposed thresholds: (%d:%d)\n", hw_id, __func__, low, high); @@ -585,18 +602,21 @@ int get_temp_tsens_valid(const struct tsens_sensor *s, int *temp) u32 valid; int ret; - ret = regmap_field_read(priv->rf[valid_idx], &valid); - if (ret) - return ret; - while (!valid) { - /* Valid bit is 0 for 6 AHB clock cycles. - * At 19.2MHz, 1 AHB clock is ~60ns. - * We should enter this loop very, very rarely. - */ - ndelay(400); + /* VER_0 doesn't have VALID bit */ + if (tsens_version(priv) >= VER_0_1) { ret = regmap_field_read(priv->rf[valid_idx], &valid); if (ret) return ret; + while (!valid) { + /* Valid bit is 0 for 6 AHB clock cycles. + * At 19.2MHz, 1 AHB clock is ~60ns. + * We should enter this loop very, very rarely. + */ + ndelay(400); + ret = regmap_field_read(priv->rf[valid_idx], &valid); + if (ret) + return ret; + } } /* Valid bit is set, OK to read the temperature */ @@ -609,15 +629,29 @@ int get_temp_common(const struct tsens_sensor *s, int *temp) { struct tsens_priv *priv = s->priv; int hw_id = s->hw_id; - int last_temp = 0, ret; + int last_temp = 0, ret, trdy; + unsigned long timeout; - ret = regmap_field_read(priv->rf[LAST_TEMP_0 + hw_id], &last_temp); - if (ret) - return ret; + timeout = jiffies + usecs_to_jiffies(TIMEOUT_US); + do { + if (tsens_version(priv) == VER_0) { + ret = regmap_field_read(priv->rf[TRDY], &trdy); + if (ret) + return ret; + if (!trdy) + continue; + } - *temp = code_to_degc(last_temp, s) * 1000; + ret = regmap_field_read(priv->rf[LAST_TEMP_0 + hw_id], &last_temp); + if (ret) + return ret; - return 0; + *temp = code_to_degc(last_temp, s) * 1000; + + return 0; + } while (time_before(jiffies, timeout)); + + return -ETIMEDOUT; } #ifdef CONFIG_DEBUG_FS @@ -739,19 +773,34 @@ int __init init_common(struct tsens_priv *priv) priv->tm_offset = 0x1000; } - res = platform_get_resource(op, IORESOURCE_MEM, 0); - tm_base = devm_ioremap_resource(dev, res); - if (IS_ERR(tm_base)) { - ret = PTR_ERR(tm_base); - goto err_put_device; + if (tsens_version(priv) >= VER_0_1) { + res = platform_get_resource(op, IORESOURCE_MEM, 0); + tm_base = devm_ioremap_resource(dev, res); + if (IS_ERR(tm_base)) { + ret = PTR_ERR(tm_base); + goto err_put_device; + } + + priv->tm_map = devm_regmap_init_mmio(dev, tm_base, &tsens_config); + } else { /* VER_0 share the same gcc regs using a syscon */ + struct device *parent = priv->dev->parent; + + if (parent) + priv->tm_map = syscon_node_to_regmap(parent->of_node); } - priv->tm_map = devm_regmap_init_mmio(dev, tm_base, &tsens_config); - if (IS_ERR(priv->tm_map)) { - ret = PTR_ERR(priv->tm_map); + if (IS_ERR_OR_NULL(priv->tm_map)) { + if (!priv->tm_map) + ret = -ENODEV; + else + ret = PTR_ERR(priv->tm_map); goto err_put_device; } + /* VER_0 have only tm_map */ + if (!priv->srot_map) + priv->srot_map = priv->tm_map; + if (tsens_version(priv) > VER_0_1) { for (i = VER_MAJOR; i <= VER_STEP; i++) { priv->rf[i] = devm_regmap_field_alloc(dev, priv->srot_map, @@ -770,6 +819,10 @@ int __init init_common(struct tsens_priv *priv) ret = PTR_ERR(priv->rf[TSENS_EN]); goto err_put_device; } + /* in VER_0 TSENS need to be explicitly enabled */ + if (tsens_version(priv) == VER_0) + regmap_field_write(priv->rf[TSENS_EN], 1); + ret = regmap_field_read(priv->rf[TSENS_EN], &enabled); if (ret) goto err_put_device; @@ -792,6 +845,19 @@ int __init init_common(struct tsens_priv *priv) goto err_put_device; } + priv->rf[TSENS_SW_RST] = + devm_regmap_field_alloc(dev, priv->srot_map, priv->fields[TSENS_SW_RST]); + if (IS_ERR(priv->rf[TSENS_SW_RST])) { + ret = PTR_ERR(priv->rf[TSENS_SW_RST]); + goto err_put_device; + } + + priv->rf[TRDY] = devm_regmap_field_alloc(dev, priv->tm_map, priv->fields[TRDY]); + if (IS_ERR(priv->rf[TRDY])) { + ret = PTR_ERR(priv->rf[TRDY]); + goto err_put_device; + } + /* This loop might need changes if enum regfield_ids is reordered */ for (j = LAST_TEMP_0; j <= UP_THRESH_15; j += 16) { for (i = 0; i < priv->feat->max_sensors; i++) { @@ -807,7 +873,7 @@ int __init init_common(struct tsens_priv *priv) } } - if (priv->feat->crit_int) { + if (priv->feat->crit_int || tsens_version(priv) < VER_0_1) { /* Loop might need changes if enum regfield_ids is reordered */ for (j = CRITICAL_STATUS_0; j <= CRIT_THRESH_15; j += 16) { for (i = 0; i < priv->feat->max_sensors; i++) { @@ -845,7 +911,11 @@ int __init init_common(struct tsens_priv *priv) } spin_lock_init(&priv->ul_lock); - tsens_enable_irq(priv); + + /* VER_0 interrupt doesn't need to be enabled */ + if (tsens_version(priv) >= VER_0_1) + tsens_enable_irq(priv); + tsens_debug_init(op); err_put_device: @@ -941,10 +1011,19 @@ static int tsens_register_irq(struct tsens_priv *priv, char *irqname, if (irq == -ENXIO) ret = 0; } else { - ret = devm_request_threaded_irq(&pdev->dev, irq, - NULL, thread_fn, - IRQF_ONESHOT, - dev_name(&pdev->dev), priv); + /* VER_0 interrupt is TRIGGER_RISING, VER_0_1 and up is ONESHOT */ + if (tsens_version(priv) == VER_0) + ret = devm_request_threaded_irq(&pdev->dev, irq, + thread_fn, NULL, + IRQF_TRIGGER_RISING, + dev_name(&pdev->dev), + priv); + else + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, + thread_fn, IRQF_ONESHOT, + dev_name(&pdev->dev), + priv); + if (ret) dev_err(&pdev->dev, "%s: failed to get irq\n", __func__); @@ -973,6 +1052,19 @@ static int tsens_register(struct tsens_priv *priv) priv->ops->enable(priv, i); } + /* VER_0 require to set MIN and MAX THRESH + * These 2 regs are set using the: + * - CRIT_THRESH_0 for MAX THRESH hardcoded to 120°C + * - CRIT_THRESH_1 for MIN THRESH hardcoded to 0°C + */ + if (tsens_version(priv) < VER_0_1) { + regmap_field_write(priv->rf[CRIT_THRESH_0], + tsens_mC_to_hw(priv->sensor, 120000)); + + regmap_field_write(priv->rf[CRIT_THRESH_1], + tsens_mC_to_hw(priv->sensor, 0)); + } + ret = tsens_register_irq(priv, "uplow", tsens_irq_thread); if (ret < 0) return ret; diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index 59d01162c..5dbed0a3f 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -13,6 +13,7 @@ #define CAL_DEGC_PT2 120 #define SLOPE_FACTOR 1000 #define SLOPE_DEFAULT 3200 +#define TIMEOUT_US 100 #define THRESHOLD_MAX_ADC_CODE 0x3ff #define THRESHOLD_MIN_ADC_CODE 0x0 @@ -25,7 +26,8 @@ struct tsens_priv; /* IP version numbers in ascending order */ enum tsens_ver { - VER_0_1 = 0, + VER_0 = 0, + VER_0_1, VER_1_X, VER_2_X, }; From patchwork Tue Apr 20 18:33:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 424847 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,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 4FBF4C43460 for ; Tue, 20 Apr 2021 18:34:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C025613DA for ; Tue, 20 Apr 2021 18:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233640AbhDTSet (ORCPT ); Tue, 20 Apr 2021 14:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233582AbhDTSeo (ORCPT ); Tue, 20 Apr 2021 14:34:44 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AE46C06138B; Tue, 20 Apr 2021 11:34:11 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id w3so59796440ejc.4; Tue, 20 Apr 2021 11:34:11 -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=WTz+6s25EfUH+8tRBZQTC1iH8pQVmI7eJrWzBFatbxM=; b=ig3ww2C/9EEkibf0cn+exIA0ocHp/RAKFTzrfrviPuuuVtb23Q7O5WBxn1R+6kT33a 6R4qz+V1VLueUeL1KMhoRHSxq0CzjuxaSny/YBPssNKo/C8cK19HjBpwsnAPnkwA9CuS 1yOy5tNO9kkzSKL2zFBoebMurv+uxZzzVKejefzwzVmMF1xP0smy4NbTWFzM8lOoeJKW Dwr0GY/eZMN17S1Gh8RSpUHMdoG3KG0Syv0Wkvh67yN2Kq/Ygwtx9ALsmjo8ygjQ3UiZ G6MK0Q3lAlXwjhlLArFaCWhTIMkITvFj+Nxjlb3a/rtRhpihmzCYSfZUYkMawi/1M+ly WuHw== 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=WTz+6s25EfUH+8tRBZQTC1iH8pQVmI7eJrWzBFatbxM=; b=OiMdvfzarRdqsLintjulJ6hX994eM28IBPfS+GAqzlWIRZder7FqCsNECadR67AnIT iHaeE+SWg6oxBPF1jLPSaol1SCAHrKCxXGHZ6G6r8bJBzns31KXBjBxRatTHH5709iRS fJxxGUuyZc5pKKzyZLukMnUwU1rOnydGdbNh1UKUlESMTygoOd+X6XshY4LGShgwcKIG v8zt2DOWuZmH7UuQ4dsY5rtNCRv7nN/dublTd+NATbhyrQnCzTuoJt6m1iuwBDDgAh59 SsIOXsjfcikA4OyMTLoh0UZ9Q665OtIOvPNc+0HNijfOJdyfxa3kLxYxiW1Y9wPQvt0B cJEA== X-Gm-Message-State: AOAM531ggZlwM59BDev57SNzNLNJLDQEOJ27Rtflp7F1ZEm7NHCqBf1W lsjcZCOfXHM18JavicT8608= X-Google-Smtp-Source: ABdhPJz0hRgE+ssy2xnPzc27jg3PV3Vy9c10pdn4QzMpdKFjo1wuX2QWzGZdpTE/qdunIs4etMClhQ== X-Received: by 2002:a17:907:9607:: with SMTP id gb7mr28085390ejc.380.1618943650132; Tue, 20 Apr 2021 11:34:10 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id n10sm13357141ejg.124.2021.04.20.11.34.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 11:34:09 -0700 (PDT) From: Ansuel Smith To: Daniel Lezcano Cc: Ansuel Smith , Thara Gopinath , Amit Kucheria , Andy Gross , Bjorn Andersson , Zhang Rui , Rob Herring , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [thermal PATCH v15 6/9] drivers: thermal: tsens: Replace custom 8960 apis with generic apis Date: Tue, 20 Apr 2021 20:33:40 +0200 Message-Id: <20210420183343.2272-7-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210420183343.2272-1-ansuelsmth@gmail.com> References: <20210420183343.2272-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 a96d37c2b..58112f0df 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 - 350 to compensate mC to C inaccuracy */ +static u32 tsens_msm8960_slope[] = { + 826, 826, 804, 826, + 761, 782, 782, 849, + 782, 849, 782 + }; + 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 const struct reg_field tsens_8960_regfields[MAX_REGFIELDS] = { /* ----- SROT ------ */ /* No VERSION information */ @@ -307,7 +281,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 Tue Apr 20 18:33:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 424846 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,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 6B25BC433ED for ; Tue, 20 Apr 2021 18:34:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3845C613D7 for ; Tue, 20 Apr 2021 18:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233682AbhDTSe6 (ORCPT ); Tue, 20 Apr 2021 14:34:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233629AbhDTSes (ORCPT ); Tue, 20 Apr 2021 14:34:48 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9C89C06174A; Tue, 20 Apr 2021 11:34:14 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id x12so38993501ejc.1; Tue, 20 Apr 2021 11:34:14 -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=eZpY6oHW5Nc4qUZgqqVYnVsBY3HZDhln/426SoLXgZU=; b=us7oHf9xkBwsTctKUnEsSJQnNKxA4FgW3e03Dw0jTCia+lBIeSBZ8aL84481Shyi0a uWEoJCVcS2rWzffBLR7rucAwoZYN/Z2SQUCxZnP/E+JAlQZAji6fu0dcxXgpc9n0eJJA 3yeCqrsWOX1yT1JORnx9Jw36/KNmUDdunWElp0tGRtDKTTl3OvbvaBx+oxyZcTu/u+WH ZfSVFeUQ9lwsyJTjXiMxfwRZ8RJ6GjA8i4ZJ5Bv1o6zljmSHiMesXHmeZ/jXkiBhkLbW SbajFfZr6zLalBSIqrSI9MGxOMC4X2HiRK/jwTNdeRZCajq1JaUeQq/z2+8PDFAyZRvP rRdg== 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=eZpY6oHW5Nc4qUZgqqVYnVsBY3HZDhln/426SoLXgZU=; b=sn6z4eo+2QlqFv1Tv0la+xlRvkQ5zlBtzqdLvzW/sbHq4NX4SNyZKhmGnXWMWcrQL2 KVNSEwD+NQ7ngxRQ09tNQjuII85KScTK4hl5SGa2XG2n2qxCmdtaTDphAVH4v0JSD+RT rWe+y5V2JxmyqK+fCDmWzye7ZA2jUWAnkYTus3e/1oNhzJWAgLbDK+R0zhD6IJmyQsGD XBggvPk9KIbMXup4ItOMmImqD8FWmc1y+l3vUNs8vy5mogNPAWRLAvzn7HT9+m/zpIPZ U5QkgQrCDL5d6S3wy0BtcLBnWUrA4OMgvf2fEaPhpc8ljx3dfWTxLSgd8vdN03uoKvGg UOYA== X-Gm-Message-State: AOAM532qdAMeSH7rOxo2s9sfNvsE3qU/D03ikpb4VusERAjXkzo/eckN M3GcKO4SCoQVfO1p0TH45/4= X-Google-Smtp-Source: ABdhPJwN+kQyM51zG2KVPFbcCG7ojJsD6UdCM8qgkqeQmUSNkidiyhp0MbUAglmIp96UyNVlVVLOVA== X-Received: by 2002:a17:906:5487:: with SMTP id r7mr29114732ejo.550.1618943653447; Tue, 20 Apr 2021 11:34:13 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id n10sm13357141ejg.124.2021.04.20.11.34.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 11:34:13 -0700 (PDT) From: Ansuel Smith To: Daniel Lezcano Cc: Ansuel Smith , Thara Gopinath , Amit Kucheria , Andy Gross , Bjorn Andersson , Zhang Rui , Rob Herring , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [thermal PATCH v15 8/9] drivers: thermal: tsens: Add support for ipq8064-tsens Date: Tue, 20 Apr 2021 20:33:42 +0200 Message-Id: <20210420183343.2272-9-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210420183343.2272-1-ansuelsmth@gmail.com> References: <20210420183343.2272-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Add support for tsens present in ipq806x SoCs based on generic msm8960 tsens driver. Signed-off-by: Ansuel Smith Reviewed-by: Thara Gopinath --- drivers/thermal/qcom/tsens.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index be0c5931f..56b505f35 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -966,6 +966,9 @@ static SIMPLE_DEV_PM_OPS(tsens_pm_ops, tsens_suspend, tsens_resume); static const struct of_device_id tsens_table[] = { { + .compatible = "qcom,ipq8064-tsens", + .data = &data_8960, + }, { .compatible = "qcom,msm8916-tsens", .data = &data_8916, }, {