summaryrefslogtreecommitdiff
path: root/drivers/power/pmic/stpmic1.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2019-02-04 13:26:17 +0300
committerPatrick Delaunay <patrick.delaunay@st.com>2019-04-12 17:09:13 +0300
commit42f01aacfd508ddaab5fbc21dd1d3c04dcf61990 (patch)
tree801b63d1531d916cc5bc56eb86d85bf1d55716a3 /drivers/power/pmic/stpmic1.c
parentd46c22b3fdb58623f1bf372d028313a5d3e7b79b (diff)
downloadu-boot-42f01aacfd508ddaab5fbc21dd1d3c04dcf61990.tar.xz
power: rename stpmu1 to official name stpmic1
Alignment with kernel driver name & binding introduced by https://patchwork.kernel.org/cover/10761943/ to use the final marketing name = STPMIC1. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'drivers/power/pmic/stpmic1.c')
-rw-r--r--drivers/power/pmic/stpmic1.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/drivers/power/pmic/stpmic1.c b/drivers/power/pmic/stpmic1.c
index 157ce8bfb6..25450ebd42 100644
--- a/drivers/power/pmic/stpmic1.c
+++ b/drivers/power/pmic/stpmic1.c
@@ -10,26 +10,26 @@
#include <power/pmic.h>
#include <power/stpmic1.h>
-#define STMPU1_NUM_OF_REGS 0x100
-
-#ifndef CONFIG_SPL_BUILD
-static const struct pmic_child_info stpmu1_children_info[] = {
- { .prefix = "ldo", .driver = "stpmu1_ldo" },
- { .prefix = "buck", .driver = "stpmu1_buck" },
- { .prefix = "vref_ddr", .driver = "stpmu1_vref_ddr" },
- { .prefix = "pwr_sw", .driver = "stpmu1_pwr_sw" },
- { .prefix = "boost", .driver = "stpmu1_boost" },
+#define STPMIC1_NUM_OF_REGS 0x100
+
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
+static const struct pmic_child_info stpmic1_children_info[] = {
+ { .prefix = "ldo", .driver = "stpmic1_ldo" },
+ { .prefix = "buck", .driver = "stpmic1_buck" },
+ { .prefix = "vref_ddr", .driver = "stpmic1_vref_ddr" },
+ { .prefix = "pwr_sw", .driver = "stpmic1_pwr_sw" },
+ { .prefix = "boost", .driver = "stpmic1_boost" },
{ },
};
-#endif /* CONFIG_SPL_BUILD */
+#endif /* DM_REGULATOR */
-static int stpmu1_reg_count(struct udevice *dev)
+static int stpmic1_reg_count(struct udevice *dev)
{
- return STMPU1_NUM_OF_REGS;
+ return STPMIC1_NUM_OF_REGS;
}
-static int stpmu1_write(struct udevice *dev, uint reg, const uint8_t *buff,
- int len)
+static int stpmic1_write(struct udevice *dev, uint reg, const uint8_t *buff,
+ int len)
{
int ret;
@@ -41,7 +41,7 @@ static int stpmu1_write(struct udevice *dev, uint reg, const uint8_t *buff,
return ret;
}
-static int stpmu1_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
+static int stpmic1_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
{
int ret;
@@ -53,43 +53,43 @@ static int stpmu1_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
return ret;
}
-static int stpmu1_bind(struct udevice *dev)
+static int stpmic1_bind(struct udevice *dev)
{
-#ifndef CONFIG_SPL_BUILD
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
ofnode regulators_node;
int children;
regulators_node = dev_read_subnode(dev, "regulators");
if (!ofnode_valid(regulators_node)) {
- dev_dbg(dev, "regulators subnode not found!\n");
+ dev_dbg(dev, "regulators subnode not found!");
return -ENXIO;
}
dev_dbg(dev, "found regulators subnode\n");
children = pmic_bind_children(dev, regulators_node,
- stpmu1_children_info);
+ stpmic1_children_info);
if (!children)
dev_dbg(dev, "no child found\n");
-#endif /* CONFIG_SPL_BUILD */
+#endif /* DM_REGULATOR */
return 0;
}
-static struct dm_pmic_ops stpmu1_ops = {
- .reg_count = stpmu1_reg_count,
- .read = stpmu1_read,
- .write = stpmu1_write,
+static struct dm_pmic_ops stpmic1_ops = {
+ .reg_count = stpmic1_reg_count,
+ .read = stpmic1_read,
+ .write = stpmic1_write,
};
-static const struct udevice_id stpmu1_ids[] = {
- { .compatible = "st,stpmu1" },
+static const struct udevice_id stpmic1_ids[] = {
+ { .compatible = "st,stpmic1" },
{ }
};
-U_BOOT_DRIVER(pmic_stpmu1) = {
- .name = "stpmu1_pmic",
+U_BOOT_DRIVER(pmic_stpmic1) = {
+ .name = "stpmic1_pmic",
.id = UCLASS_PMIC,
- .of_match = stpmu1_ids,
- .bind = stpmu1_bind,
- .ops = &stpmu1_ops,
+ .of_match = stpmic1_ids,
+ .bind = stpmic1_bind,
+ .ops = &stpmic1_ops,
};