Skip to content

Commit

Permalink
rtc: stm32: remove dedicated wakeup management
Browse files Browse the repository at this point in the history
There is no more needs to use a dedicated wake up interrupt for RTC as
EXTI block manage by himself now all interrupt lines.

Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
Change-Id: I84007c095feb08a1e02bbc46a3ba44e2f88f37ca
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/142475
Reviewed-by: CITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: Benjamin GAIGNARD <benjamin.gaignard@st.com>
  • Loading branch information
atorgue authored and fourmone committed Mar 25, 2022
1 parent ab8f5b9 commit 5a45e1f
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions drivers/rtc/rtc-stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ struct stm32_rtc_data {
void (*clear_events)(struct stm32_rtc *rtc, unsigned int flags);
bool has_pclk;
bool need_dbp;
bool has_wakeirq;
bool has_lsco;
};

Expand All @@ -143,7 +142,6 @@ struct stm32_rtc {
struct clk *rtc_ck;
const struct stm32_rtc_data *data;
int irq_alarm;
int wakeirq_alarm;
int lsco;
struct clk *clk_lsco;
};
Expand Down Expand Up @@ -642,7 +640,6 @@ static void stm32_rtc_clear_events(struct stm32_rtc *rtc,
static const struct stm32_rtc_data stm32_rtc_data = {
.has_pclk = false,
.need_dbp = true,
.has_wakeirq = false,
.has_lsco = false,
.regs = {
.tr = 0x00,
Expand All @@ -666,7 +663,6 @@ static const struct stm32_rtc_data stm32_rtc_data = {
static const struct stm32_rtc_data stm32h7_rtc_data = {
.has_pclk = true,
.need_dbp = true,
.has_wakeirq = false,
.has_lsco = false,
.regs = {
.tr = 0x00,
Expand Down Expand Up @@ -699,7 +695,6 @@ static void stm32mp1_rtc_clear_events(struct stm32_rtc *rtc,
static const struct stm32_rtc_data stm32mp1_data = {
.has_pclk = true,
.need_dbp = false,
.has_wakeirq = true,
.has_lsco = true,
.regs = {
.tr = 0x00,
Expand Down Expand Up @@ -880,19 +875,12 @@ static int stm32_rtc_probe(struct platform_device *pdev)
}

ret = device_init_wakeup(&pdev->dev, true);
if (rtc->data->has_wakeirq) {
rtc->wakeirq_alarm = platform_get_irq(pdev, 1);
if (rtc->wakeirq_alarm > 0) {
ret = dev_pm_set_dedicated_wake_irq(&pdev->dev,
rtc->wakeirq_alarm);
} else {
ret = rtc->wakeirq_alarm;
if (rtc->wakeirq_alarm == -EPROBE_DEFER)
goto err;
}
}
if (ret)
dev_warn(&pdev->dev, "alarm can't wake up the system: %d", ret);
goto err;

ret = dev_pm_set_wake_irq(&pdev->dev, rtc->irq_alarm);
if (ret)
goto err;

platform_set_drvdata(pdev, rtc);

Expand Down Expand Up @@ -1000,9 +988,6 @@ static int stm32_rtc_suspend(struct device *dev)
if (rtc->data->has_pclk)
clk_disable_unprepare(rtc->pclk);

if (device_may_wakeup(dev))
return enable_irq_wake(rtc->irq_alarm);

return 0;
}

Expand All @@ -1024,9 +1009,6 @@ static int stm32_rtc_resume(struct device *dev)
return ret;
}

if (device_may_wakeup(dev))
return disable_irq_wake(rtc->irq_alarm);

return ret;
}
#endif
Expand Down

0 comments on commit 5a45e1f

Please sign in to comment.