diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-10-20 09:18:48 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-10-23 11:44:50 +0200 |
commit | 35d0cdbeba638b20e36ab96e934cae8eca24ce0c (patch) | |
tree | adf5e453a9b705c5f9035b37dfaac678662f2280 /include/linux | |
parent | cff6de372325c373cd041b3b28193b5320115211 (diff) | |
download | barebox-35d0cdbeba638b20e36ab96e934cae8eca24ce0c.tar.gz barebox-35d0cdbeba638b20e36ab96e934cae8eca24ce0c.tar.xz |
mfd: axp20x: remove dependency on regmap.h
axp20x_read_variable_width() is not used in barebox and
struct regmap and struct regmap_config could just be forward-declared
avoiding the need to include regmap.h. Thus drop the function and
forward declare. Should the function be needed in future, it can be
added back.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20231020071853.2826528-7-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mfd/axp20x.h | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index b406c019e4..93d303c459 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h @@ -8,7 +8,6 @@ #ifndef __LINUX_MFD_AXP20X_H #define __LINUX_MFD_AXP20X_H -#include <regmap.h> #include <poweroff.h> enum axp20x_variants { @@ -448,6 +447,9 @@ enum { AXP813_REG_ID_MAX, }; +struct regmap; +struct regmap_config; + struct axp20x_dev { struct device *dev; struct regmap *regmap; @@ -458,28 +460,6 @@ struct axp20x_dev { struct poweroff_handler poweroff; }; -/* generic helper function for reading 9-16 bit wide regs */ -static inline int axp20x_read_variable_width(struct regmap *regmap, - unsigned int reg, unsigned int width) -{ - unsigned int reg_val, result; - int err; - - err = regmap_read(regmap, reg, ®_val); - if (err) - return err; - - result = reg_val << (width - 8); - - err = regmap_read(regmap, reg + 1, ®_val); - if (err) - return err; - - result |= reg_val; - - return result; -} - /** * axp20x_match_device(): Setup axp20x variant related fields * |