[PATCH v5 1/8] watchdog: mediatek: Add wdt/toprgu resets for mt6589

From: Luca Leonardo Scorcia

Date: Tue Sep 08 2026 - 15:19:23 EST


According to Android sources, mt6589 has 12 reset bits in the
WDT_SWSYSRST register. Populate toprgu_sw_rst_num to allow toprgu resets
in device trees of the many compatible devices.

Signed-off-by: Luca Leonardo Scorcia <l.scorcia@xxxxxxxxx>
---
drivers/watchdog/mtk_wdt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
index d9c30e4c80e3..d609f0fa35e3 100644
--- a/drivers/watchdog/mtk_wdt.c
+++ b/drivers/watchdog/mtk_wdt.c
@@ -64,6 +64,7 @@
#define DRV_NAME "mtk-wdt"
#define DRV_VERSION "1.0"

+#define MT6589_TOPRGU_SW_RST_NUM 12
#define MT7988_TOPRGU_SW_RST_NUM 24

static bool nowayout = WATCHDOG_NOWAYOUT;
@@ -88,6 +89,10 @@ static const struct mtk_wdt_data mt2712_data = {
.toprgu_sw_rst_num = MT2712_TOPRGU_SW_RST_NUM,
};

+static const struct mtk_wdt_data mt6589_data = {
+ .toprgu_sw_rst_num = MT6589_TOPRGU_SW_RST_NUM,
+};
+
static const struct mtk_wdt_data mt6735_data = {
.toprgu_sw_rst_num = MT6735_TOPRGU_RST_NUM,
};
@@ -493,7 +498,7 @@ static int mtk_wdt_resume(struct device *dev)

static const struct of_device_id mtk_wdt_dt_ids[] = {
{ .compatible = "mediatek,mt2712-wdt", .data = &mt2712_data },
- { .compatible = "mediatek,mt6589-wdt" },
+ { .compatible = "mediatek,mt6589-wdt", .data = &mt6589_data },
{ .compatible = "mediatek,mt6735-wdt", .data = &mt6735_data },
{ .compatible = "mediatek,mt6795-wdt", .data = &mt6795_data },
{ .compatible = "mediatek,mt7986-wdt", .data = &mt7986_data },
--
2.43.0