• Linus Walleij's avatar
    watchdog: ixp4xx: Rewrite driver to use core · 580b8e28
    Linus Walleij authored
    This rewrites the IXP4xx watchdog driver as follows:
    
    - Spawn the watchdog driver as a platform device from the timer
      driver. It's one device in the hardware, and the fact that
      Linux splits the handling into two different devices is
      a Linux pecularity, and thus it becomes a Linux pecularity
      to spawn a separate watchdog driver.
    
    - Spawn the watchdog driver from the timer driver at probe().
      This is well after the timer driver as actually registered and
      started and we know the register base is available.
    
    - Instead of looping back callbacks to the timer drivers for all
      watchdog calls, pass the register base to the watchdog driver
      and manage the registers there. The two drivers aren't even
      interested in the same register so the spinlock is totally
      surplus, delete it.
    
    - Replace pretty much all of the content in the watchdog driver
      with a simple, modern watchdog driver utilizing the watchdog
      core instead of registering its own misc device and ioctl()
      handling.
    
    - Drop module parameters as the same already exist in the
      watchdog core.
    
    What remains is a slim elegant (IMO) watchdog driver using the
    watchdog core, spawning from device tree or boardfile alike.
    
    Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
    Link: https://lore.kernel.org/r/20210726121214.2572836-1-linus.walleij@linaro.orgSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
    580b8e28
Kconfig 66 KB