watchdog: Introduce WDOG_HW_RUNNING flag
[cascardo/linux.git] / include / linux / watchdog.h
index 8e82dae..e2f4554 100644 (file)
@@ -105,6 +105,7 @@ struct watchdog_device {
 #define WDOG_ACTIVE            0       /* Is the watchdog running/active */
 #define WDOG_NO_WAY_OUT                1       /* Is 'nowayout' feature set ? */
 #define WDOG_STOP_ON_REBOOT    2       /* Should be stopped on reboot */
+#define WDOG_HW_RUNNING                3       /* True if HW watchdog running */
        struct list_head deferred;
 };
 
@@ -117,6 +118,15 @@ static inline bool watchdog_active(struct watchdog_device *wdd)
        return test_bit(WDOG_ACTIVE, &wdd->status);
 }
 
+/*
+ * Use the following function to check whether or not the hardware watchdog
+ * is running
+ */
+static inline bool watchdog_hw_running(struct watchdog_device *wdd)
+{
+       return test_bit(WDOG_HW_RUNNING, &wdd->status);
+}
+
 /* Use the following function to set the nowayout feature */
 static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool nowayout)
 {