summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorWei Ni <wni@nvidia.com>2011-08-03 15:01:37 +0800
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:21 -0700
commite344e1eb27135cd2650c74c17270ce5361251a91 (patch)
treec6486fc0013277e7a6c261d416b7f65122a867fd /board
parent37ab60f1078c8f9f412f54933ca1917990dd8b5b (diff)
Tegra: pmu: Fix the pmu_read and pmu_write
pmu_read/pmu_write call the i2c_read/i2c_write to read/write. In the old codes, the parameter "alen" is 0, but according to the tegra-i2c.c, if the alen==0, the i2c_read/i2c_write will be failed with i2c_addr_ok(), it means the alen should not be 0. It should be 1 in here. BUG=chromium-os:18648 TEST=test on seaboard, the pmu_read/pmu_write works fine. Change-Id: Ib55811bcc259a9dc74993728a23329abc6f2fe5d Signed-off-by: Wei Ni <wni@nvidia.com> Reviewed-on: http://gerrit.chromium.org/gerrit/5206 Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/nvidia/common/pmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/board/nvidia/common/pmu.c b/board/nvidia/common/pmu.c
index be288cf3cb..803556165b 100644
--- a/board/nvidia/common/pmu.c
+++ b/board/nvidia/common/pmu.c
@@ -80,7 +80,7 @@ static int pmu_read(int reg)
uchar data;
for (i = 0; i < MAX_I2C_RETRY; ++i) {
- if (!i2c_read(PMU_I2C_ADDRESS, reg, 0, &data, 1))
+ if (!i2c_read(PMU_I2C_ADDRESS, reg, 1, &data, 1))
return (int)data;
/* i2c access failed, retry */
@@ -95,7 +95,7 @@ static int pmu_write(int reg, uchar *data, uint len)
int i;
for (i = 0; i < MAX_I2C_RETRY; ++i) {
- if (!i2c_write(PMU_I2C_ADDRESS, reg, 0, data, len))
+ if (!i2c_write(PMU_I2C_ADDRESS, reg, 1, data, len))
return 0;
/* i2c access failed, retry */