From: Robert Marko <robimarko@gmail.com>
To: amitk@kernel.org, thara.gopinath@gmail.com, agross@kernel.org,
bjorn.andersson@linaro.org, konrad.dybcio@somainline.org,
rafael@kernel.org, daniel.lezcano@linaro.org,
rui.zhang@intel.com, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, linux-pm@vger.kernel.org,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Robert Marko <robimarko@gmail.com>
Subject: [PATCH v7 4/5] drivers: thermal: tsens: add IPQ8074 support
Date: Fri, 19 Aug 2022 00:02:44 +0200 [thread overview]
Message-ID: <20220818220245.338396-4-robimarko@gmail.com> (raw)
In-Reply-To: <20220818220245.338396-1-robimarko@gmail.com>
Qualcomm IPQ8074 uses tsens v2.3 IP, however unlike other tsens v2 IP
it only has one IRQ, that is used for up/low as well as critical.
It also does not support negative trip temperatures.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
drivers/thermal/qcom/tsens-v2.c | 17 +++++++++++++++++
drivers/thermal/qcom/tsens.c | 3 +++
drivers/thermal/qcom/tsens.h | 2 +-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c
index 9babc69bfd22..29a61d2d6ca3 100644
--- a/drivers/thermal/qcom/tsens-v2.c
+++ b/drivers/thermal/qcom/tsens-v2.c
@@ -39,6 +39,17 @@ static struct tsens_features tsens_v2_feat = {
.trip_max_temp = 120000,
};
+static struct tsens_features ipq8074_feat = {
+ .ver_major = VER_2_X,
+ .crit_int = 1,
+ .combo_int = 1,
+ .adc = 0,
+ .srot_split = 1,
+ .max_sensors = 16,
+ .trip_min_temp = 0,
+ .trip_max_temp = 204000,
+};
+
static const struct reg_field tsens_v2_regfields[MAX_REGFIELDS] = {
/* ----- SROT ------ */
/* VERSION */
@@ -104,6 +115,12 @@ struct tsens_plat_data data_tsens_v2 = {
.fields = tsens_v2_regfields,
};
+struct tsens_plat_data data_ipq8074 = {
+ .ops = &ops_generic_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 6dc8feb5c142..44c802dadaed 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -980,6 +980,9 @@ static const struct of_device_id tsens_table[] = {
{
.compatible = "qcom,ipq8064-tsens",
.data = &data_8960,
+ }, {
+ .compatible = "qcom,ipq8074-tsens",
+ .data = &data_ipq8074,
}, {
.compatible = "qcom,mdm9607-tsens",
.data = &data_9607,
diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h
index 8dc21ca0f2a3..899af128855f 100644
--- a/drivers/thermal/qcom/tsens.h
+++ b/drivers/thermal/qcom/tsens.h
@@ -597,6 +597,6 @@ extern struct tsens_plat_data data_8916, data_8939, data_8974, data_9607;
extern struct tsens_plat_data data_tsens_v1, data_8976;
/* TSENS v2 targets */
-extern struct tsens_plat_data data_8996, data_tsens_v2;
+extern struct tsens_plat_data data_8996, data_ipq8074, data_tsens_v2;
#endif /* __QCOM_TSENS_H__ */
--
2.37.2
next prev parent reply other threads:[~2022-08-18 22:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 22:02 [PATCH v7 1/5] dt-bindings: thermal: tsens: Add ipq8074 compatible Robert Marko
2022-08-18 22:02 ` [PATCH v7 2/5] drivers: thermal: tsens: Add support for combined interrupt Robert Marko
2022-08-18 22:49 ` Daniel Lezcano
2022-09-27 7:34 ` Robert Marko
2022-09-27 8:23 ` Robert Marko
2022-10-17 19:01 ` Bjorn Andersson
2022-10-21 16:52 ` Daniel Lezcano
2022-12-09 15:26 ` [thermal: thermal/next] thermal/drivers/tsens: " thermal-bot for Robert Marko
2022-08-18 22:02 ` [PATCH v7 3/5] drivers: thermal: tsens: allow configuring min and max trips Robert Marko
2022-12-09 15:26 ` [thermal: thermal/next] thermal/drivers/tsens: Allow " thermal-bot for Robert Marko
2022-08-18 22:02 ` Robert Marko [this message]
2022-12-09 15:26 ` [thermal: thermal/next] thermal/drivers/tsens: Add IPQ8074 support thermal-bot for Robert Marko
2022-08-18 22:02 ` [PATCH v7 5/5] arm64: dts: ipq8074: add thermal nodes Robert Marko
2022-10-18 3:14 ` (subset) [PATCH v7 1/5] dt-bindings: thermal: tsens: Add ipq8074 compatible Bjorn Andersson
2022-12-09 15:26 ` [thermal: thermal/next] " thermal-bot for Robert Marko
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=20220818220245.338396-4-robimarko@gmail.com \
--to=robimarko@gmail.com \
--cc=agross@kernel.org \
--cc=amitk@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@somainline.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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.