[U-Boot] [PATCH 1/4] mx51evk: Fix pmic_init() argument

From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- board/freescale/mx51evk/mx51evk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index d01465e..9b43c84 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -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;

From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- board/freescale/mx31pdk/mx31pdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c index 148b4f4..13b9d51 100644 --- a/board/freescale/mx31pdk/mx31pdk.c +++ b/board/freescale/mx31pdk/mx31pdk.c @@ -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;

On 20/11/2013 23:26, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Applied to u-boot-imx, thanks.
Best regards, Stefano Babic

From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- board/genesi/mx51_efikamx/efikamx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/genesi/mx51_efikamx/efikamx.c b/board/genesi/mx51_efikamx/efikamx.c index 76753f9..16769e5 100644 --- a/board/genesi/mx51_efikamx/efikamx.c +++ b/board/genesi/mx51_efikamx/efikamx.c @@ -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;

On 20/11/2013 23:26, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Applied to u-boot-imx, thanks.
Best regards, Stefano Babic

From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- drivers/power/power_fsl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/power/power_fsl.c b/drivers/power/power_fsl.c index ed778f3..ac0b541 100644 --- a/drivers/power/power_fsl.c +++ b/drivers/power/power_fsl.c @@ -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

On 20/11/2013 23:26, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Applied to u-boot-imx, thanks.
Best regards, Stefano Babic

On 20/11/2013 23:26, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
board/freescale/mx51evk/mx51evk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/freescale/mx51evk/mx51evk.c b/board/freescale/mx51evk/mx51evk.c index d01465e..9b43c84 100644 --- a/board/freescale/mx51evk/mx51evk.c +++ b/board/freescale/mx51evk/mx51evk.c @@ -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;
Acked-by: Stefano Babic sbabic@denx.de
Best regards, Stefano Babic

On 20/11/2013 23:26, Fabio Estevam wrote:
From: Fabio Estevam fabio.estevam@freescale.com
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.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Applied to u-boot-imx, thanks.
Best regards, Stefano Babic
participants (2)
-
Fabio Estevam
-
Stefano Babic