[1/2] arm64: dts: qcom: pm8450a: add rtc node

Message ID 20221213005539.1133443-1-echanude@redhat.com
State New
Headers
Series [1/2] arm64: dts: qcom: pm8450a: add rtc node |

Commit Message

Eric Chanudet Dec. 13, 2022, 12:55 a.m. UTC
  Add the rtc block on pm8450a first pmic to enable the rtc for
sa8540p-ride.

Signed-off-by: Eric Chanudet <echanude@redhat.com>
---
 arch/arm64/boot/dts/qcom/pm8450a.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Comments

Dmitry Baryshkov Dec. 13, 2022, 1:18 a.m. UTC | #1
On 13 December 2022 03:55:38 GMT+03:00, Eric Chanudet <echanude@redhat.com> wrote:
>Add the rtc block on pm8450a first pmic to enable the rtc for
>sa8540p-ride.
>
>Signed-off-by: Eric Chanudet <echanude@redhat.com>
>---
> arch/arm64/boot/dts/qcom/pm8450a.dtsi | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
>diff --git a/arch/arm64/boot/dts/qcom/pm8450a.dtsi b/arch/arm64/boot/dts/qcom/pm8450a.dtsi
>index 34fc72896761..af761dbfbc66 100644
>--- a/arch/arm64/boot/dts/qcom/pm8450a.dtsi
>+++ b/arch/arm64/boot/dts/qcom/pm8450a.dtsi
>@@ -13,6 +13,14 @@ pm8450a: pmic@0 {
> 		#address-cells = <1>;
> 		#size-cells = <0>;
> 
>+		rtc@6000 {
>+			compatible = "qcom,pm8941-rtc";
>+			reg = <0x6000>;
>+			reg-names = "rtc", "alarm";
>+			interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>;


0x60?

>+			wakeup-source;
>+		};
>+
> 		pm8450a_gpios: gpio@c000 {
> 			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
> 			reg = <0xc000>;
  
Eric Chanudet Dec. 13, 2022, 6:18 p.m. UTC | #2
On Tue, Dec 13, 2022 at 04:18:00AM +0300, Dmitry Baryshkov wrote:
> >diff --git a/arch/arm64/boot/dts/qcom/pm8450a.dtsi b/arch/arm64/boot/dts/qcom/pm8450a.dtsi
> >index 34fc72896761..af761dbfbc66 100644
> >--- a/arch/arm64/boot/dts/qcom/pm8450a.dtsi
> >+++ b/arch/arm64/boot/dts/qcom/pm8450a.dtsi
> >@@ -13,6 +13,14 @@ pm8450a: pmic@0 {
> > 		#address-cells = <1>;
> > 		#size-cells = <0>;
> > 
> >+		rtc@6000 {
> >+			compatible = "qcom,pm8941-rtc";
> >+			reg = <0x6000>;
> >+			reg-names = "rtc", "alarm";
> >+			interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>;
> 
> 
> 0x60?

Checking downstream it uses 0x61 for the ppid. This is also the case
for all other descriptions of that RTC I could find. On the other hand,
that does not describe the "alarm" register bank at 0x6100.
Should it be added, if anything to match reg-names?

I tried a quick test of the alarm on sa8540p-ride:
$ echo $(date '+%s' -d '+ 10 seconds') > /sys/class/rtc/rtc0/wakealarm
It logged the interrupt:
172:          3          0          0          0          0          0          0          0  pmic_arb 101777441 Edge      pm8xxx_rtc_alarm
  
Dmitry Baryshkov Dec. 13, 2022, 10:16 p.m. UTC | #3
On 13 December 2022 20:18:55 EET, Eric Chanudet <echanude@redhat.com> wrote:
>On Tue, Dec 13, 2022 at 04:18:00AM +0300, Dmitry Baryshkov wrote:
>> >diff --git a/arch/arm64/boot/dts/qcom/pm8450a.dtsi b/arch/arm64/boot/dts/qcom/pm8450a.dtsi
>> >index 34fc72896761..af761dbfbc66 100644
>> >--- a/arch/arm64/boot/dts/qcom/pm8450a.dtsi
>> >+++ b/arch/arm64/boot/dts/qcom/pm8450a.dtsi
>> >@@ -13,6 +13,14 @@ pm8450a: pmic@0 {
>> > 		#address-cells = <1>;
>> > 		#size-cells = <0>;
>> > 
>> >+		rtc@6000 {
>> >+			compatible = "qcom,pm8941-rtc";
>> >+			reg = <0x6000>;
>> >+			reg-names = "rtc", "alarm";
>> >+			interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>;
>> 
>> 
>> 0x60?
>
>Checking downstream it uses 0x61 for the ppid. This is also the case
>for all other descriptions of that RTC I could find. On the other hand,
>that does not describe the "alarm" register bank at 0x6100.
>Should it be added, if anything to match reg-names?

Definitely yes. I think otherwise it breaks the idea of reg-names.

>
>I tried a quick test of the alarm on sa8540p-ride:
>$ echo $(date '+%s' -d '+ 10 seconds') > /sys/class/rtc/rtc0/wakealarm
>It logged the interrupt:
>172:          3          0          0          0          0          0          0          0  pmic_arb 101777441 Edge      pm8xxx_rtc_alarm
>
  

Patch

diff --git a/arch/arm64/boot/dts/qcom/pm8450a.dtsi b/arch/arm64/boot/dts/qcom/pm8450a.dtsi
index 34fc72896761..af761dbfbc66 100644
--- a/arch/arm64/boot/dts/qcom/pm8450a.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm8450a.dtsi
@@ -13,6 +13,14 @@  pm8450a: pmic@0 {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
+		rtc@6000 {
+			compatible = "qcom,pm8941-rtc";
+			reg = <0x6000>;
+			reg-names = "rtc", "alarm";
+			interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>;
+			wakeup-source;
+		};
+
 		pm8450a_gpios: gpio@c000 {
 			compatible = "qcom,pm8150-gpio", "qcom,spmi-gpio";
 			reg = <0xc000>;