mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Praveenkumar I <quic_ipkumar@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <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>, <quic_varada@quicinc.com>
Subject: Re: [PATCH 6/6] thermal/drivers/tsens: Add IPQ5332 support
Date: Tue, 11 Jul 2023 14:50:26 +0530	[thread overview]
Message-ID: <216ced8f-66eb-3953-3011-a86deffd6255@quicinc.com> (raw)
In-Reply-To: <CAA8EJpoTy5sxFpK8=KqmR5zjj_Kt18hX_CJqvQbxHDmBqmduGw@mail.gmail.com>


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
>
>

      reply	other threads:[~2023-07-11  9:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10 10:37 [PATCH 0/6] Add IPQ5332 TSENS support Praveenkumar I
2023-07-10 10:37 ` [PATCH 1/6] dt-bindings: thermal: tsens: Add nvmem cells for calibration data Praveenkumar I
2023-07-10 20:10   ` Krzysztof Kozlowski
2023-07-11  9:39     ` Praveenkumar I
2023-07-11  9:52       ` Krzysztof Kozlowski
2023-07-11 14:13         ` Praveenkumar I
2023-07-13 11:38           ` Krzysztof Kozlowski
2023-07-10 10:37 ` [PATCH 2/6] thermal/drivers/tsens: Add TSENS enable and calibration support for V2 Praveenkumar I
2023-07-10 11:19   ` Dmitry Baryshkov
2023-07-10 11:22     ` Dmitry Baryshkov
2023-07-10 13:24       ` Praveenkumar I
2023-07-10 13:22     ` Praveenkumar I
2023-07-10 15:02       ` Dmitry Baryshkov
2023-07-11  9:19         ` Praveenkumar I
2023-07-10 10:37 ` [PATCH 3/6] dt-bindings: thermal: tsens: Add ipq5332 compatible Praveenkumar I
2023-07-10 20:06   ` Krzysztof Kozlowski
2023-07-11  9:24     ` Praveenkumar I
2023-07-10 10:37 ` [PATCH 4/6] arm64: dts: qcom: ipq5332: Add tsens node Praveenkumar I
2023-07-10 11:21   ` Dmitry Baryshkov
2023-07-10 13:25     ` Praveenkumar I
2023-07-10 20:07   ` Krzysztof Kozlowski
2023-07-11  9:27     ` Praveenkumar I
2023-07-10 10:37 ` [PATCH 5/6] arm64: dts: qcom: ipq5332: Add thermal zone nodes Praveenkumar I
2023-07-10 11:23   ` Dmitry Baryshkov
2023-07-10 12:14     ` Konrad Dybcio
2023-07-10 13:34       ` Praveenkumar I
2023-07-10 13:54         ` Praveenkumar I
2023-07-10 13:30     ` Praveenkumar I
2023-07-10 10:37 ` [PATCH 6/6] thermal/drivers/tsens: Add IPQ5332 support Praveenkumar I
2023-07-10 11:24   ` Dmitry Baryshkov
2023-07-10 13:47     ` Praveenkumar I
2023-07-10 15:03       ` Dmitry Baryshkov
2023-07-11  9:20         ` 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=216ced8f-66eb-3953-3011-a86deffd6255@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=dmitry.baryshkov@linaro.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

all inboxes | Powered by JetHome®