On Fri, 17 Jan 2020, Matti Vaittinen wrote: > Few ROHM PMICs allow setting the voltage states for different system states > like RUN, IDLE, SUSPEND and LPSR. States are then changed via SoC specific > mechanisms. bd718x7 driver implemented device-tree parsing functions for > these state specific voltages. The parsing functions can be re-used by > other ROHM chip drivers like bd71828. Split the generic functions from > bd718x7-regulator.c to rohm-regulator.c and export them for other modules > to use. > > Signed-off-by: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx> > Acked-by: Mark Brown <broonie@xxxxxxxxxx> > --- > no changes since v9 > > drivers/regulator/Kconfig | 4 + > drivers/regulator/Makefile | 1 + > drivers/regulator/bd718x7-regulator.c | 183 ++++++++------------------ > drivers/regulator/rohm-regulator.c | 95 +++++++++++++ > include/linux/mfd/rohm-generic.h | 66 ++++++++++ > 5 files changed, 221 insertions(+), 128 deletions(-) > create mode 100644 drivers/regulator/rohm-regulator.c [...] > diff --git a/include/linux/mfd/rohm-generic.h b/include/linux/mfd/rohm-generic.h > index ff3dd7578fd3..6cc5a0819959 100644 > --- a/include/linux/mfd/rohm-generic.h > +++ b/include/linux/mfd/rohm-generic.h > @@ -4,6 +4,9 @@ > #ifndef __LINUX_MFD_ROHM_H__ > #define __LINUX_MFD_ROHM_H__ > > +#include <linux/regmap.h> > +#include <linux/regulator/driver.h> > + > enum rohm_chip_type { > ROHM_CHIP_TYPE_BD71837 = 0, > ROHM_CHIP_TYPE_BD71847, > @@ -17,4 +20,67 @@ struct rohm_regmap_dev { > struct regmap *regmap; > }; > > +enum { > + ROHM_DVS_LEVEL_UNKNOWN, > + ROHM_DVS_LEVEL_RUN, > + ROHM_DVS_LEVEL_IDLE, > + ROHM_DVS_LEVEL_SUSPEND, > + ROHM_DVS_LEVEL_LPSR, > +#define ROHM_DVS_LEVEL_MAX ROHM_DVS_LEVEL_LPSR Haven't seen this before. Is it legit? What about: ROHM_DVS_LEVEL_MAX = ROHM_DVS_LEVEL_LPSR -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog