Message ID | 20230710103735.1375847-7-quic_ipkumar@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp4950264vqx; Mon, 10 Jul 2023 04:23:26 -0700 (PDT) X-Google-Smtp-Source: APBJJlGDH6tfsy6iGKceOaEOJCb508af6EOBRJI7AQY0gQYBeuukSOpxba8dAf0oxcHMQYORtlX2 X-Received: by 2002:a17:902:dac7:b0:1b8:a56b:989d with SMTP id q7-20020a170902dac700b001b8a56b989dmr16332177plx.6.1688988206038; Mon, 10 Jul 2023 04:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688988206; cv=none; d=google.com; s=arc-20160816; b=W1VtHSHGAJRpv0YpM2P1mxs4uvQ+Vhg5q1f08Ktk14IVkorwL4Sc0yqoeTqKUQezCv n9t+I2rvGxXlwPQ36OaGCIfZSbRi7tDx6WIR0a5yXE8icw4HrjgodzIesJjqDVU3lH8x q7wReH5I7ebQGdh1jlgj6/e53qOrdcLvnJSTgzV/+ea3JE5z0jIalaPPXU9KzYLq318Q mTq4+RXHFJUH/aYI+KQBZT5K7iZX6+gxtL0glQ8MMJ3CBBcULqhTxbsREO6+6K7l2AZV AeaD0pJnxvrTcElqjubCntGx6pqTy4FoqVyqBlW6KK4ZXifz1DnS++EIIR1WxnyULqIQ Spxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aYM+VhhL/noCdx5e6LwN0rToSkbZN8EkGwcPCz2bMkE=; fh=X4rJ+cR0B+d5Oa7pFIBp3MHYxg8a+8b0Sx0w3zuICOE=; b=HMJRmVgVRxu44+Z0RtbKfTNLwc+ggcti9Jchwh5Oi8iNb7EQnyEX5F9Ckklr8FEitS lyqXNfNYNOX076+lW4bKITBqRNYP+h9o7DQSX1HUEtB2v8vu2Z/JVZHVt7jTkINdBF3a YqvqpDbpBirat/+CZ/e7uEaegATwLLYppHygSgS7cS3kzsgqLoOWPEPH/S/Dk52Crhuz rZ0wQScKOaN7eddDE7TqlpP77WfIT+8lTYDnHq19M16LwaWw5mBuWiH/mU0pyKAl45UM 5AxGTvIOlA0DrUhLlF6b5jQaSc7KP45MJKKcYIWxO0AN10a+amFAfccQY6H9U62kkwcR e+bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=lYYksZ0T; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a170903230300b001b8b4ed422bsi9321829plh.308.2023.07.10.04.23.13; Mon, 10 Jul 2023 04:23:26 -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=@quicinc.com header.s=qcppdkim1 header.b=lYYksZ0T; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233008AbjGJKlO (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Mon, 10 Jul 2023 06:41:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbjGJKlJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 10 Jul 2023 06:41:09 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DB9BE7; Mon, 10 Jul 2023 03:41:05 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36A8emHC028581; Mon, 10 Jul 2023 10:41:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=aYM+VhhL/noCdx5e6LwN0rToSkbZN8EkGwcPCz2bMkE=; b=lYYksZ0T/gxfYjzGAU5W9nMuIyVkzp9zRtCHscew/7sUde3lTW8f/9ixWf8pl5w5ik4p zqXvbcTRr2aTem+0EIaRZPcu07CN7M31AL9nhjrpwbZovxIO8xG/Mpw6O5qMalVNoONo 7QgzSDBIhFETw95D2vvjlrWzYUiYe3+qATNuBgg3PLwBIXPkcdT4guqJzmUJcP+A5MQi WYJZH1+QmzlugXRG19FEXScVH+7+vzZeGMTV7wlLeusYIWjN6Spw+co4FiGl1dGWr3c/ sb3EzFkLVMratA1MrToB1oqJvUM18nQG4HmPWRK/ap7uA2CggXWhKKwRRp1q84GU+WYg Lw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3rrdpn0fu6-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 10:41:00 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36AAcOM4008941 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 10:38:24 GMT Received: from hu-ipkumar-blr.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Mon, 10 Jul 2023 03:38:19 -0700 From: Praveenkumar I <quic_ipkumar@quicinc.com> To: <agross@kernel.org>, <andersson@kernel.org>, <konrad.dybcio@linaro.org>, <amitk@kernel.org>, <thara.gopinath@gmail.com>, <rafael@kernel.org>, <daniel.lezcano@linaro.org>, <rui.zhang@intel.com>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <conor+dt@kernel.org>, <linux-arm-msm@vger.kernel.org>, <linux-pm@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <quic_varada@quicinc.com> Subject: [PATCH 6/6] thermal/drivers/tsens: Add IPQ5332 support Date: Mon, 10 Jul 2023 16:07:35 +0530 Message-ID: <20230710103735.1375847-7-quic_ipkumar@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710103735.1375847-1-quic_ipkumar@quicinc.com> References: <20230710103735.1375847-1-quic_ipkumar@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: nI6BaXxuRS0Mk8yDz92637YYSHG4XCVN X-Proofpoint-ORIG-GUID: nI6BaXxuRS0Mk8yDz92637YYSHG4XCVN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_08,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 phishscore=0 impostorscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100097 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771032496686765877 X-GMAIL-MSGID: 1771032496686765877 |
Series |
Add IPQ5332 TSENS support
|
|
Commit Message
Praveenkumar I
July 10, 2023, 10:37 a.m. UTC
IPQ5332 uses tsens v2.3.3 IP and it is having combined interrupt as
like IPQ8074. But as the SoCs does not have RPM, kernel needs to
take care of sensor enablement and calibration. Hence introduced
new ops and data for IPQ5332 and reused the feature_config from
IPQ8074.
Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
---
drivers/thermal/qcom/tsens-v2.c | 13 +++++++++++++
drivers/thermal/qcom/tsens.c | 3 +++
drivers/thermal/qcom/tsens.h | 2 +-
3 files changed, 17 insertions(+), 1 deletion(-)
Comments
On 10/07/2023 13:37, Praveenkumar I wrote: > IPQ5332 uses tsens v2.3.3 IP and it is having combined interrupt as > like IPQ8074. But as the SoCs does not have RPM, kernel needs to > take care of sensor enablement and calibration. Hence introduced > new ops and data for IPQ5332 and reused the feature_config from > IPQ8074. > > Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com> > --- > drivers/thermal/qcom/tsens-v2.c | 13 +++++++++++++ > drivers/thermal/qcom/tsens.c | 3 +++ > drivers/thermal/qcom/tsens.h | 2 +- > 3 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c > index db48b1d95348..8b6e3876fd2c 100644 > --- a/drivers/thermal/qcom/tsens-v2.c > +++ b/drivers/thermal/qcom/tsens-v2.c > @@ -237,6 +237,19 @@ struct tsens_plat_data data_ipq8074 = { > .fields = tsens_v2_regfields, > }; > > +static const struct tsens_ops ops_ipq5332_v2 = { Please drop v2. It is unclear if it refers to tsens being v2 or being specific to ipq5332 v2. > + .init = init_common, > + .get_temp = get_temp_tsens_valid, > + .calibrate = tsens_v2_calibration, > +}; > + > +struct tsens_plat_data data_ipq5332 = { > + .sensors_to_en = 0xF800, This doesn't seem to match the offsets that you have enabled in the DTSI. > + .ops = &ops_ipq5332_v2, > + .feat = &ipq8074_feat, > + .fields = tsens_v2_regfields, > +}; > + > /* Kept around for backward compatibility with old msm8996.dtsi */ > struct tsens_plat_data data_8996 = { > .num_sensors = 13, > diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c > index 169690355dad..e8ba2901cda8 100644 > --- a/drivers/thermal/qcom/tsens.c > +++ b/drivers/thermal/qcom/tsens.c > @@ -1140,6 +1140,9 @@ static const struct of_device_id tsens_table[] = { > }, { > .compatible = "qcom,ipq8074-tsens", > .data = &data_ipq8074, > + }, { > + .compatible = "qcom,ipq5332-tsens", > + .data = &data_ipq5332, > }, { > .compatible = "qcom,mdm9607-tsens", > .data = &data_9607, > diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h > index f8897bc8944e..36040f9beebc 100644 > --- a/drivers/thermal/qcom/tsens.h > +++ b/drivers/thermal/qcom/tsens.h > @@ -701,6 +701,6 @@ extern struct tsens_plat_data data_8226, data_8909, data_8916, data_8939, data_8 > extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; > > /* TSENS v2 targets */ > -extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2; > +extern struct tsens_plat_data data_8996, data_ipq8074, data_ipq5332, data_tsens_v2; > > #endif /* __QCOM_TSENS_H__ */
On 7/10/2023 4:54 PM, Dmitry Baryshkov wrote: > On 10/07/2023 13:37, Praveenkumar I wrote: >> IPQ5332 uses tsens v2.3.3 IP and it is having combined interrupt as >> like IPQ8074. But as the SoCs does not have RPM, kernel needs to >> take care of sensor enablement and calibration. Hence introduced >> new ops and data for IPQ5332 and reused the feature_config from >> IPQ8074. >> >> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com> >> --- >> drivers/thermal/qcom/tsens-v2.c | 13 +++++++++++++ >> drivers/thermal/qcom/tsens.c | 3 +++ >> drivers/thermal/qcom/tsens.h | 2 +- >> 3 files changed, 17 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/thermal/qcom/tsens-v2.c >> b/drivers/thermal/qcom/tsens-v2.c >> index db48b1d95348..8b6e3876fd2c 100644 >> --- a/drivers/thermal/qcom/tsens-v2.c >> +++ b/drivers/thermal/qcom/tsens-v2.c >> @@ -237,6 +237,19 @@ struct tsens_plat_data data_ipq8074 = { >> .fields = tsens_v2_regfields, >> }; >> +static const struct tsens_ops ops_ipq5332_v2 = { > > Please drop v2. It is unclear if it refers to tsens being v2 or being > specific to ipq5332 v2. Sure, will drop v2. > >> + .init = init_common, >> + .get_temp = get_temp_tsens_valid, >> + .calibrate = tsens_v2_calibration, >> +}; >> + >> +struct tsens_plat_data data_ipq5332 = { >> + .sensors_to_en = 0xF800, > > This doesn't seem to match the offsets that you have enabled in the DTSI. In order to overcome the DT binding check failure, added all the available QFPROM offsets in the DTSI. Else DT binding check failing on "nvmem-cell-names". > >> + .ops = &ops_ipq5332_v2, >> + .feat = &ipq8074_feat, >> + .fields = tsens_v2_regfields, >> +}; >> + >> /* Kept around for backward compatibility with old msm8996.dtsi */ >> struct tsens_plat_data data_8996 = { >> .num_sensors = 13, >> diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c >> index 169690355dad..e8ba2901cda8 100644 >> --- a/drivers/thermal/qcom/tsens.c >> +++ b/drivers/thermal/qcom/tsens.c >> @@ -1140,6 +1140,9 @@ static const struct of_device_id tsens_table[] = { >> }, { >> .compatible = "qcom,ipq8074-tsens", >> .data = &data_ipq8074, >> + }, { >> + .compatible = "qcom,ipq5332-tsens", >> + .data = &data_ipq5332, >> }, { >> .compatible = "qcom,mdm9607-tsens", >> .data = &data_9607, >> diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h >> index f8897bc8944e..36040f9beebc 100644 >> --- a/drivers/thermal/qcom/tsens.h >> +++ b/drivers/thermal/qcom/tsens.h >> @@ -701,6 +701,6 @@ extern struct tsens_plat_data data_8226, >> data_8909, data_8916, data_8939, data_8 >> extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; >> /* TSENS v2 targets */ >> -extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2; >> +extern struct tsens_plat_data data_8996, data_ipq8074, data_ipq5332, >> data_tsens_v2; >> #endif /* __QCOM_TSENS_H__ */ > -- Thanks, Praveenkumar
On Mon, 10 Jul 2023 at 16:47, Praveenkumar I <quic_ipkumar@quicinc.com> wrote: > > > On 7/10/2023 4:54 PM, Dmitry Baryshkov wrote: > > On 10/07/2023 13:37, Praveenkumar I wrote: > >> IPQ5332 uses tsens v2.3.3 IP and it is having combined interrupt as > >> like IPQ8074. But as the SoCs does not have RPM, kernel needs to > >> take care of sensor enablement and calibration. Hence introduced > >> new ops and data for IPQ5332 and reused the feature_config from > >> IPQ8074. > >> > >> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com> > >> --- > >> drivers/thermal/qcom/tsens-v2.c | 13 +++++++++++++ > >> drivers/thermal/qcom/tsens.c | 3 +++ > >> drivers/thermal/qcom/tsens.h | 2 +- > >> 3 files changed, 17 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/thermal/qcom/tsens-v2.c > >> b/drivers/thermal/qcom/tsens-v2.c > >> index db48b1d95348..8b6e3876fd2c 100644 > >> --- a/drivers/thermal/qcom/tsens-v2.c > >> +++ b/drivers/thermal/qcom/tsens-v2.c > >> @@ -237,6 +237,19 @@ struct tsens_plat_data data_ipq8074 = { > >> .fields = tsens_v2_regfields, > >> }; > >> +static const struct tsens_ops ops_ipq5332_v2 = { > > > > Please drop v2. It is unclear if it refers to tsens being v2 or being > > specific to ipq5332 v2. > Sure, will drop v2. > > > >> + .init = init_common, > >> + .get_temp = get_temp_tsens_valid, > >> + .calibrate = tsens_v2_calibration, > >> +}; > >> + > >> +struct tsens_plat_data data_ipq5332 = { > >> + .sensors_to_en = 0xF800, > > > > This doesn't seem to match the offsets that you have enabled in the DTSI. > In order to overcome the DT binding check failure, added all the > available QFPROM offsets in the DTSI. Else DT binding check failing on > "nvmem-cell-names". This is not a way to overcome issues in DT bindings. Please fix DT bindings instead by using alternatives, enums, etc. > > > >> + .ops = &ops_ipq5332_v2, > >> + .feat = &ipq8074_feat, > >> + .fields = tsens_v2_regfields, > >> +}; > >> + > >> /* Kept around for backward compatibility with old msm8996.dtsi */ > >> struct tsens_plat_data data_8996 = { > >> .num_sensors = 13, > >> diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c > >> index 169690355dad..e8ba2901cda8 100644 > >> --- a/drivers/thermal/qcom/tsens.c > >> +++ b/drivers/thermal/qcom/tsens.c > >> @@ -1140,6 +1140,9 @@ static const struct of_device_id tsens_table[] = { > >> }, { > >> .compatible = "qcom,ipq8074-tsens", > >> .data = &data_ipq8074, > >> + }, { > >> + .compatible = "qcom,ipq5332-tsens", > >> + .data = &data_ipq5332, > >> }, { > >> .compatible = "qcom,mdm9607-tsens", > >> .data = &data_9607, > >> diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h > >> index f8897bc8944e..36040f9beebc 100644 > >> --- a/drivers/thermal/qcom/tsens.h > >> +++ b/drivers/thermal/qcom/tsens.h > >> @@ -701,6 +701,6 @@ extern struct tsens_plat_data data_8226, > >> data_8909, data_8916, data_8939, data_8 > >> extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; > >> /* TSENS v2 targets */ > >> -extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2; > >> +extern struct tsens_plat_data data_8996, data_ipq8074, data_ipq5332, > >> data_tsens_v2; > >> #endif /* __QCOM_TSENS_H__ */ > > > -- > Thanks, > Praveenkumar
On 7/10/2023 8:33 PM, Dmitry Baryshkov wrote: > On Mon, 10 Jul 2023 at 16:47, Praveenkumar I <quic_ipkumar@quicinc.com> wrote: >> >> On 7/10/2023 4:54 PM, Dmitry Baryshkov wrote: >>> On 10/07/2023 13:37, Praveenkumar I wrote: >>>> IPQ5332 uses tsens v2.3.3 IP and it is having combined interrupt as >>>> like IPQ8074. But as the SoCs does not have RPM, kernel needs to >>>> take care of sensor enablement and calibration. Hence introduced >>>> new ops and data for IPQ5332 and reused the feature_config from >>>> IPQ8074. >>>> >>>> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com> >>>> --- >>>> drivers/thermal/qcom/tsens-v2.c | 13 +++++++++++++ >>>> drivers/thermal/qcom/tsens.c | 3 +++ >>>> drivers/thermal/qcom/tsens.h | 2 +- >>>> 3 files changed, 17 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/thermal/qcom/tsens-v2.c >>>> b/drivers/thermal/qcom/tsens-v2.c >>>> index db48b1d95348..8b6e3876fd2c 100644 >>>> --- a/drivers/thermal/qcom/tsens-v2.c >>>> +++ b/drivers/thermal/qcom/tsens-v2.c >>>> @@ -237,6 +237,19 @@ struct tsens_plat_data data_ipq8074 = { >>>> .fields = tsens_v2_regfields, >>>> }; >>>> +static const struct tsens_ops ops_ipq5332_v2 = { >>> Please drop v2. It is unclear if it refers to tsens being v2 or being >>> specific to ipq5332 v2. >> Sure, will drop v2. >>>> + .init = init_common, >>>> + .get_temp = get_temp_tsens_valid, >>>> + .calibrate = tsens_v2_calibration, >>>> +}; >>>> + >>>> +struct tsens_plat_data data_ipq5332 = { >>>> + .sensors_to_en = 0xF800, >>> This doesn't seem to match the offsets that you have enabled in the DTSI. >> In order to overcome the DT binding check failure, added all the >> available QFPROM offsets in the DTSI. Else DT binding check failing on >> "nvmem-cell-names". > This is not a way to overcome issues in DT bindings. Please fix DT > bindings instead by using alternatives, enums, etc. Sure, will fix the DT bindings. > >>>> + .ops = &ops_ipq5332_v2, >>>> + .feat = &ipq8074_feat, >>>> + .fields = tsens_v2_regfields, >>>> +}; >>>> + >>>> /* Kept around for backward compatibility with old msm8996.dtsi */ >>>> struct tsens_plat_data data_8996 = { >>>> .num_sensors = 13, >>>> diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c >>>> index 169690355dad..e8ba2901cda8 100644 >>>> --- a/drivers/thermal/qcom/tsens.c >>>> +++ b/drivers/thermal/qcom/tsens.c >>>> @@ -1140,6 +1140,9 @@ static const struct of_device_id tsens_table[] = { >>>> }, { >>>> .compatible = "qcom,ipq8074-tsens", >>>> .data = &data_ipq8074, >>>> + }, { >>>> + .compatible = "qcom,ipq5332-tsens", >>>> + .data = &data_ipq5332, >>>> }, { >>>> .compatible = "qcom,mdm9607-tsens", >>>> .data = &data_9607, >>>> diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h >>>> index f8897bc8944e..36040f9beebc 100644 >>>> --- a/drivers/thermal/qcom/tsens.h >>>> +++ b/drivers/thermal/qcom/tsens.h >>>> @@ -701,6 +701,6 @@ extern struct tsens_plat_data data_8226, >>>> data_8909, data_8916, data_8939, data_8 >>>> extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; >>>> /* TSENS v2 targets */ >>>> -extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2; >>>> +extern struct tsens_plat_data data_8996, data_ipq8074, data_ipq5332, >>>> data_tsens_v2; >>>> #endif /* __QCOM_TSENS_H__ */ >> -- >> Thanks, >> Praveenkumar > >
diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c index db48b1d95348..8b6e3876fd2c 100644 --- a/drivers/thermal/qcom/tsens-v2.c +++ b/drivers/thermal/qcom/tsens-v2.c @@ -237,6 +237,19 @@ struct tsens_plat_data data_ipq8074 = { .fields = tsens_v2_regfields, }; +static const struct tsens_ops ops_ipq5332_v2 = { + .init = init_common, + .get_temp = get_temp_tsens_valid, + .calibrate = tsens_v2_calibration, +}; + +struct tsens_plat_data data_ipq5332 = { + .sensors_to_en = 0xF800, + .ops = &ops_ipq5332_v2, + .feat = &ipq8074_feat, + .fields = tsens_v2_regfields, +}; + /* Kept around for backward compatibility with old msm8996.dtsi */ struct tsens_plat_data data_8996 = { .num_sensors = 13, diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 169690355dad..e8ba2901cda8 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -1140,6 +1140,9 @@ static const struct of_device_id tsens_table[] = { }, { .compatible = "qcom,ipq8074-tsens", .data = &data_ipq8074, + }, { + .compatible = "qcom,ipq5332-tsens", + .data = &data_ipq5332, }, { .compatible = "qcom,mdm9607-tsens", .data = &data_9607, diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index f8897bc8944e..36040f9beebc 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -701,6 +701,6 @@ extern struct tsens_plat_data data_8226, data_8909, data_8916, data_8939, data_8 extern struct tsens_plat_data data_tsens_v1, data_8976, data_8956; /* TSENS v2 targets */ -extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2; +extern struct tsens_plat_data data_8996, data_ipq8074, data_ipq5332, data_tsens_v2; #endif /* __QCOM_TSENS_H__ */