ath25: switch default kernel to 5.15
[openwrt/openwrt.git] / target / linux / at91 / patches-5.10 / 189-watchdog-sama5d4_wdt-add-support-for-sama7g5-wdt.patch
1 From ff83cc9f95aaba75991210312061b7fe52aaa400 Mon Sep 17 00:00:00 2001
2 From: Eugen Hristev <eugen.hristev@microchip.com>
3 Date: Thu, 27 May 2021 13:01:19 +0300
4 Subject: [PATCH 189/247] watchdog: sama5d4_wdt: add support for sama7g5-wdt
5
6 Add support for compatible sama7g5-wdt.
7 The sama7g5 wdt is the same hardware block as on sam9x60.
8 Adapt the driver to use the sam9x60/sama7g5 variant if either
9 of the two compatibles are selected (sam9x60-wdt/sama7g5-wdt).
10
11 Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
12 Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
13 Reviewed-by: Guenter Roeck <linux@roeck-us.net>
14 Link: https://lore.kernel.org/r/20210527100120.266796-2-eugen.hristev@microchip.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/sama5d4_wdt.c | 10 ++++++++--
19 1 file changed, 8 insertions(+), 2 deletions(-)
20
21 --- a/drivers/watchdog/sama5d4_wdt.c
22 +++ b/drivers/watchdog/sama5d4_wdt.c
23 @@ -268,8 +268,10 @@ static int sama5d4_wdt_probe(struct plat
24 wdd->min_timeout = MIN_WDT_TIMEOUT;
25 wdd->max_timeout = MAX_WDT_TIMEOUT;
26 wdt->last_ping = jiffies;
27 - wdt->sam9x60_support = of_device_is_compatible(dev->of_node,
28 - "microchip,sam9x60-wdt");
29 +
30 + if (of_device_is_compatible(dev->of_node, "microchip,sam9x60-wdt") ||
31 + of_device_is_compatible(dev->of_node, "microchip,sama7g5-wdt"))
32 + wdt->sam9x60_support = true;
33
34 watchdog_set_drvdata(wdd, wdt);
35
36 @@ -329,6 +331,10 @@ static const struct of_device_id sama5d4
37 {
38 .compatible = "microchip,sam9x60-wdt",
39 },
40 + {
41 + .compatible = "microchip,sama7g5-wdt",
42 + },
43 +
44 { }
45 };
46 MODULE_DEVICE_TABLE(of, sama5d4_wdt_of_match);