diff mbox series

[1/1] arm64: dts: meson: g12b: odroid-n2: Add I2C RTC device node

Message ID 20210202170846.81685-1-alexander.stein@mailbox.org (mailing list archive)
State New, archived
Headers show
Series [1/1] arm64: dts: meson: g12b: odroid-n2: Add I2C RTC device node | expand

Commit Message

Alexander Stein Feb. 2, 2021, 5:08 p.m. UTC
This is taken from the downstream kernel and works out of the box.
Similar to other boards, this RTC should be the primary one, rather than
the internal one.

A wakeup alarm by writing to /sys/class/rtc/rtc0/wakealarm works as well.

Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
---
 .../boot/dts/amlogic/meson-g12b-odroid-n2.dtsi     | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Neil Armstrong Feb. 2, 2021, 5:29 p.m. UTC | #1
Hi,

On 02/02/2021 18:08, Alexander Stein wrote:
> This is taken from the downstream kernel and works out of the box.

Please keep authorship of the downstream commit.

> Similar to other boards, this RTC should be the primary one, rather than
> the internal one.
> 
> A wakeup alarm by writing to /sys/class/rtc/rtc0/wakealarm works as well.
> 
> Signed-off-by: Alexander Stein <alexander.stein@mailbox.org>
> ---
>  .../boot/dts/amlogic/meson-g12b-odroid-n2.dtsi     | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> index 050862cd0996..10edc7ce5e84 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> @@ -13,6 +13,8 @@ / {
>  	aliases {
>  		serial0 = &uart_AO;
>  		ethernet0 = &ethmac;
> +		rtc0 = &rtc;
> +		rtc1 = &vrtc;
>  	};
>  
>  	dioo2133: audio-amplifier-0 {
> @@ -471,6 +473,18 @@ hdmi_tx_tmds_out: endpoint {
>  	};
>  };
>  
> +&i2c3 {
> +	status = "okay";
> +	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
> +	pinctrl-names = "default";
> +
> +	rtc: rtc@51 {
> +		compatible = "nxp,pcf8563";
> +		reg = <0x51>;

Interrupt line is missing, Anand added:
+»       »       /*·RTC·INT·*/
+»       »       interrupts·=·<GPIOAO_7·IRQ_TYPE_LEVEL_LOW>;
+»       »       interrupt-parent·=·<&gpio_intc>;

> +		wakeup-source;
> +	};
> +};
> +
>  &ir {
>  	status = "okay";
>  	pinctrl-0 = <&remote_input_ao_pins>;
> 
Neil
Alexander Stein Feb. 2, 2021, 7:16 p.m. UTC | #2
Hi,

 On Tuesday, February 2, 2021, 6:29:48 PM CET Neil Armstrong wrote:
> Hi,
> 
> On 02/02/2021 18:08, Alexander Stein wrote:
> > This is taken from the downstream kernel and works out of the box.
> 
> Please keep authorship of the downstream commit.

Sure, will do.

> > +&i2c3 {
> > +	status = "okay";
> > +	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
> > +	pinctrl-names = "default";
> > +
> > +	rtc: rtc@51 {
> > +		compatible = "nxp,pcf8563";
> > +		reg = <0x51>;
> 
> Interrupt line is missing, Anand added:
> +»       »       /*·RTC·INT·*/
> +»       »       interrupts·=·<GPIOAO_7·IRQ_TYPE_LEVEL_LOW>;
> +»       »       interrupt-parent·=·<&gpio_intc>;
> 
> > +		wakeup-source;
> > +	};
> > +};

Eh, where did you get that? I'm talking about this commit https://github.com/
hardkernel/linux/commit/b2e22de15e55bb070a2fd45150a6d3e0179ed0e6

There is no interrupt line, although I understand it's missing.

Best regards,
Alexander
Alexander Stein Feb. 2, 2021, 11:10 p.m. UTC | #3
Nevermind,

I just saw that an identical patch has already been accepted, but is not in
Linus's tree yet.
See https://patchwork.kernel.org/project/linux-amlogic/patch/20210111135831.2218-1-christianshewitt@gmail.com/

Sorry for the noise and best regards,
Alexander
Alexander Stein Feb. 3, 2021, 4:47 p.m. UTC | #4
Nevermind,

I just saw that an identical patch has already been accepted, but is not in
Linus's tree yet.
See https://patchwork.kernel.org/project/linux-amlogic/patch/20210111135831.2218-1-christianshewitt@gmail.com/

Sorry for the noise and best regards,
Alexander
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 050862cd0996..10edc7ce5e84 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -13,6 +13,8 @@  / {
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
+		rtc0 = &rtc;
+		rtc1 = &vrtc;
 	};
 
 	dioo2133: audio-amplifier-0 {
@@ -471,6 +473,18 @@  hdmi_tx_tmds_out: endpoint {
 	};
 };
 
+&i2c3 {
+	status = "okay";
+	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
+	pinctrl-names = "default";
+
+	rtc: rtc@51 {
+		compatible = "nxp,pcf8563";
+		reg = <0x51>;
+		wakeup-source;
+	};
+};
+
 &ir {
 	status = "okay";
 	pinctrl-0 = <&remote_input_ao_pins>;