forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 072de836f53be56a70cecf70b43ae43b7ce17376
kernel/drivers/regulator/uniphier-regulator.c
....@@ -32,7 +32,7 @@
3232 const struct uniphier_regulator_soc_data *data;
3333 };
3434
35
-static struct regulator_ops uniphier_regulator_ops = {
35
+static const struct regulator_ops uniphier_regulator_ops = {
3636 .enable = regulator_enable_regmap,
3737 .disable = regulator_disable_regmap,
3838 .is_enabled = regulator_is_enabled_regmap,
....@@ -45,7 +45,6 @@
4545 struct regulator_config config = { };
4646 struct regulator_dev *rdev;
4747 struct regmap *regmap;
48
- struct resource *res;
4948 void __iomem *base;
5049 const char *name;
5150 int i, ret, nr;
....@@ -58,8 +57,7 @@
5857 if (WARN_ON(!priv->data))
5958 return -EINVAL;
6059
61
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
62
- base = devm_ioremap_resource(dev, res);
60
+ base = devm_platform_ioremap_resource(pdev, 0);
6361 if (IS_ERR(base))
6462 return PTR_ERR(base);
6563
....@@ -87,8 +85,10 @@
8785 }
8886
8987 regmap = devm_regmap_init_mmio(dev, base, priv->data->regconf);
90
- if (IS_ERR(regmap))
91
- return PTR_ERR(regmap);
88
+ if (IS_ERR(regmap)) {
89
+ ret = PTR_ERR(regmap);
90
+ goto out_rst_assert;
91
+ }
9292
9393 config.dev = dev;
9494 config.driver_data = priv;
....@@ -184,6 +184,10 @@
184184 .data = &uniphier_pro4_usb3_data,
185185 },
186186 {
187
+ .compatible = "socionext,uniphier-pro5-usb3-regulator",
188
+ .data = &uniphier_pro4_usb3_data,
189
+ },
190
+ {
187191 .compatible = "socionext,uniphier-pxs2-usb3-regulator",
188192 .data = &uniphier_pxs2_usb3_data,
189193 },