mbox series

[0/3] Extend LMh driver to suppot Qualcomm sm8150 SoC.

Message ID 20211202223802.382068-1-thara.gopinath@linaro.org
Headers show
Series Extend LMh driver to suppot Qualcomm sm8150 SoC. | expand

Message

Thara Gopinath Dec. 2, 2021, 10:37 p.m. UTC
Add support for sm8150 in the Qualcomm Limits Management Hardware(LMh)
driver. Also add required device tree entries and dt-binding.

Thara Gopinath (3):
  thermal: qcom: lmh: Add support for sm8150
  arm64: dts: qcom: sm8150: Add support for LMh node
  dt-bindings: thermal: Add sm8150 compatible string for LMh

 .../devicetree/bindings/thermal/qcom-lmh.yaml |  1 +
 arch/arm64/boot/dts/qcom/sm8150.dtsi          | 24 ++++++++
 drivers/thermal/qcom/lmh.c                    | 61 ++++++++++---------
 3 files changed, 57 insertions(+), 29 deletions(-)

Comments

Konrad Dybcio Dec. 4, 2021, 1:34 p.m. UTC | #1
Hi,

On 02.12.2021 23:38, Thara Gopinath wrote:
> Add compatible to support LMh for sm8150 SoC.
> sm8150 does not require explicit enabling for various LMh subsystems.
> Move this piece of code under condition that it is executed only
> for sdm845 SoC.
>
> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
> ---
>  drivers/thermal/qcom/lmh.c | 61 ++++++++++++++++++++------------------
>  1 file changed, 32 insertions(+), 29 deletions(-)

[...]


> -		return ret;
> +	if (of_device_is_compatible(np, "qcom,sdm845-lmh")) {
> +		if (!qcom_scm_lmh_dcvsh_available())
> +			return -EINVAL;

I don't believe this is the correct approach, as different SoCs may

require different sequences of these writes (for example SDM660/MSM8998

seems to only enable the thermal algorithm), and there will (hopefully) be interest

in adding LMH support for more platforms, so perhaps separating this somehow

could keep this a bit cleaner and easier to work with for the next person..



Konrad
Thara Gopinath Dec. 6, 2021, 2:22 p.m. UTC | #2
Hi Konrad,

Thanks for the review.

On 12/4/21 8:34 AM, Konrad Dybcio wrote:
> Hi,
> 
> On 02.12.2021 23:38, Thara Gopinath wrote:
>> Add compatible to support LMh for sm8150 SoC.
>> sm8150 does not require explicit enabling for various LMh subsystems.
>> Move this piece of code under condition that it is executed only
>> for sdm845 SoC.
>>
>> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
>> ---
>>   drivers/thermal/qcom/lmh.c | 61 ++++++++++++++++++++------------------
>>   1 file changed, 32 insertions(+), 29 deletions(-)
> 
> [...]
> 
> 
>> -		return ret;
>> +	if (of_device_is_compatible(np, "qcom,sdm845-lmh")) {
>> +		if (!qcom_scm_lmh_dcvsh_available())
>> +			return -EINVAL;
> 
> I don't believe this is the correct approach, as different SoCs may
> 
> require different sequences of these writes (for example SDM660/MSM8998
> 
> seems to only enable the thermal algorithm), and there will (hopefully) be interest
> 
> in adding LMH support for more platforms, so perhaps separating this somehow
> 
> could keep this a bit cleaner and easier to work with for the next person..

I have not looked at SDM660/MSM8998. Are you telling me that these SoCs 
don't enable the current and BCL portion of LMh. Maybe they have an 
earlier version of Lmh which does not support all the features. The 
right approach in this case will be to add a match table with flags for 
init based on SoC. I can send v2, adding a match table with a flag to 
specify whether to do the init sequence or not. Since I am not adding 
the support for any other SoC at the moment, I cannot put in flags 
separating out thermal , current and BCL init.

> 
> 
> 
> Konrad
>