summaryrefslogtreecommitdiff
path: root/drivers/power/regulator
diff options
context:
space:
mode:
authorWadim Egorov <w.egorov@phytec.de>2017-06-19 10:36:38 (GMT)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-07-11 13:23:37 (GMT)
commit8926c2f5841148ba0f1b67bb71314797e45229c2 (patch)
treec953b8a2bbb850f73bb3038e9940862e438d291b /drivers/power/regulator
parentf6f47c2ee103094f31fc6f5fb94bfb73de028de0 (diff)
downloadu-boot-fsl-qoriq-8926c2f5841148ba0f1b67bb71314797e45229c2.tar.xz
power: regulator: rk8xx: Build get_ldo_reg only for SPL
Enabling CONFIG_SPL_POWER_SUPPORT will cause a compiler warning: ‘get_ldo_reg’ defined but not used [-Wunused-function] Let's wrap get_ldo_reg(), rk808_ldo and rk818_ldo with ENABLE_DRIVER which is only set for non SPL builds. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'drivers/power/regulator')
-rw-r--r--drivers/power/regulator/rk8xx.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c
index c1ece96..d96a1f8 100644
--- a/drivers/power/regulator/rk8xx.c
+++ b/drivers/power/regulator/rk8xx.c
@@ -45,6 +45,14 @@ static const struct rk8xx_reg_info rk808_buck[] = {
{ 1800000, 100000, REG_BUCK4_ON_VSEL, RK808_BUCK4_VSEL_MASK, },
};
+static const struct rk8xx_reg_info rk818_buck[] = {
+ { 712500, 12500, REG_BUCK1_ON_VSEL, RK818_BUCK_VSEL_MASK, },
+ { 712500, 12500, REG_BUCK2_ON_VSEL, RK818_BUCK_VSEL_MASK, },
+ { 712500, 12500, -1, RK818_BUCK_VSEL_MASK, },
+ { 1800000, 100000, REG_BUCK4_ON_VSEL, RK818_BUCK4_VSEL_MASK, },
+};
+
+#ifdef ENABLE_DRIVER
static const struct rk8xx_reg_info rk808_ldo[] = {
{ 1800000, 100000, REG_LDO1_ON_VSEL, RK808_LDO_VSEL_MASK, },
{ 1800000, 100000, REG_LDO2_ON_VSEL, RK808_LDO_VSEL_MASK, },
@@ -56,13 +64,6 @@ static const struct rk8xx_reg_info rk808_ldo[] = {
{ 1800000, 100000, REG_LDO8_ON_VSEL, RK808_LDO_VSEL_MASK, },
};
-static const struct rk8xx_reg_info rk818_buck[] = {
- { 712500, 12500, REG_BUCK1_ON_VSEL, RK818_BUCK_VSEL_MASK, },
- { 712500, 12500, REG_BUCK2_ON_VSEL, RK818_BUCK_VSEL_MASK, },
- { 712500, 12500, -1, RK818_BUCK_VSEL_MASK, },
- { 1800000, 100000, REG_BUCK4_ON_VSEL, RK818_BUCK4_VSEL_MASK, },
-};
-
static const struct rk8xx_reg_info rk818_ldo[] = {
{ 1800000, 100000, REG_LDO1_ON_VSEL, RK818_LDO_VSEL_MASK, },
{ 1800000, 100000, REG_LDO2_ON_VSEL, RK818_LDO_VSEL_MASK, },
@@ -73,6 +74,7 @@ static const struct rk8xx_reg_info rk818_ldo[] = {
{ 800000, 100000, REG_LDO7_ON_VSEL, RK818_LDO_VSEL_MASK, },
{ 1800000, 100000, REG_LDO8_ON_VSEL, RK818_LDO_VSEL_MASK, },
};
+#endif
static const struct rk8xx_reg_info *get_buck_reg(struct udevice *pmic,
int num)
@@ -86,18 +88,6 @@ static const struct rk8xx_reg_info *get_buck_reg(struct udevice *pmic,
}
}
-static const struct rk8xx_reg_info *get_ldo_reg(struct udevice *pmic,
- int num)
-{
- struct rk8xx_priv *priv = dev_get_priv(pmic);
- switch (priv->variant) {
- case RK818_ID:
- return &rk818_ldo[num];
- default:
- return &rk808_ldo[num];
- }
-}
-
static int _buck_set_value(struct udevice *pmic, int buck, int uvolt)
{
const struct rk8xx_reg_info *info = get_buck_reg(pmic, buck - 1);
@@ -133,6 +123,18 @@ static int _buck_set_enable(struct udevice *pmic, int buck, bool enable)
}
#ifdef ENABLE_DRIVER
+static const struct rk8xx_reg_info *get_ldo_reg(struct udevice *pmic,
+ int num)
+{
+ struct rk8xx_priv *priv = dev_get_priv(pmic);
+ switch (priv->variant) {
+ case RK818_ID:
+ return &rk818_ldo[num];
+ default:
+ return &rk808_ldo[num];
+ }
+}
+
static int buck_get_value(struct udevice *dev)
{
int buck = dev->driver_data - 1;