aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2015-01-26 11:55:02 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-01-26 15:58:43 -0500
commit8c340f6090e365ce5bac02eed07c1de3aa83f735 (patch)
tree592f69e93cbd5af1c83ae9a27a34fd4a660dbf8b /drivers/i2c
parent9136c5463f990d51c9f9361cd6be27f7f4d8fca7 (diff)
i2c: tegra: Maintain CPU endianness
Support CPU BE mode by adding endianness conversion for memcpy interactions. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-tegra.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 28b87e683503..29f14331dd9d 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -286,6 +286,7 @@ static int tegra_i2c_empty_rx_fifo(struct tegra_i2c_dev *i2c_dev)
286 if (rx_fifo_avail > 0 && buf_remaining > 0) { 286 if (rx_fifo_avail > 0 && buf_remaining > 0) {
287 BUG_ON(buf_remaining > 3); 287 BUG_ON(buf_remaining > 3);
288 val = i2c_readl(i2c_dev, I2C_RX_FIFO); 288 val = i2c_readl(i2c_dev, I2C_RX_FIFO);
289 val = cpu_to_le32(val);
289 memcpy(buf, &val, buf_remaining); 290 memcpy(buf, &val, buf_remaining);
290 buf_remaining = 0; 291 buf_remaining = 0;
291 rx_fifo_avail--; 292 rx_fifo_avail--;
@@ -344,6 +345,7 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev)
344 if (tx_fifo_avail > 0 && buf_remaining > 0) { 345 if (tx_fifo_avail > 0 && buf_remaining > 0) {
345 BUG_ON(buf_remaining > 3); 346 BUG_ON(buf_remaining > 3);
346 memcpy(&val, buf, buf_remaining); 347 memcpy(&val, buf, buf_remaining);
348 val = le32_to_cpu(val);
347 349
348 /* Again update before writing to FIFO to make sure isr sees. */ 350 /* Again update before writing to FIFO to make sure isr sees. */
349 i2c_dev->msg_buf_remaining = 0; 351 i2c_dev->msg_buf_remaining = 0;