Skip to contentSkip to conversation

mx51evk: Fix pmic_init() argument

PATCH New Fabio Estevam 2 participants 9 messages Nov 20, 2013 – Nov 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 mx51evk: Fix pmic_init() argument

From: Fabio Estevam <[email protected]>

On mx51evk board the PMIC is connected via SPI interface, so it does not make sense to pass I2C_PMIC into the pmic_init() interface.

Pass the SPI bus number via CONFIG_FSL_PMIC_BUS option instead.

---
 board/freescale/mx51evk/mx51evk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/freescale/mx51evk/mx51evk.c +1 -1
index d01465e..9b43c84 100644
@@ -174,7 +174,7 @@ static void power_init(void)
 	struct pmic *p;
 	int ret;
 
-	ret = pmic_init(I2C_PMIC);
+	ret = pmic_init(CONFIG_FSL_PMIC_BUS);
 	if (ret)
 		return;
 
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/4 mx31pdk: Fix pmic_init() argument

From: Fabio Estevam <[email protected]>

On mx31pdk board the PMIC is connected via SPI interface, so it does not make sense to pass I2C_PMIC into the pmic_init() interface.

Pass the SPI bus number via CONFIG_FSL_PMIC_BUS option instead.

---
 board/freescale/mx31pdk/mx31pdk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/freescale/mx31pdk/mx31pdk.c +1 -1
index 148b4f4..13b9d51 100644
@@ -85,7 +85,7 @@ int board_late_init(void)
 	struct pmic *p;
 	int ret;
 
-	ret = pmic_init(I2C_PMIC);
+	ret = pmic_init(CONFIG_FSL_PMIC_BUS);
 	if (ret)
 		return ret;
 
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH 3/4 efikamx: Fix pmic_init() argument

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

On efikamx board the PMIC is connected via SPI interface, so it does not make sense to pass I2C_PMIC into the pmic_init() interface.

Pass the SPI bus number via CONFIG_FSL_PMIC_BUS option instead.

---
 board/genesi/mx51_efikamx/efikamx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/genesi/mx51_efikamx/efikamx.c +1 -1
index 76753f9..16769e5 100644
@@ -159,7 +159,7 @@ static void power_init(void)
 	struct pmic *p;
 	int ret;
 
-	ret = pmic_init(I2C_PMIC);
+	ret = pmic_init(CONFIG_FSL_PMIC_BUS);
 	if (ret)
 		return;
 
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH 4/4 power: power_fsl: Pass p->bus in the same way for SPI and I2C cases

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need to pass p->bus differently when the PMIC is connected via SPI or via I2C.

Handle the both cases in the same way.

---
 drivers/power/power_fsl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/power/power_fsl.c +1 -2
index ed778f3..ac0b541 100644
@@ -36,10 +36,10 @@ int pmic_init(unsigned char bus)
 
 	p->name = name;
 	p->number_of_regs = PMIC_NUM_OF_REGS;
+	p->bus = bus;
 
 #if defined(CONFIG_POWER_SPI)
 	p->interface = PMIC_SPI;
-	p->bus = CONFIG_FSL_PMIC_BUS;
 	p->hw.spi.cs = CONFIG_FSL_PMIC_CS;
 	p->hw.spi.clk = CONFIG_FSL_PMIC_CLK;
 	p->hw.spi.mode = CONFIG_FSL_PMIC_MODE;
@@ -50,7 +50,6 @@ int pmic_init(unsigned char bus)
 	p->interface = PMIC_I2C;
 	p->hw.i2c.addr = CONFIG_SYS_FSL_PMIC_I2C_ADDR;
 	p->hw.i2c.tx_num = FSL_PMIC_I2C_LENGTH;
-	p->bus = bus;
 #else
 #error "You must select CONFIG_POWER_SPI or CONFIG_PMIC_I2C"
 #endif
Signature · 1 line
1.8.1.2
#7 lore raw

PATCH 1/4 mx51evk: Fix pmic_init() argument

In reply to Fabio Estevam
Quoted 18 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

On mx51evk board the PMIC is connected via SPI interface, so it does not make sense to pass I2C_PMIC into the pmic_init() interface.

Pass the SPI bus number via CONFIG_FSL_PMIC_BUS option instead.

---
 board/freescale/mx51evk/mx51evk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/freescale/mx51evk/mx51evk.c +0 -0
index d01465e..9b43c84 100644

board/freescale/mx51evk/mx51evk.c static void power_init(void) · line 180

Quoted 8 lines
board/freescale/mx51evk/mx51evk.c +1 -1
@@ -174,7 +174,7 @@ static void power_init(void)
 	struct pmic *p;
 	int ret;
 
-	ret = pmic_init(I2C_PMIC);
+	ret = pmic_init(CONFIG_FSL_PMIC_BUS);
 	if (ret)
 		return;
 

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#8 lore raw

PATCH 1/4 mx51evk: Fix pmic_init() argument

In reply to Fabio Estevam
Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

On mx51evk board the PMIC is connected via SPI interface, so it does not make sense to pass I2C_PMIC into the pmic_init() interface.

Pass the SPI bus number via CONFIG_FSL_PMIC_BUS option instead.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#2 lore raw

PATCH 2/4 mx31pdk: Fix pmic_init() argument

In reply to Fabio Estevam
Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

On mx31pdk board the PMIC is connected via SPI interface, so it does not make sense to pass I2C_PMIC into the pmic_init() interface.

Pass the SPI bus number via CONFIG_FSL_PMIC_BUS option instead.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#4 lore raw

PATCH 3/4 efikamx: Fix pmic_init() argument

In reply to Fabio Estevam
Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

On efikamx board the PMIC is connected via SPI interface, so it does not make sense to pass I2C_PMIC into the pmic_init() interface.

Pass the SPI bus number via CONFIG_FSL_PMIC_BUS option instead.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#6 lore raw

PATCH 4/4 power: power_fsl: Pass p->bus in the same way for SPI and I2C cases

In reply to Fabio Estevam
Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need to pass p->bus differently when the PMIC is connected via SPI or via I2C.

Handle the both cases in the same way.

---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================