Linux Power Management development
 help / color / mirror / Atom feed
From: Praveenkumar I <quic_ipkumar@quicinc.com>
To: Konrad Dybcio <konrad.dybcio@linaro.org>, <amitk@kernel.org>,
	<thara.gopinath@gmail.com>, <agross@kernel.org>,
	<andersson@kernel.org>, <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-pm@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <quic_varada@quicinc.com>
Subject: Re: [PATCH v3 5/5] thermal/drivers/tsens: Add IPQ5332 support
Date: Mon, 17 Jul 2023 10:18:06 +0530	[thread overview]
Message-ID: <faf315ee-bc5a-bd02-9d3c-0312989a24b3@quicinc.com> (raw)
In-Reply-To: <adc04328-d9c5-1c67-8396-08137334af1e@linaro.org>


On 7/15/2023 7:36 PM, Konrad Dybcio wrote:
> On 13.07.2023 07:27, Praveenkumar I wrote:
>> IPQ5332 uses tsens v2.3.3 IP and it is having combined interrupt.
>> It does not have RPM and kernel needs to take care of sensor
>> enablement, calibration. Hence introduced new feature_config,
>> ops and data for IPQ5332.
>>
>> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
>> ---
>> [v3]:
>> 	No changes.
>> [v2]:
>> 	Added tsens_features for ipq5332 with VER_2_X_NO_RPM. Used
>> 	hw_ids to mention the available sensors. Dropped v2 in
>> 	ops_ipq5332.
>>
>>   drivers/thermal/qcom/tsens-v2.c | 25 +++++++++++++++++++++++++
>>   drivers/thermal/qcom/tsens.c    |  3 +++
>>   drivers/thermal/qcom/tsens.h    |  2 +-
>>   3 files changed, 29 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c
>> index 781595a9a622..e25d9d34e519 100644
>> --- a/drivers/thermal/qcom/tsens-v2.c
>> +++ b/drivers/thermal/qcom/tsens-v2.c
>> @@ -62,6 +62,17 @@ static struct tsens_features ipq8074_feat = {
>>   	.trip_max_temp	= 204000,
>>   };
>>   
>> +static struct tsens_features ipq5332_feat = {
>> +	.ver_major	= VER_2_X_NO_RPM,
>> +	.crit_int	= 1,
>> +	.combo_int	= 1,
>> +	.adc		= 0,
>> +	.srot_split	= 1,
>> +	.max_sensors	= 16,
>> +	.trip_min_temp	= 0,
>> +	.trip_max_temp	= 204000,
> 204 degrees Celcius?
Yes, it is 204 degrees celcius as like ipq8074.
> Konrad
>> +};
>> +
>>   static const struct reg_field tsens_v2_regfields[MAX_REGFIELDS] = {
>>   	/* ----- SROT ------ */
>>   	/* VERSION */
>> @@ -262,6 +273,20 @@ struct tsens_plat_data data_ipq8074 = {
>>   	.fields	= tsens_v2_regfields,
>>   };
>>   
>> +static const struct tsens_ops ops_ipq5332 = {
>> +	.init		= init_tsens_v2_no_rpm,
>> +	.get_temp	= get_temp_tsens_valid,
>> +	.calibrate	= tsens_v2_calibration,
>> +};
>> +
>> +struct tsens_plat_data data_ipq5332 = {
>> +	.num_sensors	= 5,
>> +	.ops		= &ops_ipq5332,
>> +	.hw_ids		= (unsigned int []){11, 12, 13, 14, 15},
>> +	.feat		= &ipq5332_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 9dc0c2150948..af58a94628a8 100644
>> --- a/drivers/thermal/qcom/tsens.c
>> +++ b/drivers/thermal/qcom/tsens.c
>> @@ -1106,6 +1106,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 b2e8f0f2b466..1dde363914cd 100644
>> --- a/drivers/thermal/qcom/tsens.h
>> +++ b/drivers/thermal/qcom/tsens.h
>> @@ -648,6 +648,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__ */

      reply	other threads:[~2023-07-17  4:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13  5:27 [PATCH v3 0/5] Add IPQ5332 TSENS support Praveenkumar I
2023-07-13  5:27 ` [PATCH v3 1/5] thermal/drivers/tsens: Add TSENS enable and calibration support for V2 Praveenkumar I
2023-07-15 14:05   ` Konrad Dybcio
2023-07-17  5:17     ` Praveenkumar I
2023-07-13  5:27 ` [PATCH v3 2/5] dt-bindings: thermal: tsens: Add ipq5332 compatible Praveenkumar I
2023-07-13  6:32   ` Krzysztof Kozlowski
2023-07-13  5:27 ` [PATCH v3 3/5] arm64: dts: qcom: ipq5332: Add tsens node Praveenkumar I
2023-07-13  5:27 ` [PATCH v3 4/5] arm64: dts: qcom: ipq5332: Add thermal zone nodes Praveenkumar I
2023-07-13  5:27 ` [PATCH v3 5/5] thermal/drivers/tsens: Add IPQ5332 support Praveenkumar I
2023-07-15 14:06   ` Konrad Dybcio
2023-07-17  4:48     ` Praveenkumar I [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=faf315ee-bc5a-bd02-9d3c-0312989a24b3@quicinc.com \
    --to=quic_ipkumar@quicinc.com \
    --cc=agross@kernel.org \
    --cc=amitk@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=quic_varada@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=thara.gopinath@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox