/* SPDX-License-Identifier: GPL-2.0-or-later */ /* Copyright (C) 2018 ROHM Semiconductors */ #ifndef __LINUX_MFD_ROHM_H__ #define __LINUX_MFD_ROHM_H__ #include <linux/regmap.h> #include <linux/regulator/driver.h> enum rohm_chip_type { … }; struct rohm_regmap_dev { … }; #define ROHM_DVS_LEVEL_RUN … #define ROHM_DVS_LEVEL_IDLE … #define ROHM_DVS_LEVEL_SUSPEND … #define ROHM_DVS_LEVEL_LPSR … #define ROHM_DVS_LEVEL_SNVS … #define ROHM_DVS_LEVEL_VALID_AMOUNT … #define ROHM_DVS_LEVEL_UNKNOWN … /** * struct rohm_dvs_config - dynamic voltage scaling register descriptions * * @level_map: bitmap representing supported run-levels for this * regulator * @run_reg: register address for regulator config at 'run' state * @run_mask: value mask for regulator voltages at 'run' state * @run_on_mask: enable mask for regulator at 'run' state * @idle_reg: register address for regulator config at 'idle' state * @idle_mask: value mask for regulator voltages at 'idle' state * @idle_on_mask: enable mask for regulator at 'idle' state * @suspend_reg: register address for regulator config at 'suspend' state * @suspend_mask: value mask for regulator voltages at 'suspend' state * @suspend_on_mask: enable mask for regulator at 'suspend' state * @lpsr_reg: register address for regulator config at 'lpsr' state * @lpsr_mask: value mask for regulator voltages at 'lpsr' state * @lpsr_on_mask: enable mask for regulator at 'lpsr' state * * Description of ROHM PMICs voltage configuration registers for different * system states. This is used to correctly configure the PMIC at startup * based on values read from DT. */ struct rohm_dvs_config { … }; #if IS_ENABLED(CONFIG_REGULATOR_ROHM) int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs, struct device_node *np, const struct regulator_desc *desc, struct regmap *regmap); int rohm_regulator_set_voltage_sel_restricted(struct regulator_dev *rdev, unsigned int sel); #endif #endif