power: rk808: rename to rk8xx

Since this driver can be used for rk8xx series pmic,
let's rename rk808 to rk8xx, to make it clear.

Configs parts are done by sed -i "s/RK808/RK8XX/g" `grep RK808 -lr ./`

Signed-off-by: Jacob Chen <jacob-chen@iotwrt.com>
diff --git a/drivers/power/regulator/Kconfig b/drivers/power/regulator/Kconfig
index f870e8b..ef057e0 100644
--- a/drivers/power/regulator/Kconfig
+++ b/drivers/power/regulator/Kconfig
@@ -76,11 +76,11 @@
 	features for gpio regulators. The driver implements get/set for
 	voltage value.
 
-config REGULATOR_RK808
-	bool "Enable driver for RK808 regulators"
-	depends on DM_REGULATOR && PMIC_RK808
+config REGULATOR_RK8XX
+	bool "Enable driver for RK8XX regulators"
+	depends on DM_REGULATOR && PMIC_RK8XX
 	---help---
-	Enable support for the regulator functions of the RK808 PMIC. The
+	Enable support for the regulator functions of the RK8XX PMIC. The
 	driver implements get/set api for the various BUCKS and LDOs supported
 	by the PMIC device. This driver is controlled by a device tree node
 	which includes voltage limits.
diff --git a/drivers/power/regulator/Makefile b/drivers/power/regulator/Makefile
index 6002c88..3e01021 100644
--- a/drivers/power/regulator/Makefile
+++ b/drivers/power/regulator/Makefile
@@ -12,7 +12,7 @@
 obj-$(CONFIG_REGULATOR_PWM) += pwm_regulator.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_FIXED) += fixed.o
 obj-$(CONFIG_$(SPL_)DM_REGULATOR_GPIO) += gpio-regulator.o
-obj-$(CONFIG_REGULATOR_RK808) += rk808.o
+obj-$(CONFIG_REGULATOR_RK8XX) += rk8xx.o
 obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
 obj-$(CONFIG_DM_REGULATOR_SANDBOX) += sandbox.o
 obj-$(CONFIG_REGULATOR_TPS65090) += tps65090_regulator.o
diff --git a/drivers/power/regulator/rk808.c b/drivers/power/regulator/rk8xx.c
similarity index 81%
rename from drivers/power/regulator/rk808.c
rename to drivers/power/regulator/rk8xx.c
index 1ffe9dc..e655c2d 100644
--- a/drivers/power/regulator/rk808.c
+++ b/drivers/power/regulator/rk8xx.c
@@ -12,7 +12,7 @@
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
-#include <power/rk808_pmic.h>
+#include <power/rk8xx_pmic.h>
 #include <power/pmic.h>
 #include <power/regulator.h>
 
@@ -31,21 +31,21 @@
 #define RK818_LDO3_ON_VSEL_MASK	0xf
 #define RK818_BOOST_ON_VSEL_MASK	0xe0
 
-struct rk808_reg_info {
+struct rk8xx_reg_info {
 	uint min_uv;
 	uint step_uv;
 	s8 vsel_reg;
 	u8 vsel_mask;
 };
 
-static const struct rk808_reg_info rk808_buck[] = {
+static const struct rk8xx_reg_info rk808_buck[] = {
 	{ 712500, 12500, REG_BUCK1_ON_VSEL, RK808_BUCK_VSEL_MASK, },
 	{ 712500, 12500, REG_BUCK2_ON_VSEL, RK808_BUCK_VSEL_MASK, },
 	{ 712500, 12500, -1, RK808_BUCK_VSEL_MASK, },
 	{ 1800000, 100000, REG_BUCK4_ON_VSEL, RK808_BUCK4_VSEL_MASK, },
 };
 
-static const struct rk808_reg_info rk808_ldo[] = {
+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, },
 	{ 800000, 100000, REG_LDO3_ON_VSEL, RK808_BUCK4_VSEL_MASK, },
@@ -56,14 +56,14 @@
 	{ 1800000, 100000, REG_LDO8_ON_VSEL, RK808_LDO_VSEL_MASK, },
 };
 
-static const struct rk808_reg_info rk818_buck[] = {
+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 rk808_reg_info rk818_ldo[] = {
+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, },
 	{ 800000, 100000, REG_LDO3_ON_VSEL, RK818_LDO3_ON_VSEL_MASK, },
@@ -74,11 +74,11 @@
 	{ 1800000, 100000, REG_LDO8_ON_VSEL, RK818_LDO_VSEL_MASK, },
 };
 
-static const struct rk808_reg_info *get_buck_reg(struct udevice *pmic,
+static const struct rk8xx_reg_info *get_buck_reg(struct udevice *pmic,
 					     int num)
 {
-	struct rk808_priv *rk808 = dev_get_priv(pmic);
-	switch (rk808->variant) {
+	struct rk8xx_priv *priv = dev_get_priv(pmic);
+	switch (priv->variant) {
 	case RK818_ID:
 		return &rk818_buck[num];
 	default:
@@ -86,11 +86,11 @@
 	}
 }
 
-static const struct rk808_reg_info *get_ldo_reg(struct udevice *pmic,
+static const struct rk8xx_reg_info *get_ldo_reg(struct udevice *pmic,
 					     int num)
 {
-	struct rk808_priv *rk808 = dev_get_priv(pmic);
-	switch (rk808->variant) {
+	struct rk8xx_priv *priv = dev_get_priv(pmic);
+	switch (priv->variant) {
 	case RK818_ID:
 		return &rk818_ldo[num - 1];
 	default:
@@ -100,7 +100,7 @@
 
 static int _buck_set_value(struct udevice *pmic, int buck, int uvolt)
 {
-	const struct rk808_reg_info *info = get_buck_reg(pmic, buck - 1);
+	const struct rk8xx_reg_info *info = get_buck_reg(pmic, buck - 1);
 	int mask = info->vsel_mask;
 	int val;
 
@@ -136,7 +136,7 @@
 static int buck_get_value(struct udevice *dev)
 {
 	int buck = dev->driver_data - 1;
-	const struct rk808_reg_info *info = get_buck_reg(dev->parent, buck);
+	const struct rk8xx_reg_info *info = get_buck_reg(dev->parent, buck);
 	int mask = info->vsel_mask;
 	int ret, val;
 
@@ -182,7 +182,7 @@
 static int ldo_get_value(struct udevice *dev)
 {
 	int ldo = dev->driver_data - 1;
-	const struct rk808_reg_info *info = get_ldo_reg(dev->parent, ldo);
+	const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo);
 	int mask = info->vsel_mask;
 	int ret, val;
 
@@ -199,7 +199,7 @@
 static int ldo_set_value(struct udevice *dev, int uvolt)
 {
 	int ldo = dev->driver_data - 1;
-	const struct rk808_reg_info *info = get_ldo_reg(dev->parent, ldo);
+	const struct rk8xx_reg_info *info = get_ldo_reg(dev->parent, ldo);
 	int mask = info->vsel_mask;
 	int val;
 
@@ -264,7 +264,7 @@
 	return ret & mask ? true : false;
 }
 
-static int rk808_buck_probe(struct udevice *dev)
+static int rk8xx_buck_probe(struct udevice *dev)
 {
 	struct dm_regulator_uclass_platdata *uc_pdata;
 
@@ -276,7 +276,7 @@
 	return 0;
 }
 
-static int rk808_ldo_probe(struct udevice *dev)
+static int rk8xx_ldo_probe(struct udevice *dev)
 {
 	struct dm_regulator_uclass_platdata *uc_pdata;
 
@@ -288,7 +288,7 @@
 	return 0;
 }
 
-static int rk808_switch_probe(struct udevice *dev)
+static int rk8xx_switch_probe(struct udevice *dev)
 {
 	struct dm_regulator_uclass_platdata *uc_pdata;
 
@@ -300,48 +300,48 @@
 	return 0;
 }
 
-static const struct dm_regulator_ops rk808_buck_ops = {
+static const struct dm_regulator_ops rk8xx_buck_ops = {
 	.get_value  = buck_get_value,
 	.set_value  = buck_set_value,
 	.get_enable = buck_get_enable,
 	.set_enable = buck_set_enable,
 };
 
-static const struct dm_regulator_ops rk808_ldo_ops = {
+static const struct dm_regulator_ops rk8xx_ldo_ops = {
 	.get_value  = ldo_get_value,
 	.set_value  = ldo_set_value,
 	.get_enable = ldo_get_enable,
 	.set_enable = ldo_set_enable,
 };
 
-static const struct dm_regulator_ops rk808_switch_ops = {
+static const struct dm_regulator_ops rk8xx_switch_ops = {
 	.get_enable = switch_get_enable,
 	.set_enable = switch_set_enable,
 };
 
-U_BOOT_DRIVER(rk808_buck) = {
-	.name = "rk808_buck",
+U_BOOT_DRIVER(rk8xx_buck) = {
+	.name = "rk8xx_buck",
 	.id = UCLASS_REGULATOR,
-	.ops = &rk808_buck_ops,
-	.probe = rk808_buck_probe,
+	.ops = &rk8xx_buck_ops,
+	.probe = rk8xx_buck_probe,
 };
 
-U_BOOT_DRIVER(rk808_ldo) = {
-	.name = "rk808_ldo",
+U_BOOT_DRIVER(rk8xx_ldo) = {
+	.name = "rk8xx_ldo",
 	.id = UCLASS_REGULATOR,
-	.ops = &rk808_ldo_ops,
-	.probe = rk808_ldo_probe,
+	.ops = &rk8xx_ldo_ops,
+	.probe = rk8xx_ldo_probe,
 };
 
-U_BOOT_DRIVER(rk808_switch) = {
-	.name = "rk808_switch",
+U_BOOT_DRIVER(rk8xx_switch) = {
+	.name = "rk8xx_switch",
 	.id = UCLASS_REGULATOR,
-	.ops = &rk808_switch_ops,
-	.probe = rk808_switch_probe,
+	.ops = &rk8xx_switch_ops,
+	.probe = rk8xx_switch_probe,
 };
 #endif
 
-int rk808_spl_configure_buck(struct udevice *pmic, int buck, int uvolt)
+int rk8xx_spl_configure_buck(struct udevice *pmic, int buck, int uvolt)
 {
 	int ret;