watchdog: max77620: Add support for the max77714 variant
authorLuca Ceresoli <luca@lucaceresoli.net>
Wed, 23 Feb 2022 17:59:06 +0000 (18:59 +0100)
committerLee Jones <lee.jones@linaro.org>
Mon, 7 Mar 2022 13:54:49 +0000 (13:54 +0000)
commit254099d8fafcd80e11a3246f6ff62af816a2b566
treef171210a5be5be104a174f0c3a98f92e96ac43c9
parent60b050ff3a60273d56b4017d0f45d5ca71aae5ad
watchdog: max77620: Add support for the max77714 variant

The MAX77714 is a MFD chip whose watchdog has the same programming
procedures as the MAX77620 watchdog, but most register offsets and bit
masks are different, as well as some features.

Support the MAX77714 watchdog by adding a variant description table holding
the differences.

All the features implemented by this driver are available on the MAX77714
except for the lack of a WDTOFFC bit. Instead of using a "HAS_*" flag we
handle this by holding in the cnfg_glbl2_cfg_bits struct field the bits
(i.e. the features) to enable in the CNFG_GLBL2 register. These bits differ
among the two models. This implementation allows to avoid any conditional
code, keeping the execution flow unchanged.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/watchdog/Kconfig
drivers/watchdog/max77620_wdt.c