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

Philipp Tomsich philipp.tomsich at theobroma-systems.com
Wed Sep 13 20:23:59 UTC 2017



On Wed, 13 Sep 2017, Kever Yang wrote:

> From: Elaine Zhang <zhangqing at 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 at rock-chips.com>
> Signed-off-by: Kever Yang <kever.yang at 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,
>


More information about the U-Boot mailing list