aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNuno Sá <nuno.sa@analog.com>2025-07-01 15:32:01 +0100
committerLee Jones <lee@kernel.org>2025-07-01 21:50:50 +0100
commit1a4eabf662543c62ae1e71a26d1c8e6643c66388 (patch)
tree9aaa8298a255350b06fbabdccc61bb7058fff1fa /include
parentdt-bindings: mfd: adp5585: document adp5589 I/O expander (diff)
downloadlinux-1a4eabf662543c62ae1e71a26d1c8e6643c66388.tar.gz
linux-1a4eabf662543c62ae1e71a26d1c8e6643c66388.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mfd/adp5585.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mfd/adp5585.h b/include/linux/mfd/adp5585.h
index 016033cd68e4..c56af8d8d76c 100644
--- a/include/linux/mfd/adp5585.h
+++ b/include/linux/mfd/adp5585.h
@@ -119,8 +119,19 @@
struct regmap;
+enum adp5585_variant {
+ ADP5585_00 = 1,
+ ADP5585_01,
+ ADP5585_02,
+ ADP5585_03,
+ ADP5585_04,
+ ADP5585_MAX
+};
+
struct adp5585_dev {
+ struct device *dev;
struct regmap *regmap;
+ enum adp5585_variant variant;
};
#endif