[U-Boot,3/5] power: pmic: rk805: support rk805 pmic

Message ID 1505297094-5273-3-git-send-email-kever.yang@rock-chips.com
State Superseded
Delegated to: Philipp Tomsich
Headers show
Series
  • [U-Boot,1/5] rockchip: i2c: rk3328: support i2c for rk3328 SoC
Related show

Commit Message

Kever Yang Sept. 13, 2017, 10:04 a.m.
From: Elaine Zhang <zhangqing@rock-chips.com>

Add Rockchip pmic rk805 support.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 drivers/power/pmic/rk8xx.c      | 1 +
 drivers/power/regulator/rk8xx.c | 6 ++++++
 include/power/rk8xx_pmic.h      | 1 +
 3 files changed, 8 insertions(+)

Comments

Dr. Philipp Tomsich Sept. 13, 2017, 8:07 p.m. | #1
> From: Elaine Zhang <zhangqing@rock-chips.com>
> 
> Add Rockchip pmic rk805 support.
> 
> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
>  drivers/power/pmic/rk8xx.c      | 1 +
>  drivers/power/regulator/rk8xx.c | 6 ++++++
>  include/power/rk8xx_pmic.h      | 1 +
>  3 files changed, 8 insertions(+)
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Dr. Philipp Tomsich Sept. 13, 2017, 8:23 p.m. | #2
On Wed, 13 Sep 2017, Kever Yang wrote:

> From: Elaine Zhang <zhangqing@rock-chips.com>
>
> Add Rockchip pmic rk805 support.

Again: a bit more info would be helpful (see my review of patch 2/5 for a 
few hints).

>
> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
>
> drivers/power/pmic/rk8xx.c      | 1 +
> drivers/power/regulator/rk8xx.c | 6 ++++++
> include/power/rk8xx_pmic.h      | 1 +
> 3 files changed, 8 insertions(+)
>
> diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
> index 0fdea95..f2a2f07 100644
> --- a/drivers/power/pmic/rk8xx.c
> +++ b/drivers/power/pmic/rk8xx.c
> @@ -99,6 +99,7 @@ static struct dm_pmic_ops rk8xx_ops = {
> };
>
> static const struct udevice_id rk8xx_ids[] = {
> +	{ .compatible = "rockchip,rk805" },
> 	{ .compatible = "rockchip,rk808" },
> 	{ .compatible = "rockchip,rk816" },
> 	{ .compatible = "rockchip,rk818" },
> diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c
> index cf3566e..6d4a243 100644
> --- a/drivers/power/regulator/rk8xx.c
> +++ b/drivers/power/regulator/rk8xx.c
> @@ -117,6 +117,7 @@ static const struct rk8xx_reg_info *get_buck_reg(struct udevice *pmic,
> 	struct rk8xx_priv *priv = dev_get_priv(pmic);
>
> 	switch (priv->variant) {
> +	case RK805_ID:
> 	case RK816_ID:
> 		switch (num) {
> 		case 0:

So the RK805 is identical to the RK816 for all practical purposes?

> @@ -159,6 +160,7 @@ static int _buck_get_enable(struct udevice *pmic, int buck)
> 	int ret = 0;
>
> 	switch (priv->variant) {
> +	case RK805_ID:
> 	case RK816_ID:
> 		if (buck >= 4) {
> 			mask = 1 << (buck - 4);
> @@ -187,6 +189,7 @@ static int _buck_set_enable(struct udevice *pmic, int buck, bool enable)
> 	struct rk8xx_priv *priv = dev_get_priv(pmic);
>
> 	switch (priv->variant) {
> +	case RK805_ID:
> 	case RK816_ID:
> 		if (buck >= 4) {
> 			buck -= 4;
> @@ -231,6 +234,7 @@ static const struct rk8xx_reg_info *get_ldo_reg(struct udevice *pmic,
> 	struct rk8xx_priv *priv = dev_get_priv(pmic);
>
> 	switch (priv->variant) {
> +	case RK805_ID:
> 	case RK816_ID:
> 		return &rk816_ldo[num];
> 	case RK818_ID:
> @@ -247,6 +251,7 @@ static int _ldo_get_enable(struct udevice *pmic, int ldo)
> 	int ret = 0;
>
> 	switch (priv->variant) {
> +	case RK805_ID:
> 	case RK816_ID:
> 		if (ldo >= 4) {
> 			mask = 1 << (ldo - 4);
> @@ -275,6 +280,7 @@ static int _ldo_set_enable(struct udevice *pmic, int ldo, bool enable)
> 	int ret = 0;
>
> 	switch (priv->variant) {
> +	case RK805_ID:
> 	case RK816_ID:
> 		if (ldo >= 4) {
> 			ldo -= 4;
> diff --git a/include/power/rk8xx_pmic.h b/include/power/rk8xx_pmic.h
> index 8e821c3..b1482b7 100644
> --- a/include/power/rk8xx_pmic.h
> +++ b/include/power/rk8xx_pmic.h
> @@ -178,6 +178,7 @@ enum {
> };
>
> enum {
> +	RK805_ID = 0x8050,
> 	RK808_ID = 0x0000,
> 	RK816_ID = 0x8160,
> 	RK818_ID = 0x8180,
>
Dr. Philipp Tomsich Sept. 28, 2017, 8:36 a.m. | #3
> From: Elaine Zhang <zhangqing@rock-chips.com>
> 
> Add Rockchip pmic rk805 support.
> 
> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
>  drivers/power/pmic/rk8xx.c      | 1 +
>  drivers/power/regulator/rk8xx.c | 6 ++++++
>  include/power/rk8xx_pmic.h      | 1 +
>  3 files changed, 8 insertions(+)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Patch

diff --git a/drivers/power/pmic/rk8xx.c b/drivers/power/pmic/rk8xx.c
index 0fdea95..f2a2f07 100644
--- a/drivers/power/pmic/rk8xx.c
+++ b/drivers/power/pmic/rk8xx.c
@@ -99,6 +99,7 @@  static struct dm_pmic_ops rk8xx_ops = {
 };
 
 static const struct udevice_id rk8xx_ids[] = {
+	{ .compatible = "rockchip,rk805" },
 	{ .compatible = "rockchip,rk808" },
 	{ .compatible = "rockchip,rk816" },
 	{ .compatible = "rockchip,rk818" },
diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c
index cf3566e..6d4a243 100644
--- a/drivers/power/regulator/rk8xx.c
+++ b/drivers/power/regulator/rk8xx.c
@@ -117,6 +117,7 @@  static const struct rk8xx_reg_info *get_buck_reg(struct udevice *pmic,
 	struct rk8xx_priv *priv = dev_get_priv(pmic);
 
 	switch (priv->variant) {
+	case RK805_ID:
 	case RK816_ID:
 		switch (num) {
 		case 0:
@@ -159,6 +160,7 @@  static int _buck_get_enable(struct udevice *pmic, int buck)
 	int ret = 0;
 
 	switch (priv->variant) {
+	case RK805_ID:
 	case RK816_ID:
 		if (buck >= 4) {
 			mask = 1 << (buck - 4);
@@ -187,6 +189,7 @@  static int _buck_set_enable(struct udevice *pmic, int buck, bool enable)
 	struct rk8xx_priv *priv = dev_get_priv(pmic);
 
 	switch (priv->variant) {
+	case RK805_ID:
 	case RK816_ID:
 		if (buck >= 4) {
 			buck -= 4;
@@ -231,6 +234,7 @@  static const struct rk8xx_reg_info *get_ldo_reg(struct udevice *pmic,
 	struct rk8xx_priv *priv = dev_get_priv(pmic);
 
 	switch (priv->variant) {
+	case RK805_ID:
 	case RK816_ID:
 		return &rk816_ldo[num];
 	case RK818_ID:
@@ -247,6 +251,7 @@  static int _ldo_get_enable(struct udevice *pmic, int ldo)
 	int ret = 0;
 
 	switch (priv->variant) {
+	case RK805_ID:
 	case RK816_ID:
 		if (ldo >= 4) {
 			mask = 1 << (ldo - 4);
@@ -275,6 +280,7 @@  static int _ldo_set_enable(struct udevice *pmic, int ldo, bool enable)
 	int ret = 0;
 
 	switch (priv->variant) {
+	case RK805_ID:
 	case RK816_ID:
 		if (ldo >= 4) {
 			ldo -= 4;
diff --git a/include/power/rk8xx_pmic.h b/include/power/rk8xx_pmic.h
index 8e821c3..b1482b7 100644
--- a/include/power/rk8xx_pmic.h
+++ b/include/power/rk8xx_pmic.h
@@ -178,6 +178,7 @@  enum {
 };
 
 enum {
+	RK805_ID = 0x8050,
 	RK808_ID = 0x0000,
 	RK816_ID = 0x8160,
 	RK818_ID = 0x8180,