diff mbox series

[v2,1/1] power: pmic_pca9450: fix PCA9450A I2C address

Message ID 20200630130313.32440-1-sebastien.szymanski@armadeus.com
State Accepted
Commit eefd93e7f88ec919cc335dbf934320fec949bce6
Delegated to: Stefano Babic
Headers show
Series [v2,1/1] power: pmic_pca9450: fix PCA9450A I2C address | expand

Commit Message

Sébastien Szymanski June 30, 2020, 1:03 p.m. UTC
Quoting Ye Li from NXP:

    "We have confirmed with PMIC team, 0x35 is used only on early chips
    and not used any more. 0x25 is the final address."

Fix it by merging power_pca9450a_init and power_pca9450b_init into one
function power_pca9450_init.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---

Changes for v2:
 * Quoting Ye Li
 * Merge both function into one as suggested by Ye Li

 board/freescale/imx8mp_evk/spl.c  |  2 +-
 drivers/power/pmic/pmic_pca9450.c | 21 +--------------------
 include/power/pca9450.h           |  3 +--
 3 files changed, 3 insertions(+), 23 deletions(-)

Comments

Fabio Estevam June 30, 2020, 1:23 p.m. UTC | #1
On Tue, Jun 30, 2020 at 10:03 AM Sébastien Szymanski
<sebastien.szymanski@armadeus.com> wrote:
>
> Quoting Ye Li from NXP:
>
>     "We have confirmed with PMIC team, 0x35 is used only on early chips
>     and not used any more. 0x25 is the final address."
>
> Fix it by merging power_pca9450a_init and power_pca9450b_init into one
> function power_pca9450_init.
>
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Ye Li July 1, 2020, 4:01 a.m. UTC | #2
On Tue, 2020-06-30 at 15:03 +0200, Sébastien Szymanski wrote:
> Caution: EXT Email
> 
> Quoting Ye Li from NXP:
> 
>     "We have confirmed with PMIC team, 0x35 is used only on early
> chips
>     and not used any more. 0x25 is the final address."
> 
> Fix it by merging power_pca9450a_init and power_pca9450b_init into
> one
> function power_pca9450_init.
> 
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
> 
> Changes for v2:
>  * Quoting Ye Li
>  * Merge both function into one as suggested by Ye Li
> 
>  board/freescale/imx8mp_evk/spl.c  |  2 +-
>  drivers/power/pmic/pmic_pca9450.c | 21 +--------------------
>  include/power/pca9450.h           |  3 +--
>  3 files changed, 3 insertions(+), 23 deletions(-)
> 
> diff --git a/board/freescale/imx8mp_evk/spl.c
> b/board/freescale/imx8mp_evk/spl.c
> index 3b3a854e29..3214718e62 100644
> --- a/board/freescale/imx8mp_evk/spl.c
> +++ b/board/freescale/imx8mp_evk/spl.c
> @@ -68,7 +68,7 @@ int power_init_board(void)
>         struct pmic *p;
>         int ret;
> 
> -       ret = power_pca9450b_init(I2C_PMIC);
> +       ret = power_pca9450_init(I2C_PMIC);
>         if (ret)
>                 printf("power init failed");
>         p = pmic_get("PCA9450");
> diff --git a/drivers/power/pmic/pmic_pca9450.c
> b/drivers/power/pmic/pmic_pca9450.c
> index 67a9090200..d4f27428bd 100644
> --- a/drivers/power/pmic/pmic_pca9450.c
> +++ b/drivers/power/pmic/pmic_pca9450.c
> @@ -11,26 +11,7 @@
> 
>  static const char pca9450_name[] = "PCA9450";
> 
> -int power_pca9450a_init(unsigned char bus)
> -{
> -       struct pmic *p = pmic_alloc();
> -
> -       if (!p) {
> -               printf("%s: POWER allocation error!\n", __func__);
> -               return -ENOMEM;
> -       }
> -
> -       p->name = pca9450_name;
> -       p->interface = PMIC_I2C;
> -       p->number_of_regs = PCA9450_REG_NUM;
> -       p->hw.i2c.addr = 0x35;
> -       p->hw.i2c.tx_num = 1;
> -       p->bus = bus;
> -
> -       return 0;
> -}
> -
> -int power_pca9450b_init(unsigned char bus)
> +int power_pca9450_init(unsigned char bus)
>  {
>         struct pmic *p = pmic_alloc();
> 
> diff --git a/include/power/pca9450.h b/include/power/pca9450.h
> index 5d4f58ca44..5a9a697d62 100644
> --- a/include/power/pca9450.h
> +++ b/include/power/pca9450.h
> @@ -54,7 +54,6 @@ enum {
>         PCA9450_REG_NUM,
>  };
> 
> -int power_pca9450a_init(unsigned char bus);
> -int power_pca9450b_init(unsigned char bus);
> +int power_pca9450_init(unsigned char bus);
> 
>  #endif
> --
> 2.26.2
> 
Reviewed-by: Ye Li <ye.li@nxp.com>

Best regards,
Ye Li
Stefano Babic July 16, 2020, 5:48 p.m. UTC | #3
> Quoting Ye Li from NXP:
>     "We have confirmed with PMIC team, 0x35 is used only on early chips
>     and not used any more. 0x25 is the final address."
> Fix it by merging power_pca9450a_init and power_pca9450b_init into one
> function power_pca9450_init.
> Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
> Reviewed-by: Ye Li <ye.li@nxp.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
index 3b3a854e29..3214718e62 100644
--- a/board/freescale/imx8mp_evk/spl.c
+++ b/board/freescale/imx8mp_evk/spl.c
@@ -68,7 +68,7 @@  int power_init_board(void)
 	struct pmic *p;
 	int ret;
 
-	ret = power_pca9450b_init(I2C_PMIC);
+	ret = power_pca9450_init(I2C_PMIC);
 	if (ret)
 		printf("power init failed");
 	p = pmic_get("PCA9450");
diff --git a/drivers/power/pmic/pmic_pca9450.c b/drivers/power/pmic/pmic_pca9450.c
index 67a9090200..d4f27428bd 100644
--- a/drivers/power/pmic/pmic_pca9450.c
+++ b/drivers/power/pmic/pmic_pca9450.c
@@ -11,26 +11,7 @@ 
 
 static const char pca9450_name[] = "PCA9450";
 
-int power_pca9450a_init(unsigned char bus)
-{
-	struct pmic *p = pmic_alloc();
-
-	if (!p) {
-		printf("%s: POWER allocation error!\n", __func__);
-		return -ENOMEM;
-	}
-
-	p->name = pca9450_name;
-	p->interface = PMIC_I2C;
-	p->number_of_regs = PCA9450_REG_NUM;
-	p->hw.i2c.addr = 0x35;
-	p->hw.i2c.tx_num = 1;
-	p->bus = bus;
-
-	return 0;
-}
-
-int power_pca9450b_init(unsigned char bus)
+int power_pca9450_init(unsigned char bus)
 {
 	struct pmic *p = pmic_alloc();
 
diff --git a/include/power/pca9450.h b/include/power/pca9450.h
index 5d4f58ca44..5a9a697d62 100644
--- a/include/power/pca9450.h
+++ b/include/power/pca9450.h
@@ -54,7 +54,6 @@  enum {
 	PCA9450_REG_NUM,
 };
 
-int power_pca9450a_init(unsigned char bus);
-int power_pca9450b_init(unsigned char bus);
+int power_pca9450_init(unsigned char bus);
 
 #endif