[1/5] arm64: dts: qcom: pmi8998: add rradc node

Message ID 20221016180330.1912214-2-caleb.connolly@linaro.org
State New
Headers
Series arm64: dts: qcom: add and enable the pmi8998 RRADC |

Commit Message

Caleb Connolly Oct. 16, 2022, 6:03 p.m. UTC
  Add a DT node for the Round Robin ADC found in the PMI8998 PMIC.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 arch/arm64/boot/dts/qcom/pmi8998.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Krzysztof Kozlowski Oct. 17, 2022, 1:10 a.m. UTC | #1
On 16/10/2022 14:03, Caleb Connolly wrote:
> Add a DT node for the Round Robin ADC found in the PMI8998 PMIC.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/pmi8998.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> index 6d3d212560c1..5a479259c041 100644
> --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
> @@ -18,6 +18,14 @@ pmi8998_gpio: gpios@c000 {
>  			interrupt-controller;
>  			#interrupt-cells = <2>;
>  		};
> +
> +		pmi8998_rradc: adc@4500 {
> +			compatible = "qcom,pmi8998-rradc";
> +			reg = <0x4500>;
> +			#io-channel-cells = <1>;
> +
> +			status = "disabled";

Why disabling it? It does not need any external/board resources, so
maybe it should be just like other adcs - enabled by default? What does
it measure? What is its input?

Best regards,
Krzysztof
  
Caleb Connolly Oct. 17, 2022, 3:29 p.m. UTC | #2
On 17/10/2022 02:10, Krzysztof Kozlowski wrote:
> On 16/10/2022 14:03, Caleb Connolly wrote:
>> Add a DT node for the Round Robin ADC found in the PMI8998 PMIC.
>>
>> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
>> ---
>>   arch/arm64/boot/dts/qcom/pmi8998.dtsi | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
>> index 6d3d212560c1..5a479259c041 100644
>> --- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
>> @@ -18,6 +18,14 @@ pmi8998_gpio: gpios@c000 {
>>   			interrupt-controller;
>>   			#interrupt-cells = <2>;
>>   		};
>> +
>> +		pmi8998_rradc: adc@4500 {
>> +			compatible = "qcom,pmi8998-rradc";
>> +			reg = <0x4500>;
>> +			#io-channel-cells = <1>;
>> +
>> +			status = "disabled";
> 
> Why disabling it? It does not need any external/board resources, so
> maybe it should be just like other adcs - enabled by default? What does
> it measure? What is its input?

The RRADC mostly reports values which only make sense on mobile devices, battery 
ID and temperature, USB and DC input voltage/current as well as a (duplicate?) 
die temperature of the PMIC - I guess closer to the SMB/FG block.

When I last tested the DC input readings didn't work on db845c, as it just 
produces the 4.2v you'd get from a battery.

Enabling it by default should be fine (and would certainly simplify this series :P).
> 
> Best regards,
> Krzysztof
>
  
Krzysztof Kozlowski Oct. 17, 2022, 5:22 p.m. UTC | #3
On 17/10/2022 11:29, Caleb Connolly wrote:

>>> +		pmi8998_rradc: adc@4500 {
>>> +			compatible = "qcom,pmi8998-rradc";
>>> +			reg = <0x4500>;
>>> +			#io-channel-cells = <1>;
>>> +
>>> +			status = "disabled";
>>
>> Why disabling it? It does not need any external/board resources, so
>> maybe it should be just like other adcs - enabled by default? What does
>> it measure? What is its input?
> 
> The RRADC mostly reports values which only make sense on mobile devices, battery 
> ID and temperature, USB and DC input voltage/current as well as a (duplicate?) 
> die temperature of the PMIC - I guess closer to the SMB/FG block.
> 
> When I last tested the DC input readings didn't work on db845c, as it just 
> produces the 4.2v you'd get from a battery.

If it is connected to some line - e.g. to the battery - then it is
operational and there is no reason to disable it.


Best regards,
Krzysztof
  

Patch

diff --git a/arch/arm64/boot/dts/qcom/pmi8998.dtsi b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
index 6d3d212560c1..5a479259c041 100644
--- a/arch/arm64/boot/dts/qcom/pmi8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi8998.dtsi
@@ -18,6 +18,14 @@  pmi8998_gpio: gpios@c000 {
 			interrupt-controller;
 			#interrupt-cells = <2>;
 		};
+
+		pmi8998_rradc: adc@4500 {
+			compatible = "qcom,pmi8998-rradc";
+			reg = <0x4500>;
+			#io-channel-cells = <1>;
+
+			status = "disabled";
+		};
 	};
 
 	pmi8998_lsid1: pmic@3 {