• Pratyush Anand's avatar
    watchdog: Read device status through sysfs attributes · 33b71126
    Pratyush Anand authored
    This patch adds following attributes to watchdog device's sysfs interface
    to read its different status.
    
    * state - reads whether device is active or not
    * identity - reads Watchdog device's identity string.
    * timeout - reads current timeout.
    * timeleft - reads timeleft before watchdog generates a reset
    * bootstatus - reads status of the watchdog device at boot
    * status - reads watchdog device's  internal status bits
    * nowayout - reads whether nowayout feature was set or not
    
    Testing with iTCO_wdt:
     # cd /sys/class/watchdog/watchdog1/
     # ls
    bootstatus  dev  device  identity  nowayout  power  state
    subsystem  timeleft  timeout  uevent
     # cat identity
    iTCO_wdt
     # cat timeout
    30
     # cat state
    inactive
     # echo > /dev/watchdog1
     # cat timeleft
    26
     # cat state
    active
     # cat bootstatus
    0
     # cat nowayout
    0
    Signed-off-by: default avatarPratyush Anand <panand@redhat.com>
    Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
    33b71126
sysfs-class-watchdog 1.59 KB