• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版67b5663d771121b3d606fc3346dc83024618448b (tree)
时间2022-07-27 13:04:34
作者Heiko Thiery <heiko.thiery@gmai...>
CommiterJaehoon Chung

Log Message

pmic: pca9450: permit config on all bucks and LDOs

In order to have the possibility to configure the regulators at system
startup through DM support, all LDOs and bucks must be able to be
changeable. Currently there is a limitation to change the values when
the output is enabled. Since the driver is based on the ROHM BD71837 and a
comment that describes a limitation about switching while the output is
enabled can also be found there, the limitation probably comes from this type.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>

更改概述

差异

--- a/drivers/power/regulator/pca9450.c
+++ b/drivers/power/regulator/pca9450.c
@@ -44,7 +44,6 @@ struct pca9450_vrange {
4444 * @ranges: pointer to ranges of regulator voltages and matching register
4545 * values
4646 * @numranges: number of voltage ranges pointed by ranges
47- * @dvs: whether the voltage can be changed when regulator is enabled
4847 */
4948 struct pca9450_plat {
5049 const char *name;
@@ -54,7 +53,6 @@ struct pca9450_plat {
5453 u8 volt_mask;
5554 struct pca9450_vrange *ranges;
5655 unsigned int numranges;
57- bool dvs;
5856 };
5957
6058 #define PCA_RANGE(_min, _vstep, _sel_low, _sel_hi) \
@@ -63,11 +61,11 @@ struct pca9450_plat {
6361 .min_sel = (_sel_low), .max_sel = (_sel_hi), \
6462 }
6563
66-#define PCA_DATA(_name, enreg, enmask, vreg, vmask, _range, _dvs) \
64+#define PCA_DATA(_name, enreg, enmask, vreg, vmask, _range) \
6765 { \
6866 .name = (_name), .enable_reg = (enreg), .enablemask = (enmask), \
6967 .volt_reg = (vreg), .volt_mask = (vmask), .ranges = (_range), \
70- .numranges = ARRAY_SIZE(_range), .dvs = (_dvs), \
68+ .numranges = ARRAY_SIZE(_range) \
7169 }
7270
7371 static struct pca9450_vrange pca9450_buck123_vranges[] = {
@@ -107,39 +105,39 @@ static struct pca9450_plat pca9450_reg_data[] = {
107105 /* Bucks 1-3 which support dynamic voltage scaling */
108106 PCA_DATA("BUCK1", PCA9450_BUCK1CTRL, HW_STATE_CONTROL,
109107 PCA9450_BUCK1OUT_DVS0, PCA9450_DVS_BUCK_RUN_MASK,
110- pca9450_buck123_vranges, true),
108+ pca9450_buck123_vranges),
111109 PCA_DATA("BUCK2", PCA9450_BUCK2CTRL, HW_STATE_CONTROL,
112110 PCA9450_BUCK2OUT_DVS0, PCA9450_DVS_BUCK_RUN_MASK,
113- pca9450_buck123_vranges, true),
111+ pca9450_buck123_vranges),
114112 PCA_DATA("BUCK3", PCA9450_BUCK3CTRL, HW_STATE_CONTROL,
115113 PCA9450_BUCK3OUT_DVS0, PCA9450_DVS_BUCK_RUN_MASK,
116- pca9450_buck123_vranges, true),
114+ pca9450_buck123_vranges),
117115 /* Bucks 4-6 which do not support dynamic voltage scaling */
118116 PCA_DATA("BUCK4", PCA9450_BUCK4CTRL, HW_STATE_CONTROL,
119117 PCA9450_BUCK4OUT, PCA9450_DVS_BUCK_RUN_MASK,
120- pca9450_buck456_vranges, false),
118+ pca9450_buck456_vranges),
121119 PCA_DATA("BUCK5", PCA9450_BUCK5CTRL, HW_STATE_CONTROL,
122120 PCA9450_BUCK5OUT, PCA9450_DVS_BUCK_RUN_MASK,
123- pca9450_buck456_vranges, false),
121+ pca9450_buck456_vranges),
124122 PCA_DATA("BUCK6", PCA9450_BUCK6CTRL, HW_STATE_CONTROL,
125123 PCA9450_BUCK6OUT, PCA9450_DVS_BUCK_RUN_MASK,
126- pca9450_buck456_vranges, false),
124+ pca9450_buck456_vranges),
127125 /* LDOs */
128126 PCA_DATA("LDO1", PCA9450_LDO1CTRL, HW_STATE_CONTROL,
129127 PCA9450_LDO1CTRL, PCA9450_LDO12_MASK,
130- pca9450_ldo1_vranges, false),
128+ pca9450_ldo1_vranges),
131129 PCA_DATA("LDO2", PCA9450_LDO2CTRL, HW_STATE_CONTROL,
132130 PCA9450_LDO2CTRL, PCA9450_LDO12_MASK,
133- pca9450_ldo2_vranges, false),
131+ pca9450_ldo2_vranges),
134132 PCA_DATA("LDO3", PCA9450_LDO3CTRL, HW_STATE_CONTROL,
135133 PCA9450_LDO3CTRL, PCA9450_LDO34_MASK,
136- pca9450_ldo34_vranges, false),
134+ pca9450_ldo34_vranges),
137135 PCA_DATA("LDO4", PCA9450_LDO4CTRL, HW_STATE_CONTROL,
138136 PCA9450_LDO4CTRL, PCA9450_LDO34_MASK,
139- pca9450_ldo34_vranges, false),
137+ pca9450_ldo34_vranges),
140138 PCA_DATA("LDO5", PCA9450_LDO5CTRL_H, HW_STATE_CONTROL,
141139 PCA9450_LDO5CTRL_H, PCA9450_LDO5_MASK,
142- pca9450_ldo5_vranges, false),
140+ pca9450_ldo5_vranges),
143141 };
144142
145143 static int vrange_find_value(struct pca9450_vrange *r, unsigned int sel,
@@ -246,20 +244,6 @@ static int pca9450_set_value(struct udevice *dev, int uvolt)
246244 unsigned int sel;
247245 int i, found = 0;
248246
249- /*
250- * An under/overshooting may occur if voltage is changed for other
251- * regulators but buck 1,2,3 or 4 when regulator is enabled. Prevent
252- * change to protect the HW
253- */
254- if (!plat->dvs)
255- if (pca9450_get_enable(dev)) {
256- /* If the value is already set, skip the warning. */
257- if (pca9450_get_value(dev) == uvolt)
258- return 0;
259- pr_err("Only DVS bucks can be changed when enabled\n");
260- return -EINVAL;
261- }
262-
263247 for (i = 0; i < plat->numranges; i++) {
264248 struct pca9450_vrange *r = &plat->ranges[i];
265249