From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] imx: Explicitly pass the I2C bus number in pmic_init()
Date: Thu, 21 Nov 2013 16:16:10 +0100 [thread overview]
Message-ID: <528E23BA.30706@denx.de> (raw)
In-Reply-To: <1384989456-20424-1-git-send-email-festevam@gmail.com>
On 21/11/2013 00:17, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> The pmic_init() function has the I2C or SPI bus number that is connected to the
> PMIC.
>
> Instead of passing I2C_PMIC, explicitly pass the I2C bus number via I2C_x
> definition.
>
> The motivation for doing this is to avoid people just doing a copy and paste
> of I2C_PMIC into their board file when another I2C bus is actually used to
> interface to their PMIC.
>
> This also makes more obvious which is the I2C bus connected to the PMIC, without
> having to search in the source code for the meaning of the 'I2C_PMIC' number.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> board/freescale/mx25pdk/mx25pdk.c | 2 +-
> board/freescale/mx35pdk/mx35pdk.c | 2 +-
> board/freescale/mx53evk/mx53evk.c | 2 +-
> board/freescale/mx53loco/mx53loco.c | 2 +-
> 4 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/board/freescale/mx25pdk/mx25pdk.c b/board/freescale/mx25pdk/mx25pdk.c
> index ebe3bcb..71a395c 100644
> --- a/board/freescale/mx25pdk/mx25pdk.c
> +++ b/board/freescale/mx25pdk/mx25pdk.c
> @@ -138,7 +138,7 @@ int board_late_init(void)
>
> mx25pdk_fec_init();
>
> - ret = pmic_init(I2C_PMIC);
> + ret = pmic_init(I2C_0);
> if (ret)
> return ret;
>
> diff --git a/board/freescale/mx35pdk/mx35pdk.c b/board/freescale/mx35pdk/mx35pdk.c
> index 9fabef5..12467a9 100644
> --- a/board/freescale/mx35pdk/mx35pdk.c
> +++ b/board/freescale/mx35pdk/mx35pdk.c
> @@ -213,7 +213,7 @@ int board_late_init(void)
> struct pmic *p;
> int ret;
>
> - ret = pmic_init(I2C_PMIC);
> + ret = pmic_init(I2C_0);
> if (ret)
> return ret;
>
> diff --git a/board/freescale/mx53evk/mx53evk.c b/board/freescale/mx53evk/mx53evk.c
> index 3b398b6..13519e2 100644
> --- a/board/freescale/mx53evk/mx53evk.c
> +++ b/board/freescale/mx53evk/mx53evk.c
> @@ -81,7 +81,7 @@ void power_init(void)
> struct pmic *p;
> int ret;
>
> - ret = pmic_init(I2C_PMIC);
> + ret = pmic_init(I2C_0);
> if (ret)
> return;
>
> diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
> index ae7eca8..db0bf17 100644
> --- a/board/freescale/mx53loco/mx53loco.c
> +++ b/board/freescale/mx53loco/mx53loco.c
> @@ -258,7 +258,7 @@ static int power_init(void)
> }
>
> if (!i2c_probe(CONFIG_SYS_FSL_PMIC_I2C_ADDR)) {
> - ret = pmic_init(I2C_PMIC);
> + ret = pmic_init(I2C_0);
> if (ret)
> return ret;
>
>
Acked-by: Stefano Babic <sbabic@denx.de>
Best regards,
Stefano Babic
--
=====================================================================
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
=====================================================================
prev parent reply other threads:[~2013-11-21 15:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 23:17 [U-Boot] [PATCH] imx: Explicitly pass the I2C bus number in pmic_init() Fabio Estevam
2013-11-21 15:16 ` Stefano Babic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=528E23BA.30706@denx.de \
--to=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox