diff mbox series

power: pmic: pca9450: fix i2c address for PCA9450A

Message ID 20200713074239.30176-1-f.suligoi@asem.it
State Superseded
Headers show
Series power: pmic: pca9450: fix i2c address for PCA9450A | expand

Commit Message

Flavio Suligoi July 13, 2020, 7:42 a.m. UTC
Change the I2C Slave Address of the PCA9450A:

0x35 --> 0x25

According to the NXP documentation, in the datasheet:

PCA9450DS.pdf (Rev 1.0 - 19 November 2019)

in the table 19 "PCA9450 I2C Slave Address) at page 27/96,

all the PCA9450 have the same I2C address.
In particular, in case of 7-bit Slave Address, the address
is 0x25.

This modification was tested on the imx8mm-evk, with the
SOC equipped with the PCA9450A instead of the previous
ROHM BD71847.

Signed-off-by: Flavio Suligoi <f.suligoi at asem.it>
---
 drivers/power/pmic/pca9450.c      | 2 +-
 drivers/power/pmic/pmic_pca9450.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Flavio Suligoi July 13, 2020, 9:46 a.m. UTC | #1
Hi Sebastien,

> >> index 0c9d9a366e..c7f8b80954 100644
> >> --- a/drivers/power/pmic/pca9450.c
> >> +++ b/drivers/power/pmic/pca9450.c
> >> @@ -80,7 +80,7 @@ static struct dm_pmic_ops pca9450_ops = {  };
> >>
> >>  static const struct udevice_id pca9450_ids[] = {
> >> -	{ .compatible = "nxp,pca9450a", .data = 0x35, },
> >> +	{ .compatible = "nxp,pca9450a", .data = 0x25, },
> >>  	{ .compatible = "nxp,pca9450b", .data = 0x25, },
> >>  	{ }
> >>  };
> >> diff --git a/drivers/power/pmic/pmic_pca9450.c
> >> b/drivers/power/pmic/pmic_pca9450.c
> >> index 67a9090200..c0fb78c4cd 100644
> >> --- a/drivers/power/pmic/pmic_pca9450.c
> >> +++ b/drivers/power/pmic/pmic_pca9450.c
> >> @@ -23,7 +23,7 @@ int power_pca9450a_init(unsigned char bus)
> >>  	p->name = pca9450_name;
> >>  	p->interface = PMIC_I2C;
> >>  	p->number_of_regs = PCA9450_REG_NUM;
> >> -	p->hw.i2c.addr = 0x35;
> >> +	p->hw.i2c.addr = 0x25;
> >>  	p->hw.i2c.tx_num = 1;
> >>  	p->bus = bus;
> >
> > There was a thread to address this, but not take udevice_id into
> consideration.
> > Your version looks better.
> 
> In that thread [1], it was suggested to merge both function
> power_pca9450{a,b}_init into one function power_pca9450_init.
> 
> [1] https://lists.denx.de/pipermail/u-boot/2020-June/418123.html
> 

You are right, indeed, the solution to merge the two functions
into a single one is more elegant!

> Regards,
> 
> >
> > Reviewed-by: Peng Fan <peng.fan at nxp.com>
> >
> >>
> >> --
> >> 2.17.1
> >
> 
> 
> --
> S?bastien Szymanski, Armadeus Systems
> Software engineer

Regards,
Flavio
diff mbox series

Patch

diff --git a/drivers/power/pmic/pca9450.c b/drivers/power/pmic/pca9450.c
index 0c9d9a366e..c7f8b80954 100644
--- a/drivers/power/pmic/pca9450.c
+++ b/drivers/power/pmic/pca9450.c
@@ -80,7 +80,7 @@  static struct dm_pmic_ops pca9450_ops = {
 };
 
 static const struct udevice_id pca9450_ids[] = {
-	{ .compatible = "nxp,pca9450a", .data = 0x35, },
+	{ .compatible = "nxp,pca9450a", .data = 0x25, },
 	{ .compatible = "nxp,pca9450b", .data = 0x25, },
 	{ }
 };
diff --git a/drivers/power/pmic/pmic_pca9450.c b/drivers/power/pmic/pmic_pca9450.c
index 67a9090200..c0fb78c4cd 100644
--- a/drivers/power/pmic/pmic_pca9450.c
+++ b/drivers/power/pmic/pmic_pca9450.c
@@ -23,7 +23,7 @@  int power_pca9450a_init(unsigned char bus)
 	p->name = pca9450_name;
 	p->interface = PMIC_I2C;
 	p->number_of_regs = PCA9450_REG_NUM;
-	p->hw.i2c.addr = 0x35;
+	p->hw.i2c.addr = 0x25;
 	p->hw.i2c.tx_num = 1;
 	p->bus = bus;