Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	linux-arm-msm@vger.kernel.org,
	Johan Hovold <johan+linaro@kernel.org>,
	devicetree@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH 1/6] dt-bindings: iio: qcom,spmi-adc7-pmk8350.h: include sid into defines
Date: Sat, 1 Apr 2023 17:59:14 +0300	[thread overview]
Message-ID: <eb044bbc-2a6d-1e2d-95cb-da0261451dfa@linaro.org> (raw)
In-Reply-To: <20230401154812.62152900@jic23-huawei>

On 01/04/2023 17:48, Jonathan Cameron wrote:
> On Wed, 29 Mar 2023 03:08:28 +0300
> Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote:
> 
>> pmk8350 can take different addresses on SPMI bus. Rather than having a
>> default SID, follow the pm8350's example and make the sid explicit when
>> specifying ADC channels.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> 
> Hi Dmitry,
> 
> How do you want this applied? I can take it through IIO if you like but
> I'm not sure if that will cause trouble for other dts patches in flight.
> 
> I'm fine with it going via another tree though and don't expect
> to see any clashes. If so.

I think it would be better to get this through qcom -> arm-soc tree 
together with the rest of the patchset. Thank you for your permission.

> 
> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
>> ---
>>   .../bindings/iio/adc/qcom,spmi-vadc.yaml      |  2 +-
>>   .../bindings/thermal/qcom-spmi-adc-tm5.yaml   |  4 +-
>>   arch/arm64/boot/dts/qcom/sc7280-idp.dtsi      |  2 +-
>>   arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi    |  2 +-
>>   .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts    |  4 +-
>>   .../boot/dts/qcom/sm7225-fairphone-fp4.dts    |  2 +-
>>   .../dt-bindings/iio/qcom,spmi-adc7-pmk8350.h  | 52 +++++++++----------
>>   7 files changed, 32 insertions(+), 36 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml
>> index bd6e0d6f6e0c..df317901e7d0 100644
>> --- a/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml
>> +++ b/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc.yaml
>> @@ -293,7 +293,7 @@ examples:
>>   
>>               /* Other properties are omitted */
>>               xo-therm@44 {
>> -                reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
>> +                reg = <PMK8350_ADC7_AMUX_THM1_100K_PU(0)>;
>>                   qcom,ratiometric;
>>                   qcom,hw-settle-time = <200>;
>>               };
>> diff --git a/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml b/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml
>> index 52ec18cf1eda..ff07d27775dc 100644
>> --- a/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml
>> +++ b/Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml
>> @@ -218,7 +218,7 @@ examples:
>>   
>>               /* Other properties are omitted */
>>               xo-therm@44 {
>> -                reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
>> +                reg = <PMK8350_ADC7_AMUX_THM1_100K_PU(0)>;
>>                   qcom,ratiometric;
>>                   qcom,hw-settle-time = <200>;
>>               };
>> @@ -240,7 +240,7 @@ examples:
>>   
>>               pmk8350-xo-therm@0 {
>>                   reg = <0>;
>> -                io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>;
>> +                io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU(0)>;
>>                   qcom,decimation = <340>;
>>                   qcom,ratiometric;
>>                   qcom,hw-settle-time-us = <200>;
>> diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
>> index 5dc9bee28e7f..14c9bdaa46ed 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi
>> @@ -433,7 +433,7 @@ &pcie1_phy {
>>   
>>   &pmk8350_vadc {
>>   	pmk8350-die-temp@3 {
>> -		reg = <PMK8350_ADC7_DIE_TEMP>;
>> +		reg = <PMK8350_ADC7_DIE_TEMP(0)>;
>>   		label = "pmk8350_die_temp";
>>   		qcom,pre-scaling = <1 1>;
>>   	};
>> diff --git a/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi b/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi
>> index cb0cc2ba2fa3..e3919e074ebd 100644
>> --- a/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sc7280-qcard.dtsi
>> @@ -389,7 +389,7 @@ &pm8350c_pwm {
>>   
>>   &pmk8350_vadc {
>>   	pmk8350-die-temp@3 {
>> -		reg = <PMK8350_ADC7_DIE_TEMP>;
>> +		reg = <PMK8350_ADC7_DIE_TEMP(0)>;
>>   		label = "pmk8350_die_temp";
>>   		qcom,pre-scaling = <1 1>;
>>   	};
>> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> index 46c7fdafb840..590400985055 100644
>> --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> @@ -824,13 +824,13 @@ &pmk8280_vadc {
>>   	status = "okay";
>>   
>>   	pmic-die-temp@3 {
>> -		reg = <PMK8350_ADC7_DIE_TEMP>;
>> +		reg = <PMK8350_ADC7_DIE_TEMP(0)>;
>>   		qcom,pre-scaling = <1 1>;
>>   		label = "pmk8350_die_temp";
>>   	};
>>   
>>   	xo-therm@44 {
>> -		reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
>> +		reg = <PMK8350_ADC7_AMUX_THM1_100K_PU(0)>;
>>   		qcom,hw-settle-time = <200>;
>>   		qcom,ratiometric;
>>   		label = "pmk8350_xo_therm";
>> diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
>> index 7ae6aba5d2ec..af6cf4fbddc7 100644
>> --- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
>> +++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
>> @@ -516,7 +516,7 @@ &pmk8350_rtc {
>>   
>>   &pmk8350_vadc {
>>   	adc-chan@644 {
>> -		reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
>> +		reg = <PMK8350_ADC7_AMUX_THM1_100K_PU(0)>;
>>   		qcom,ratiometric;
>>   		qcom,hw-settle-time = <200>;
>>   		qcom,pre-scaling = <1 1>;
>> diff --git a/include/dt-bindings/iio/qcom,spmi-adc7-pmk8350.h b/include/dt-bindings/iio/qcom,spmi-adc7-pmk8350.h
>> index 6c296870e95b..ca85a2d69453 100644
>> --- a/include/dt-bindings/iio/qcom,spmi-adc7-pmk8350.h
>> +++ b/include/dt-bindings/iio/qcom,spmi-adc7-pmk8350.h
>> @@ -6,41 +6,37 @@
>>   #ifndef _DT_BINDINGS_QCOM_SPMI_VADC_PMK8350_H
>>   #define _DT_BINDINGS_QCOM_SPMI_VADC_PMK8350_H
>>   
>> -#ifndef PMK8350_SID
>> -#define PMK8350_SID					0
>> -#endif
>> -
>>   /* ADC channels for PMK8350_ADC for PMIC7 */
>> -#define PMK8350_ADC7_REF_GND			(PMK8350_SID << 8 | 0x0)
>> -#define PMK8350_ADC7_1P25VREF			(PMK8350_SID << 8 | 0x01)
>> -#define PMK8350_ADC7_VREF_VADC			(PMK8350_SID << 8 | 0x02)
>> -#define PMK8350_ADC7_DIE_TEMP			(PMK8350_SID << 8 | 0x03)
>> +#define PMK8350_ADC7_REF_GND(sid)			((sid) << 8 | 0x0)
>> +#define PMK8350_ADC7_1P25VREF(sid)			((sid) << 8 | 0x01)
>> +#define PMK8350_ADC7_VREF_VADC(sid)			((sid) << 8 | 0x02)
>> +#define PMK8350_ADC7_DIE_TEMP(sid)			((sid) << 8 | 0x03)
>>   
>> -#define PMK8350_ADC7_AMUX_THM1			(PMK8350_SID << 8 | 0x04)
>> -#define PMK8350_ADC7_AMUX_THM2			(PMK8350_SID << 8 | 0x05)
>> -#define PMK8350_ADC7_AMUX_THM3			(PMK8350_SID << 8 | 0x06)
>> -#define PMK8350_ADC7_AMUX_THM4			(PMK8350_SID << 8 | 0x07)
>> -#define PMK8350_ADC7_AMUX_THM5			(PMK8350_SID << 8 | 0x08)
>> +#define PMK8350_ADC7_AMUX_THM1(sid)			((sid) << 8 | 0x04)
>> +#define PMK8350_ADC7_AMUX_THM2(sid)			((sid) << 8 | 0x05)
>> +#define PMK8350_ADC7_AMUX_THM3(sid)			((sid) << 8 | 0x06)
>> +#define PMK8350_ADC7_AMUX_THM4(sid)			((sid) << 8 | 0x07)
>> +#define PMK8350_ADC7_AMUX_THM5(sid)			((sid) << 8 | 0x08)
>>   
>>   /* 30k pull-up1 */
>> -#define PMK8350_ADC7_AMUX_THM1_30K_PU		(PMK8350_SID << 8 | 0x24)
>> -#define PMK8350_ADC7_AMUX_THM2_30K_PU		(PMK8350_SID << 8 | 0x25)
>> -#define PMK8350_ADC7_AMUX_THM3_30K_PU		(PMK8350_SID << 8 | 0x26)
>> -#define PMK8350_ADC7_AMUX_THM4_30K_PU		(PMK8350_SID << 8 | 0x27)
>> -#define PMK8350_ADC7_AMUX_THM5_30K_PU		(PMK8350_SID << 8 | 0x28)
>> +#define PMK8350_ADC7_AMUX_THM1_30K_PU(sid)		((sid) << 8 | 0x24)
>> +#define PMK8350_ADC7_AMUX_THM2_30K_PU(sid)		((sid) << 8 | 0x25)
>> +#define PMK8350_ADC7_AMUX_THM3_30K_PU(sid)		((sid) << 8 | 0x26)
>> +#define PMK8350_ADC7_AMUX_THM4_30K_PU(sid)		((sid) << 8 | 0x27)
>> +#define PMK8350_ADC7_AMUX_THM5_30K_PU(sid)		((sid) << 8 | 0x28)
>>   
>>   /* 100k pull-up2 */
>> -#define PMK8350_ADC7_AMUX_THM1_100K_PU		(PMK8350_SID << 8 | 0x44)
>> -#define PMK8350_ADC7_AMUX_THM2_100K_PU		(PMK8350_SID << 8 | 0x45)
>> -#define PMK8350_ADC7_AMUX_THM3_100K_PU		(PMK8350_SID << 8 | 0x46)
>> -#define PMK8350_ADC7_AMUX_THM4_100K_PU		(PMK8350_SID << 8 | 0x47)
>> -#define PMK8350_ADC7_AMUX_THM5_100K_PU		(PMK8350_SID << 8 | 0x48)
>> +#define PMK8350_ADC7_AMUX_THM1_100K_PU(sid)		((sid) << 8 | 0x44)
>> +#define PMK8350_ADC7_AMUX_THM2_100K_PU(sid)		((sid) << 8 | 0x45)
>> +#define PMK8350_ADC7_AMUX_THM3_100K_PU(sid)		((sid) << 8 | 0x46)
>> +#define PMK8350_ADC7_AMUX_THM4_100K_PU(sid)		((sid) << 8 | 0x47)
>> +#define PMK8350_ADC7_AMUX_THM5_100K_PU(sid)		((sid) << 8 | 0x48)
>>   
>>   /* 400k pull-up3 */
>> -#define PMK8350_ADC7_AMUX_THM1_400K_PU		(PMK8350_SID << 8 | 0x64)
>> -#define PMK8350_ADC7_AMUX_THM2_400K_PU		(PMK8350_SID << 8 | 0x65)
>> -#define PMK8350_ADC7_AMUX_THM3_400K_PU		(PMK8350_SID << 8 | 0x66)
>> -#define PMK8350_ADC7_AMUX_THM4_400K_PU		(PMK8350_SID << 8 | 0x67)
>> -#define PMK8350_ADC7_AMUX_THM5_400K_PU		(PMK8350_SID << 8 | 0x68)
>> +#define PMK8350_ADC7_AMUX_THM1_400K_PU(sid)		((sid) << 8 | 0x64)
>> +#define PMK8350_ADC7_AMUX_THM2_400K_PU(sid)		((sid) << 8 | 0x65)
>> +#define PMK8350_ADC7_AMUX_THM3_400K_PU(sid)		((sid) << 8 | 0x66)
>> +#define PMK8350_ADC7_AMUX_THM4_400K_PU(sid)		((sid) << 8 | 0x67)
>> +#define PMK8350_ADC7_AMUX_THM5_400K_PU(sid)		((sid) << 8 | 0x68)
>>   
>>   #endif /* _DT_BINDINGS_QCOM_SPMI_VADC_PMK8350_H */
> 

-- 
With best wishes
Dmitry


  reply	other threads:[~2023-04-01 14:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29  0:08 [PATCH 0/6] arm64: dts: qcom: sc8280xp: remove duplication in PMIC declarations Dmitry Baryshkov
2023-03-29  0:08 ` [PATCH 1/6] dt-bindings: iio: qcom,spmi-adc7-pmk8350.h: include sid into defines Dmitry Baryshkov
2023-03-29  0:21   ` Konrad Dybcio
2023-03-30  7:49   ` Krzysztof Kozlowski
2023-04-01 14:48   ` Jonathan Cameron
2023-04-01 14:59     ` Dmitry Baryshkov [this message]
2023-03-29  0:08 ` [PATCH 2/6] arm64: dts: qcom: pmk8350: rename pon label Dmitry Baryshkov
2023-03-29  0:22   ` Konrad Dybcio
2023-03-29  0:08 ` [PATCH 3/6] arm64: dts: qcom: use main pmk8350.dtsi for sc8280xp platform Dmitry Baryshkov
2023-03-29  0:27   ` Konrad Dybcio
2023-03-29  0:29     ` Konrad Dybcio
2023-03-29  0:35       ` Konrad Dybcio
2023-03-29 11:54         ` Dmitry Baryshkov
2023-03-29  0:08 ` [PATCH 4/6] arm64: dts: qcom: pm8350: include SID into labels Dmitry Baryshkov
2023-03-29  0:33   ` Konrad Dybcio
2023-03-29 10:51     ` Dmitry Baryshkov
2023-03-29  0:08 ` [PATCH 5/6] arm64: dts: qcom: sc8280xp*: use pm8350.dtsi Dmitry Baryshkov
2023-03-29  0:08 ` [PATCH 6/6] arm64: dts: qcom: sc8280xp*: use pm8350c.dtsi and pmr735a.dtsi Dmitry Baryshkov

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=eb044bbc-2a6d-1e2d-95cb-da0261451dfa@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=johan+linaro@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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