aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2014-02-10 18:00:30 -0500
committerJason Cooper <jason@lakedaemon.net>2014-02-21 22:44:11 -0500
commit490d8e3cbf60cc4ad874caa8c07e67e14c25a1af (patch)
tree2fbd03ad95afa4bedc1e9d88f7f8acbd88b46927 /drivers/watchdog
parent1924227bcda1d1844b8cc54b557b85a1d9b323f0 (diff)
watchdog: orion: Add per-compatible watchdog start implementation
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>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/orion_wdt.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index b48fd0871f17..392529785b40 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -50,6 +50,7 @@ struct orion_watchdog_data {
50 int rstout_enable_bit; 50 int rstout_enable_bit;
51 int (*clock_init)(struct platform_device *, 51 int (*clock_init)(struct platform_device *,
52 struct orion_watchdog *); 52 struct orion_watchdog *);
53 int (*start)(struct watchdog_device *);
53}; 54};
54 55
55struct orion_watchdog { 56struct orion_watchdog {
@@ -86,7 +87,7 @@ static int orion_wdt_ping(struct watchdog_device *wdt_dev)
86 return 0; 87 return 0;
87} 88}
88 89
89static int orion_wdt_start(struct watchdog_device *wdt_dev) 90static int orion_start(struct watchdog_device *wdt_dev)
90{ 91{
91 struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev); 92 struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
92 93
@@ -105,6 +106,14 @@ static int orion_wdt_start(struct watchdog_device *wdt_dev)
105 return 0; 106 return 0;
106} 107}
107 108
109static int orion_wdt_start(struct watchdog_device *wdt_dev)
110{
111 struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
112
113 /* There are some per-SoC quirks to handle */
114 return dev->data->start(wdt_dev);
115}
116
108static int orion_wdt_stop(struct watchdog_device *wdt_dev) 117static int orion_wdt_stop(struct watchdog_device *wdt_dev)
109{ 118{
110 struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev); 119 struct orion_watchdog *dev = watchdog_get_drvdata(wdt_dev);
@@ -193,6 +202,7 @@ static const struct orion_watchdog_data orion_data = {
193 .wdt_enable_bit = BIT(4), 202 .wdt_enable_bit = BIT(4),
194 .wdt_counter_offset = 0x24, 203 .wdt_counter_offset = 0x24,
195 .clock_init = orion_wdt_clock_init, 204 .clock_init = orion_wdt_clock_init,
205 .start = orion_start,
196}; 206};
197 207
198static const struct of_device_id orion_wdt_of_match_table[] = { 208static const struct of_device_id orion_wdt_of_match_table[] = {