public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: sc8280xp-x13s: Add RTC support
@ 2022-12-30  8:50 Abel Vesa
  2022-12-30  9:08 ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Abel Vesa @ 2022-12-30  8:50 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Johan Hovold, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski
  Cc: linux-arm-msm, devicetree, Linux Kernel Mailing List

The PMK8350 PMIC has an available RTC block. Describe it in
sc8280xp-pmics dtsi and enable it in Lenovo Thinkpad X13s specific dts.
Mark it as wakeup-source to allow waking the system from sleep.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 .../arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 4 ++++
 arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi              | 8 ++++++++
 2 files changed, 12 insertions(+)

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 568c6be1ceaa..4f6daa3f8cb9 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -419,6 +419,10 @@ &pmk8280_pon_resin {
 	status = "okay";
 };
 
+&pmk8280_rtc {
+	status = "okay";
+};
+
 &pmk8280_vadc {
 	status = "okay";
 
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
index f2c0b71b5d8e..00b13f9a7af8 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-pmics.dtsi
@@ -95,6 +95,14 @@ pmk8280_adc_tm: adc-tm@3400 {
 			#thermal-sensor-cells = <1>;
 			status = "disabled";
 		};
+
+		pmk8280_rtc: rtc@6100 {
+			compatible = "qcom,pmk8350-rtc";
+			reg = <0x6100>, <0x6200>;
+			reg-names = "rtc", "alarm";
+			interrupts = <0x0 0x62 0x1 IRQ_TYPE_EDGE_RISING>;
+			status = "disabled";
+		};
 	};
 
 	pmc8280_1: pmic@1 {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sc8280xp-x13s: Add RTC support
  2022-12-30  8:50 [PATCH] arm64: dts: qcom: sc8280xp-x13s: Add RTC support Abel Vesa
@ 2022-12-30  9:08 ` Johan Hovold
  2022-12-30  9:20   ` Abel Vesa
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Hovold @ 2022-12-30  9:08 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree,
	Linux Kernel Mailing List

Hi Abel,

On Fri, Dec 30, 2022 at 10:50:10AM +0200, Abel Vesa wrote:
> The PMK8350 PMIC has an available RTC block. Describe it in
> sc8280xp-pmics dtsi and enable it in Lenovo Thinkpad X13s specific dts.
> Mark it as wakeup-source to allow waking the system from sleep.
> 
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

I'm currently working on proper RTC support which implies reading and
storing the time offset from EFI.

This patch in itself is pretty much useless as the returned time is just
some random time from the epoch (e.g. in the 1970's).

So I suggest waiting another week or so until I'm done.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sc8280xp-x13s: Add RTC support
  2022-12-30  9:08 ` Johan Hovold
@ 2022-12-30  9:20   ` Abel Vesa
  2022-12-30  9:23     ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Abel Vesa @ 2022-12-30  9:20 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree,
	Linux Kernel Mailing List

On 22-12-30 10:08:33, Johan Hovold wrote:
> Hi Abel,
> 
> On Fri, Dec 30, 2022 at 10:50:10AM +0200, Abel Vesa wrote:
> > The PMK8350 PMIC has an available RTC block. Describe it in
> > sc8280xp-pmics dtsi and enable it in Lenovo Thinkpad X13s specific dts.
> > Mark it as wakeup-source to allow waking the system from sleep.
> > 
> > Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> 
> I'm currently working on proper RTC support which implies reading and
> storing the time offset from EFI.
> 
> This patch in itself is pretty much useless as the returned time is just
> some random time from the epoch (e.g. in the 1970's).
> 
> So I suggest waiting another week or so until I'm done.

Sure thing. Consider this dropped then.

Please CC me when you have something so I can try it out.

Thanks,
Abel

> 
> Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: dts: qcom: sc8280xp-x13s: Add RTC support
  2022-12-30  9:20   ` Abel Vesa
@ 2022-12-30  9:23     ` Johan Hovold
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2022-12-30  9:23 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, linux-arm-msm, devicetree,
	Linux Kernel Mailing List

On Fri, Dec 30, 2022 at 11:20:11AM +0200, Abel Vesa wrote:
> On 22-12-30 10:08:33, Johan Hovold wrote:
> > Hi Abel,
> > 
> > On Fri, Dec 30, 2022 at 10:50:10AM +0200, Abel Vesa wrote:
> > > The PMK8350 PMIC has an available RTC block. Describe it in
> > > sc8280xp-pmics dtsi and enable it in Lenovo Thinkpad X13s specific dts.
> > > Mark it as wakeup-source to allow waking the system from sleep.
> > > 
> > > Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> > 
> > I'm currently working on proper RTC support which implies reading and
> > storing the time offset from EFI.
> > 
> > This patch in itself is pretty much useless as the returned time is just
> > some random time from the epoch (e.g. in the 1970's).
> > 
> > So I suggest waiting another week or so until I'm done.
> 
> Sure thing. Consider this dropped then.
> 
> Please CC me when you have something so I can try it out.

Sure, I will. Since it depends on UEFI support it may take a while to
get everything merged in mainline, but we should have working
out-of-tree support shortly.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-30  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-30  8:50 [PATCH] arm64: dts: qcom: sc8280xp-x13s: Add RTC support Abel Vesa
2022-12-30  9:08 ` Johan Hovold
2022-12-30  9:20   ` Abel Vesa
2022-12-30  9:23     ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox