summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-10-13 20:59:47 +0200
committerWolfgang Denk <wd@denx.de>2010-10-13 20:59:47 +0200
commite1b4c57096b87b4ada56df4154d9acee6a59141f (patch)
tree4d1ab61fd347a63410bcffc1ac2d85beeb247058 /drivers/misc
parentda61f6c45ad4a126bf0a9a8184fadc13073ecb3f (diff)
parent89bca0ab697fc75160dd0d685d7cb2ed26609a6d (diff)
downloadu-boot-imx-e1b4c57096b87b4ada56df4154d9acee6a59141f.zip
u-boot-imx-e1b4c57096b87b4ada56df4154d9acee6a59141f.tar.gz
u-boot-imx-e1b4c57096b87b4ada56df4154d9acee6a59141f.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/fsl_pmic.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/misc/fsl_pmic.c b/drivers/misc/fsl_pmic.c
index dca0a1d..5ee1de1 100644
--- a/drivers/misc/fsl_pmic.c
+++ b/drivers/misc/fsl_pmic.c
@@ -46,6 +46,7 @@ void pmic_spi_free(struct spi_slave *slave)
u32 pmic_reg(u32 reg, u32 val, u32 write)
{
u32 pmic_tx, pmic_rx;
+ u32 tmp;
if (!slave) {
slave = pmic_spi_probe();
@@ -65,7 +66,9 @@ u32 pmic_reg(u32 reg, u32 val, u32 write)
pmic_tx = (write << 31) | (reg << 25) | (val & 0x00FFFFFF);
- if (spi_xfer(slave, 4 << 3, &pmic_tx, &pmic_rx,
+ tmp = cpu_to_be32(pmic_tx);
+
+ if (spi_xfer(slave, 4 << 3, &tmp, &pmic_rx,
SPI_XFER_BEGIN | SPI_XFER_END)) {
spi_release_bus(slave);
return -1;
@@ -73,7 +76,8 @@ u32 pmic_reg(u32 reg, u32 val, u32 write)
if (write) {
pmic_tx &= ~(1 << 31);
- if (spi_xfer(slave, 4 << 3, &pmic_tx, &pmic_rx,
+ tmp = cpu_to_be32(pmic_tx);
+ if (spi_xfer(slave, 4 << 3, &tmp, &pmic_rx,
SPI_XFER_BEGIN | SPI_XFER_END)) {
spi_release_bus(slave);
return -1;
@@ -81,7 +85,7 @@ u32 pmic_reg(u32 reg, u32 val, u32 write)
}
spi_release_bus(slave);
- return pmic_rx;
+ return cpu_to_be32(pmic_rx);
}
void pmic_reg_write(u32 reg, u32 value)