1 /* SPDX-License-Identifier: GPL-2.0-or-later * 1 2 /* Copyright (C) 2018 ROHM Semiconductors */ 3 4 #ifndef __LINUX_MFD_ROHM_H__ 5 #define __LINUX_MFD_ROHM_H__ 6 7 #include <linux/regmap.h> 8 #include <linux/regulator/driver.h> 9 10 enum rohm_chip_type { 11 ROHM_CHIP_TYPE_BD9571, 12 ROHM_CHIP_TYPE_BD9573, 13 ROHM_CHIP_TYPE_BD9574, 14 ROHM_CHIP_TYPE_BD9576, 15 ROHM_CHIP_TYPE_BD71815, 16 ROHM_CHIP_TYPE_BD71828, 17 ROHM_CHIP_TYPE_BD71837, 18 ROHM_CHIP_TYPE_BD71847, 19 ROHM_CHIP_TYPE_BD96801, 20 ROHM_CHIP_TYPE_AMOUNT 21 }; 22 23 struct rohm_regmap_dev { 24 struct device *dev; 25 struct regmap *regmap; 26 }; 27 28 #define ROHM_DVS_LEVEL_RUN BIT(0) 29 #define ROHM_DVS_LEVEL_IDLE BIT(1) 30 #define ROHM_DVS_LEVEL_SUSPEND BIT(2) 31 #define ROHM_DVS_LEVEL_LPSR BIT(3) 32 #define ROHM_DVS_LEVEL_SNVS BIT(4) 33 #define ROHM_DVS_LEVEL_VALID_AMOUNT 5 34 #define ROHM_DVS_LEVEL_UNKNOWN 0 35 36 /** 37 * struct rohm_dvs_config - dynamic voltage sc 38 * 39 * @level_map: bitmap representing su 40 * regulator 41 * @run_reg: register address for r 42 * @run_mask: value mask for regulat 43 * @run_on_mask: enable mask for regula 44 * @idle_reg: register address for r 45 * @idle_mask: value mask for regulat 46 * @idle_on_mask: enable mask for regula 47 * @suspend_reg: register address for r 48 * @suspend_mask: value mask for regulat 49 * @suspend_on_mask: enable mask for regula 50 * @lpsr_reg: register address for r 51 * @lpsr_mask: value mask for regulat 52 * @lpsr_on_mask: enable mask for regula 53 * 54 * Description of ROHM PMICs voltage configura 55 * system states. This is used to correctly co 56 * based on values read from DT. 57 */ 58 struct rohm_dvs_config { 59 uint64_t level_map; 60 unsigned int run_reg; 61 unsigned int run_mask; 62 unsigned int run_on_mask; 63 unsigned int idle_reg; 64 unsigned int idle_mask; 65 unsigned int idle_on_mask; 66 unsigned int suspend_reg; 67 unsigned int suspend_mask; 68 unsigned int suspend_on_mask; 69 unsigned int lpsr_reg; 70 unsigned int lpsr_mask; 71 unsigned int lpsr_on_mask; 72 unsigned int snvs_reg; 73 unsigned int snvs_mask; 74 unsigned int snvs_on_mask; 75 }; 76 77 #if IS_ENABLED(CONFIG_REGULATOR_ROHM) 78 int rohm_regulator_set_dvs_levels(const struct 79 struct devic 80 const struct 81 struct regma 82 83 int rohm_regulator_set_voltage_sel_restricted( 84 85 #endif 86 87 #endif 88
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.