Skip to content

Commit 38e0689

Browse files
Alexandre Torguealexandrebelloni
authored andcommitted
rtc: stm32: remove dedicated wakeup management
There is no more needs to use a dedicated wake up interrupt for RTC as EXTI block manages by itself now all interrupt lines. Dedicated wakeup interrupt has been introduced with STM32 MP1 support commit b72252b ("rtc: stm32: add stm32mp1 rtc support") because GIC & EXTI interrupts were not yet linked in EXTI driver. Removing this interrupt won't break compatibility with device trees which do use two interrupts entries: it could only prevent wakeup from low power modes on STM32MP1x, but platform power management is not yet available. Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com> Link: https://lore.kernel.org/r/20230531122732.1515594-1-amelie.delaunay@foss.st.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 93eff1e commit 38e0689

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

drivers/rtc/rtc-stm32.c

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ struct stm32_rtc_data {
114114
void (*clear_events)(struct stm32_rtc *rtc, unsigned int flags);
115115
bool has_pclk;
116116
bool need_dbp;
117-
bool has_wakeirq;
118117
};
119118

120119
struct stm32_rtc {
@@ -127,7 +126,6 @@ struct stm32_rtc {
127126
struct clk *rtc_ck;
128127
const struct stm32_rtc_data *data;
129128
int irq_alarm;
130-
int wakeirq_alarm;
131129
};
132130

133131
static void stm32_rtc_wpr_unlock(struct stm32_rtc *rtc)
@@ -547,7 +545,6 @@ static void stm32_rtc_clear_events(struct stm32_rtc *rtc,
547545
static const struct stm32_rtc_data stm32_rtc_data = {
548546
.has_pclk = false,
549547
.need_dbp = true,
550-
.has_wakeirq = false,
551548
.regs = {
552549
.tr = 0x00,
553550
.dr = 0x04,
@@ -569,7 +566,6 @@ static const struct stm32_rtc_data stm32_rtc_data = {
569566
static const struct stm32_rtc_data stm32h7_rtc_data = {
570567
.has_pclk = true,
571568
.need_dbp = true,
572-
.has_wakeirq = false,
573569
.regs = {
574570
.tr = 0x00,
575571
.dr = 0x04,
@@ -600,7 +596,6 @@ static void stm32mp1_rtc_clear_events(struct stm32_rtc *rtc,
600596
static const struct stm32_rtc_data stm32mp1_data = {
601597
.has_pclk = true,
602598
.need_dbp = false,
603-
.has_wakeirq = true,
604599
.regs = {
605600
.tr = 0x00,
606601
.dr = 0x04,
@@ -779,19 +774,12 @@ static int stm32_rtc_probe(struct platform_device *pdev)
779774
}
780775

781776
ret = device_init_wakeup(&pdev->dev, true);
782-
if (rtc->data->has_wakeirq) {
783-
rtc->wakeirq_alarm = platform_get_irq(pdev, 1);
784-
if (rtc->wakeirq_alarm > 0) {
785-
ret = dev_pm_set_dedicated_wake_irq(&pdev->dev,
786-
rtc->wakeirq_alarm);
787-
} else {
788-
ret = rtc->wakeirq_alarm;
789-
if (rtc->wakeirq_alarm == -EPROBE_DEFER)
790-
goto err;
791-
}
792-
}
793777
if (ret)
794-
dev_warn(&pdev->dev, "alarm can't wake up the system: %d", ret);
778+
goto err;
779+
780+
ret = dev_pm_set_wake_irq(&pdev->dev, rtc->irq_alarm);
781+
if (ret)
782+
goto err;
795783

796784
platform_set_drvdata(pdev, rtc);
797785

@@ -879,9 +867,6 @@ static int stm32_rtc_suspend(struct device *dev)
879867
if (rtc->data->has_pclk)
880868
clk_disable_unprepare(rtc->pclk);
881869

882-
if (device_may_wakeup(dev))
883-
return enable_irq_wake(rtc->irq_alarm);
884-
885870
return 0;
886871
}
887872

@@ -903,9 +888,6 @@ static int stm32_rtc_resume(struct device *dev)
903888
return ret;
904889
}
905890

906-
if (device_may_wakeup(dev))
907-
return disable_irq_wake(rtc->irq_alarm);
908-
909891
return ret;
910892
}
911893
#endif

0 commit comments

Comments
 (0)