]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mfd: adp5585: Refactor how regmap defaults are handled
authorNuno Sá <nuno.sa@analog.com>
Tue, 1 Jul 2025 14:32:01 +0000 (15:32 +0100)
committerLee Jones <lee@kernel.org>
Tue, 1 Jul 2025 20:50:50 +0000 (21:50 +0100)
commit1a4eabf662543c62ae1e71a26d1c8e6643c66388
tree9aaa8298a255350b06fbabdccc61bb7058fff1fa
parente65e2b0d0f7e75c40f426e0f3e0a1bb6faff93e6
mfd: adp5585: Refactor how regmap defaults are handled

The only thing changing between variants is the regmap default
registers. Hence, instead of having a regmap configuration for every
variant (duplicating lots of fields), add a chip info type of structure
with a regmap ID to identify which defaults to use and populate
regmap_config at runtime given a template plus the id. Also note that
between variants, the defaults can be the same which means the chip info
structure can be used in more than one compatible.

This will also make it simpler adding new chips with more variants.

Also note that the chip info structures are deliberately not const as
they will also contain lots of members that are the same between the
different devices variants and so we will fill those at runtime.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-6-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/adp5585.c
include/linux/mfd/adp5585.h