public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/5] pmic_fsl: Introduce CONFIG_SYS_FSL_PMIC_I2C_LENGTH
Date: Mon, 15 Oct 2012 20:32:08 -0300	[thread overview]
Message-ID: <1350343930-15648-3-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1350343930-15648-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@freescale.com>

Introduce CONFIG_SYS_FSL_PMIC_I2C_LENGTH to configure the number of bytes
that are used to communicate with the PMIC via I2C.

Instead of hardcoding the value, pass the number via a config option.

This will be useful for adding support for PMIC MC34704 from Freescale, which 
uses only one byte in its I2C protocol.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- No changes. Newly introduced in this series

 drivers/misc/pmic_fsl.c    |    2 +-
 include/configs/mx35pdk.h  |    1 +
 include/configs/mx53evk.h  |    1 +
 include/configs/mx53loco.h |    1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/pmic_fsl.c b/drivers/misc/pmic_fsl.c
index 0ff75ed..40c448b 100644
--- a/drivers/misc/pmic_fsl.c
+++ b/drivers/misc/pmic_fsl.c
@@ -53,7 +53,7 @@ int pmic_init(void)
 #elif defined(CONFIG_PMIC_I2C)
 	p->interface = PMIC_I2C;
 	p->hw.i2c.addr = CONFIG_SYS_FSL_PMIC_I2C_ADDR;
-	p->hw.i2c.tx_num = 3;
+	p->hw.i2c.tx_num = CONFIG_SYS_FSL_PMIC_I2C_LENGTH;
 	p->bus = I2C_PMIC;
 #else
 #error "You must select CONFIG_PMIC_SPI or CONFIG_PMIC_I2C"
diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index 69bd654..3998d76 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -69,6 +69,7 @@
 #define CONFIG_PMIC_I2C
 #define CONFIG_PMIC_FSL
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR	0x08
+#define CONFIG_SYS_FSL_PMIC_I2C_LENGTH	3
 #define CONFIG_RTC_MC13XXX
 
 /*
diff --git a/include/configs/mx53evk.h b/include/configs/mx53evk.h
index 832050e..f7b11c0 100644
--- a/include/configs/mx53evk.h
+++ b/include/configs/mx53evk.h
@@ -59,6 +59,7 @@
 #define CONFIG_PMIC_I2C
 #define CONFIG_PMIC_FSL
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR    8
+#define CONFIG_SYS_FSL_PMIC_I2C_LENGTH	3
 #define CONFIG_RTC_MC13XXX
 
 /* MMC Configs */
diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 6a6aaa1..fd454d5 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -96,6 +96,7 @@
 #define CONFIG_PMIC_FSL
 #define CONFIG_SYS_DIALOG_PMIC_I2C_ADDR	0x48
 #define CONFIG_SYS_FSL_PMIC_I2C_ADDR	0x8
+#define CONFIG_SYS_FSL_PMIC_I2C_LENGTH	3
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
-- 
1.7.9.5

  parent reply	other threads:[~2012-10-15 23:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 23:32 [U-Boot] [PATCH v2 1/5] mx25pdk: Include CONFIG_MX25 Fabio Estevam
2012-10-15 23:32 ` [U-Boot] [PATCH v2 2/5] mx25pdk: Add esdhc support Fabio Estevam
2012-10-15 23:32 ` Fabio Estevam [this message]
2012-10-16 14:39   ` [U-Boot] [PATCH v2 3/5] pmic_fsl: Introduce CONFIG_SYS_FSL_PMIC_I2C_LENGTH Stefano Babic
2012-10-16 16:12     ` Lukasz Majewski
2012-10-22 15:22     ` Fabio Estevam
2012-10-22 16:05       ` Lukasz Majewski
2012-10-22 16:16       ` Stefano Babic
2012-10-15 23:32 ` [U-Boot] [PATCH v2 4/5] pmic: Add support for mc34704 Fabio Estevam
2012-10-15 23:32 ` [U-Boot] [PATCH v2 5/5] mx25pdk: Add Ethernet support Fabio Estevam

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=1350343930-15648-3-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --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