public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sricharan R <srichara@win-platform-upstream01.qualcomm.com>
To: krzysztof.kozlowski@linaro.org, agross@kernel.org,
	andersson@kernel.org, konrad.dybcio@linaro.org,
	srinivas.kandagatla@linaro.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	thara.gopinath@gmail.com, rafael@kernel.org,
	daniel.lezcano@linaro.org, linux-arm-msm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, dmitry.baryshkov@linaro.org,
	quic_srichara@quicinc.com
Subject: [PATCH V3 2/4] thermal/drivers/qcom: Add new feat for soc without rpm
Date: Fri, 22 Sep 2023 17:21:14 +0530	[thread overview]
Message-ID: <20230922115116.2748804-3-srichara@win-platform-upstream01.qualcomm.com> (raw)
In-Reply-To: <20230922115116.2748804-1-srichara@win-platform-upstream01.qualcomm.com>

From: Sricharan Ramabadhran <quic_srichara@quicinc.com>

In IPQ5018, Tsens IP doesn't have RPM. Hence the early init to
enable tsens would not be done. So add a flag for that in feat
and skip enable checks. Without this, tsens probe fails.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sricharan Ramabadhran <quic_srichara@quicinc.com>
---
 [v3] Added Dmitry's Reviewed tag

 drivers/thermal/qcom/tsens.c | 2 +-
 drivers/thermal/qcom/tsens.h | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 98c356acfe98..0a43ccf02ec4 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -974,7 +974,7 @@ int __init init_common(struct tsens_priv *priv)
 	ret = regmap_field_read(priv->rf[TSENS_EN], &enabled);
 	if (ret)
 		goto err_put_device;
-	if (!enabled) {
+	if (!enabled && !(priv->feat->ignore_enable)) {
 		dev_err(dev, "%s: device not enabled\n", __func__);
 		ret = -ENODEV;
 		goto err_put_device;
diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h
index 2805de1c6827..e254cd2df904 100644
--- a/drivers/thermal/qcom/tsens.h
+++ b/drivers/thermal/qcom/tsens.h
@@ -505,6 +505,8 @@ enum regfield_ids {
  * @srot_split: does the IP neatly splits the register space into SROT and TM,
  *              with SROT only being available to secure boot firmware?
  * @has_watchdog: does this IP support watchdog functionality?
+ * @ignore_enable: does this IP reside in a soc that does not have rpm to
+ *                 do pre-init.
  * @max_sensors: maximum sensors supported by this version of the IP
  * @trip_min_temp: minimum trip temperature supported by this version of the IP
  * @trip_max_temp: maximum trip temperature supported by this version of the IP
@@ -516,6 +518,7 @@ struct tsens_features {
 	unsigned int adc:1;
 	unsigned int srot_split:1;
 	unsigned int has_watchdog:1;
+	unsigned int ignore_enable:1;
 	unsigned int max_sensors;
 	int trip_min_temp;
 	int trip_max_temp;
-- 
2.34.1


  parent reply	other threads:[~2023-09-22 11:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 11:51 [PATCH V3 0/4] Add support for IPQ5018 tsens Sricharan R
2023-09-22 11:51 ` [PATCH V3 1/4] dt-bindings: thermal: qcom-tsens: Add ipq5018 compatible Sricharan R
2023-09-22 20:50   ` Rob Herring
2023-09-23 11:44   ` Krzysztof Kozlowski
2023-09-25  2:06     ` Sricharan Ramabadhran
2023-09-25  6:46       ` Krzysztof Kozlowski
2023-09-25 10:31         ` Sricharan Ramabadhran
2023-09-25 10:40           ` Krzysztof Kozlowski
2023-09-22 11:51 ` Sricharan R [this message]
2023-09-22 11:51 ` [PATCH V3 3/4] thermal/drivers/tsens: Add support for IPQ5018 tsens Sricharan R
2023-09-23 18:46   ` Dmitry Baryshkov
2023-10-04 19:07   ` Robert Marko
2023-10-17 13:08     ` Sricharan Ramabadhran
2023-09-22 11:51 ` [PATCH V3 4/4] arm64: dts: qcom: ipq5018: Add tsens node Sricharan R
2023-09-23 18:48   ` Dmitry Baryshkov
2023-09-25  2:09     ` Sricharan Ramabadhran
2023-10-04 19:08   ` Robert Marko
2023-10-17 13:07     ` Sricharan Ramabadhran
2023-10-17 13:13       ` Robert Marko
2023-11-03  8:11         ` Sricharan Ramabadhran

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=20230922115116.2748804-3-srichara@win-platform-upstream01.qualcomm.com \
    --to=srichara@win-platform-upstream01.qualcomm.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=quic_srichara@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --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