1
2
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
10enum rohm_chip_type {
11 ROHM_CHIP_TYPE_BD71837 = 0,
12 ROHM_CHIP_TYPE_BD71847,
13 ROHM_CHIP_TYPE_BD70528,
14 ROHM_CHIP_TYPE_BD71828,
15 ROHM_CHIP_TYPE_AMOUNT
16};
17
18struct rohm_regmap_dev {
19 struct device *dev;
20 struct regmap *regmap;
21};
22
23enum {
24 ROHM_DVS_LEVEL_UNKNOWN,
25 ROHM_DVS_LEVEL_RUN,
26 ROHM_DVS_LEVEL_IDLE,
27 ROHM_DVS_LEVEL_SUSPEND,
28 ROHM_DVS_LEVEL_LPSR,
29 ROHM_DVS_LEVEL_MAX = ROHM_DVS_LEVEL_LPSR,
30};
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54struct rohm_dvs_config {
55 uint64_t level_map;
56 unsigned int run_reg;
57 unsigned int run_mask;
58 unsigned int run_on_mask;
59 unsigned int idle_reg;
60 unsigned int idle_mask;
61 unsigned int idle_on_mask;
62 unsigned int suspend_reg;
63 unsigned int suspend_mask;
64 unsigned int suspend_on_mask;
65 unsigned int lpsr_reg;
66 unsigned int lpsr_mask;
67 unsigned int lpsr_on_mask;
68};
69
70#if IS_ENABLED(CONFIG_REGULATOR_ROHM)
71int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs,
72 struct device_node *np,
73 const struct regulator_desc *desc,
74 struct regmap *regmap);
75
76#else
77static inline int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs,
78 struct device_node *np,
79 const struct regulator_desc *desc,
80 struct regmap *regmap)
81{
82 return 0;
83}
84#endif
85
86#endif
87