watchdog: orion: Add per-compatible watchdog start implementation
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Mon, 10 Feb 2014 23:00:30 +0000 (20:00 -0300)
committerJason Cooper <jason@lakedaemon.net>
Sat, 22 Feb 2014 03:44:11 +0000 (03:44 +0000)
To handle differences between SoCs this commit adds per-compatible
string start() function for the watchdog kick-off. This is preparation
work and makes no functionality changes to the current driver.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Wim Van Sebroeck <wim@iguana.be>
Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
drivers/watchdog/orion_wdt.c

index b48fd0871f1740ce424c0ad1b265fefcecbdee54..392529785b40b20bd3dbcb4d38c6d4f34ad28ad3 100644 (file)
@@ -50,6 +50,7 @@ struct orion_watchdog_data {
        int rstout_enable_bit;
        int (*clock_init)(struct platform_device *,
                          struct orion_watchdog *);
+       int (*start)(struct watchdog_device *);
 };
 
 struct orion_watchdog {
@@ -86,7 +87,7 @@ static int orion_wdt_ping(struct watchdog_device *wdt_dev)
        return 0;
 }
 
-static int orion_wdt_start(struct watchdog_device *wdt_dev)
+static int orion_start(struct watchdog_device *wdt_dev)
 {
        struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
 
@@ -105,6 +106,14 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
        return 0;
 }
 
+static int orion_wdt_start(struct watchdog_device *wdt_dev)
+{
+       struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
+
+       /* There are some per-SoC quirks to handle */
+       return dev->data->start(wdt_dev);
+}
+
 static int orion_wdt_stop(struct watchdog_device *wdt_dev)
 {
        struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
@@ -193,6 +202,7 @@ static const struct orion_watchdog_data orion_data = {
        .wdt_enable_bit = BIT(4),
        .wdt_counter_offset = 0x24,
        .clock_init = orion_wdt_clock_init,
+       .start = orion_start,
 };
 
 static const struct of_device_id orion_wdt_of_match_table[] = {