All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] rtc: tps65910: Support wakeup-source property
@ 2021-01-20 21:16 Dmitry Osipenko
  2021-01-20 21:16 ` [PATCH v2 2/2] ARM: tegra: Specify tps65911 as wakeup source Dmitry Osipenko
  2021-01-25 23:21 ` (subset) [PATCH v2 1/2] rtc: tps65910: Support wakeup-source property Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2021-01-20 21:16 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Thierry Reding,
	Jonathan Hunter, Peter Geis, Matt Merhar
  Cc: linux-rtc, linux-tegra, linux-kernel

TPS65910 is a PMIC MFD device and RTC is one of its functions. The
wakeup-source DT property is specified for the parent MFD device and we
need to use this property for the RTC in order to allow to use RTC alarm
for waking up system from suspend by default, instead of requiring user
to enable wakeup manually via sysfs.

Tested-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Matt Merhar <mattmerhar@protonmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---

Changelog:

v2: - Rebased on a recent linux-next, fixed merge conflict.

 drivers/rtc/rtc-tps65910.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index e1415a49f4ee..288abb1abdb8 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -418,10 +418,14 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
 		irq = -1;
 
 	tps_rtc->irq = irq;
-	if (irq != -1)
-		device_set_wakeup_capable(&pdev->dev, 1);
-	else
+	if (irq != -1) {
+		if (device_property_present(tps65910->dev, "wakeup-source"))
+			device_init_wakeup(&pdev->dev, 1);
+		else
+			device_set_wakeup_capable(&pdev->dev, 1);
+	} else {
 		clear_bit(RTC_FEATURE_ALARM, tps_rtc->rtc->features);
+	}
 
 	tps_rtc->rtc->ops = &tps65910_rtc_ops;
 	tps_rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
-- 
2.29.2


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

* [PATCH v2 2/2] ARM: tegra: Specify tps65911 as wakeup source
  2021-01-20 21:16 [PATCH v2 1/2] rtc: tps65910: Support wakeup-source property Dmitry Osipenko
@ 2021-01-20 21:16 ` Dmitry Osipenko
  2021-01-25 23:21 ` (subset) [PATCH v2 1/2] rtc: tps65910: Support wakeup-source property Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Osipenko @ 2021-01-20 21:16 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Thierry Reding,
	Jonathan Hunter, Peter Geis, Matt Merhar
  Cc: linux-rtc, linux-tegra, linux-kernel

Specify TPS65911 as wakeup source on Tegra devices in order to allow
its RTC to wake up system from suspend by default instead of requiring
wakeup to be enabled manually via sysfs.

Tested-by: Peter Geis <pgwipeout@gmail.com>
Tested-by: Matt Merhar <mattmerhar@protonmail.com>
[Matt and Peter tested this change on Tegra30 Ouya]
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---

Changelog:

v2: - No changes.

 arch/arm/boot/dts/tegra30-apalis.dtsi                      | 1 +
 arch/arm/boot/dts/tegra30-asus-nexus7-grouper-ti-pmic.dtsi | 1 +
 arch/arm/boot/dts/tegra30-beaver.dts                       | 1 +
 arch/arm/boot/dts/tegra30-cardhu.dtsi                      | 1 +
 arch/arm/boot/dts/tegra30-colibri.dtsi                     | 1 +
 arch/arm/boot/dts/tegra30-ouya.dts                         | 1 +
 6 files changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/tegra30-apalis.dtsi b/arch/arm/boot/dts/tegra30-apalis.dtsi
index 6544ce70b46f..b2ac51fb15b1 100644
--- a/arch/arm/boot/dts/tegra30-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra30-apalis.dtsi
@@ -860,6 +860,7 @@ pmic: pmic@2d {
 			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
+			wakeup-source;
 
 			ti,system-power-controller;
 
diff --git a/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-ti-pmic.dtsi b/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-ti-pmic.dtsi
index bfc06b988781..b97da45ebdb4 100644
--- a/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-ti-pmic.dtsi
+++ b/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-ti-pmic.dtsi
@@ -12,6 +12,7 @@ pmic: pmic@2d {
 			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
+			wakeup-source;
 
 			ti,en-gpio-sleep = <0 0 1 0 0 0 0 0 0>;
 			ti,system-power-controller;
diff --git a/arch/arm/boot/dts/tegra30-beaver.dts b/arch/arm/boot/dts/tegra30-beaver.dts
index e0624b74fb50..e159feeedef7 100644
--- a/arch/arm/boot/dts/tegra30-beaver.dts
+++ b/arch/arm/boot/dts/tegra30-beaver.dts
@@ -1776,6 +1776,7 @@ pmic: tps65911@2d {
 			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
+			wakeup-source;
 
 			ti,system-power-controller;
 
diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
index dab9989fa760..788f16d2a0fa 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -240,6 +240,7 @@ pmic: tps65911@2d {
 			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
+			wakeup-source;
 
 			ti,system-power-controller;
 
diff --git a/arch/arm/boot/dts/tegra30-colibri.dtsi b/arch/arm/boot/dts/tegra30-colibri.dtsi
index e36aa3ce6c3d..413e35215804 100644
--- a/arch/arm/boot/dts/tegra30-colibri.dtsi
+++ b/arch/arm/boot/dts/tegra30-colibri.dtsi
@@ -737,6 +737,7 @@ pmic: pmic@2d {
 			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
+			wakeup-source;
 
 			ti,system-power-controller;
 
diff --git a/arch/arm/boot/dts/tegra30-ouya.dts b/arch/arm/boot/dts/tegra30-ouya.dts
index 74da1360d297..8f66b16a786f 100644
--- a/arch/arm/boot/dts/tegra30-ouya.dts
+++ b/arch/arm/boot/dts/tegra30-ouya.dts
@@ -139,6 +139,7 @@ pmic: pmic@2d {
 			interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
 			#interrupt-cells = <2>;
 			interrupt-controller;
+			wakeup-source;
 
 			ti,en-gpio-sleep = <0 1 1 1 1 1 0 0 1>;
 			ti,system-power-controller;
-- 
2.29.2


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

* Re: (subset) [PATCH v2 1/2] rtc: tps65910: Support wakeup-source property
  2021-01-20 21:16 [PATCH v2 1/2] rtc: tps65910: Support wakeup-source property Dmitry Osipenko
  2021-01-20 21:16 ` [PATCH v2 2/2] ARM: tegra: Specify tps65911 as wakeup source Dmitry Osipenko
@ 2021-01-25 23:21 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2021-01-25 23:21 UTC (permalink / raw)
  To: Alessandro Zummo, Thierry Reding, Peter Geis, Jonathan Hunter,
	Matt Merhar, Dmitry Osipenko
  Cc: Alexandre Belloni, linux-kernel, linux-tegra, linux-rtc

On Thu, 21 Jan 2021 00:16:02 +0300, Dmitry Osipenko wrote:
> TPS65910 is a PMIC MFD device and RTC is one of its functions. The
> wakeup-source DT property is specified for the parent MFD device and we
> need to use this property for the RTC in order to allow to use RTC alarm
> for waking up system from suspend by default, instead of requiring user
> to enable wakeup manually via sysfs.

Applied, thanks!

[1/2] rtc: tps65910: Support wakeup-source property
      commit: 454ba154a62c8806e82a3581c5233a5176cd7dd7

Best regards,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>

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

end of thread, other threads:[~2021-01-25 23:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 21:16 [PATCH v2 1/2] rtc: tps65910: Support wakeup-source property Dmitry Osipenko
2021-01-20 21:16 ` [PATCH v2 2/2] ARM: tegra: Specify tps65911 as wakeup source Dmitry Osipenko
2021-01-25 23:21 ` (subset) [PATCH v2 1/2] rtc: tps65910: Support wakeup-source property Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.