Hello all, I wanted to create a watchdog driver for I2C W83792D chip and I realized that there is no clean way how to connect the existing I2C device driver with the watchdog ops. As the consequence of this I created new watchdog device class. This class supports all common infrastructure such as char device handling, sysfs exports and even the infrastructure for too fast watchdogs (the self ping feature). The class is based on the RTC class which is fairly similar in some aspects. The char device of watchdog class is compatible with existing watchdog API, so no need to change the user applications. There is just one exception and this is temperature handling. I belive it should be implemented not via IOCTL but using the HWMON class. (100% compatibility can be restored with the ioctl class op) I have defined this class ops so far: struct watchdog_class_ops { int (*enable)(struct device *); int (*disable)(struct device *); int (*ping)(struct device *); int (*set_timeout)(struct device *, int sec); int (*notify_reboot)(struct notifier_block *this, unsigned long code, void *unused); }; Each instance of the class has some predefined variables for common stuff: int expect_close; int timeout; int nowayout; unsigned long status; unsigned long boot_status; /* this may be removed in the future */ struct watchdog_info legacy_info; For further details please ask or consult the source code. I have attached the some code that demonstrates the class usage in softdog driver and for i2c based driver (w93792d). This code is not yet to be included, because I dont know if the class interface has all features you might think of. So far the software watchdog works for me and also the w83792d driver, both needs more testing to be sure everything works as expected. In a meanwhile I would like to hear the comments on the class design and interface design. This is my first kernel class so I expect that something might not be correct ;) I know about this issues: * I'm not sure if I'm locking the stuff correctly, please take a look into this. * Some lines of code exceeds the 80 collumns, codingstyle is not yet perfect * I created new directory for the class in drivers/watchdog, the Kconfig is only for testing, not yet full featured - help is missing, watchdog.h is local only * The W83792D driver is to be placed in the hwmon directory in final, but it is requested for now to be in the watchdog directory. * the w83792d driver needs improvement in the register banks handling, and watchdog integration. * some stuff in nowayout feature is missing for w83792d (the module can be unloaded) Please CC me, I'm not subscribed yet. Thanks, Regards Rudolf