summaryrefslogtreecommitdiff
path: root/drivers/spi/imx_spi_pmic.c
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2009-06-24 11:31:38 +0800
committerFred Fan <r01011@freescale.com>2009-09-10 17:02:19 +0800
commit23b6527003ca6a12d7872e9e552160041d8b6285 (patch)
tree9abe3d5483436632fceb0cfcc51c64c9b443dc67 /drivers/spi/imx_spi_pmic.c
parentc6e205a9fde82e69608850c24686cc972cf258f1 (diff)
downloadu-boot-imx-23b6527003ca6a12d7872e9e552160041d8b6285.zip
u-boot-imx-23b6527003ca6a12d7872e9e552160041d8b6285.tar.gz
u-boot-imx-23b6527003ca6a12d7872e9e552160041d8b6285.tar.bz2
ENGR00113611: Add FEC support for BBG2.
Add FEC support for BBG2. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers/spi/imx_spi_pmic.c')
-rw-r--r--drivers/spi/imx_spi_pmic.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/spi/imx_spi_pmic.c b/drivers/spi/imx_spi_pmic.c
index bce42c2..79d798d 100644
--- a/drivers/spi/imx_spi_pmic.c
+++ b/drivers/spi/imx_spi_pmic.c
@@ -53,13 +53,17 @@ u32 pmic_reg(struct spi_slave *slave, u32 reg, u32 val, u32 write)
pmic_tx = (write << 31) | (reg << 25) | (val & 0x00FFFFFF);
printf("reg=0x%x, val=0x%08x\n", reg, pmic_tx);
- spi_xfer(slave, 4 << 3, (u8 *)&pmic_tx,
- (u8 *)&pmic_rx, 0);
+ if (spi_xfer(slave, 4 << 3, (u8 *)&pmic_tx, (u8 *)&pmic_rx,
+ SPI_XFER_BEGIN | SPI_XFER_END)) {
+ return -1;
+ }
if (write) {
pmic_tx &= ~(1 << 31);
- spi_xfer(slave, 4 << 3,
- (u8 *)&pmic_tx, (u8 *)&pmic_rx, 0);
+ if (spi_xfer(slave, 4 << 3, (u8 *)&pmic_tx, (u8 *)&pmic_rx,
+ SPI_XFER_BEGIN | SPI_XFER_END)) {
+ return -1;
+ }
}
return pmic_rx;
@@ -73,7 +77,7 @@ void show_pmic_info(struct spi_slave *slave)
return;
rev_id = pmic_reg(slave, 7, 0, 0);
- printf("PMIC ID: 0x%08x [Rev: ", rev_id);
+ debug("PMIC ID: 0x%08x [Rev: ", rev_id);
switch (rev_id & 0x1F) {
case 0x1:
printf("1.0");