From: Thomas Gessler Date: Mon, 13 Oct 2014 16:08:47 +0000 (+0200) Subject: i2c: xiic: Fix big-endian register access X-Git-Tag: omap-for-v3.20/drop-legacy-3517~88^2~34 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48ef3ca98d92201c36f50ffb5409c38b02e2e953;p=pandora-kernel.git i2c: xiic: Fix big-endian register access The driver tried to access device registers with the (little-endian) iowrite/ioread functions. While this worked on little-endian machines (e.g. Microblaze with AXI bus), it made the driver unusable on big-endian machines (e.g. PPC405 with PLB). During the probe function, the driver tried to write a 32-bit reset mask into the reset register. This caused an error interrupt on big-endian systems, because the device detected an invalid (byte-swapped) reset mask. The result was an Oops. The patch implements an endianness detection similar to the one used in other Xilinx drivers like drivers/spi/spi-xilinx.c. It was tested on a PPC405/PLB system. Signed-off-by: Thomas Gessler Signed-off-by: Wolfram Sang --- Reading git-diff-tree failed