Skip to contentSkip to conversation

rtc: tps65910: Support wakeup-source property

PATCH Superseded Dmitry Osipenko 1 participant 2 messages Jan 20, 2021

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 rtc: tps65910: Support wakeup-source property

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.

---
 drivers/rtc/rtc-tps65910.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/rtc/rtc-tps65910.c +5 -1
index 2d87b62826a8..f94899d2d5b3 100644
@@ -426,7 +426,11 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
 
 	tps_rtc->irq = irq;
 	if (irq != -1) {
-		device_set_wakeup_capable(&pdev->dev, 1);
+		if (device_property_present(tps65910->dev, "wakeup-source"))
+			device_init_wakeup(&pdev->dev, 1);
+		else
+			device_set_wakeup_capable(&pdev->dev, 1);
+
 		tps_rtc->rtc->ops = &tps65910_rtc_ops;
 	} else
 		tps_rtc->rtc->ops = &tps65910_rtc_ops_noirq;
Signature · 1 line
2.29.2
#1 lore raw

PATCH 2/2 ARM: tegra: Specify tps65911 as wakeup source

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.

---
 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(+)
arch/arm/boot/dts/tegra30-apalis.dtsi +1 -0
index 6544ce70b46f..b2ac51fb15b1 100644
@@ -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;
 
arch/arm/boot/dts/tegra30-asus-nexus7-grouper-ti-pmic.dtsi +1 -0
index bfc06b988781..b97da45ebdb4 100644
@@ -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;
arch/arm/boot/dts/tegra30-beaver.dts +1 -0
index e0624b74fb50..e159feeedef7 100644
@@ -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;
 
arch/arm/boot/dts/tegra30-cardhu.dtsi +1 -0
index dab9989fa760..788f16d2a0fa 100644
@@ -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;
 
arch/arm/boot/dts/tegra30-colibri.dtsi +1 -0
index e36aa3ce6c3d..413e35215804 100644
@@ -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;
 
arch/arm/boot/dts/tegra30-ouya.dts +1 -0
index 74da1360d297..8f66b16a786f 100644
@@ -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;
Signature · 1 line
2.29.2