96fb215f76c04ed44e2645b0b8252d613222ec8e
[openwrt/staging/ldir.git] /
1 From 711a5b25bac95dcd1111521ed71693330e74a926 Mon Sep 17 00:00:00 2001
2 From: Sam Shih <sam.shih@mediatek.com>
3 Date: Wed, 5 Jan 2022 18:04:56 +0800
4 Subject: [PATCH] watchdog: mtk_wdt: mt7986: Add toprgu reset controller
5 support
6
7 Besides watchdog, the mt7986 toprgu module also provides software reset
8 functionality for various peripheral subsystems
9 (eg, ethernet, pcie, and connectivity)
10
11 Signed-off-by: Sam Shih <sam.shih@mediatek.com>
12 Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
13 Reviewed-by: Guenter Roeck <linux@roeck-us.net>
14 Link: https://lore.kernel.org/r/20220105100456.7126-3-sam.shih@mediatek.com
15 Signed-off-by: Guenter Roeck <linux@roeck-us.net>
16 Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
17 ---
18 drivers/watchdog/mtk_wdt.c | 6 ++++++
19 1 file changed, 6 insertions(+)
20
21 --- a/drivers/watchdog/mtk_wdt.c
22 +++ b/drivers/watchdog/mtk_wdt.c
23 @@ -10,6 +10,7 @@
24 */
25
26 #include <dt-bindings/reset-controller/mt2712-resets.h>
27 +#include <dt-bindings/reset/mt7986-resets.h>
28 #include <dt-bindings/reset-controller/mt8183-resets.h>
29 #include <dt-bindings/reset-controller/mt8192-resets.h>
30 #include <dt-bindings/reset/mt8195-resets.h>
31 @@ -76,6 +77,10 @@ static const struct mtk_wdt_data mt2712_
32 .toprgu_sw_rst_num = MT2712_TOPRGU_SW_RST_NUM,
33 };
34
35 +static const struct mtk_wdt_data mt7986_data = {
36 + .toprgu_sw_rst_num = MT7986_TOPRGU_SW_RST_NUM,
37 +};
38 +
39 static const struct mtk_wdt_data mt8183_data = {
40 .toprgu_sw_rst_num = MT8183_TOPRGU_SW_RST_NUM,
41 };
42 @@ -418,6 +423,7 @@ static int mtk_wdt_resume(struct device
43 static const struct of_device_id mtk_wdt_dt_ids[] = {
44 { .compatible = "mediatek,mt2712-wdt", .data = &mt2712_data },
45 { .compatible = "mediatek,mt6589-wdt" },
46 + { .compatible = "mediatek,mt7986-wdt", .data = &mt7986_data },
47 { .compatible = "mediatek,mt8183-wdt", .data = &mt8183_data },
48 { .compatible = "mediatek,mt8192-wdt", .data = &mt8192_data },
49 { .compatible = "mediatek,mt8195-wdt", .data = &mt8195_data },