Skip to contentSkip to conversation

xilinx_spi: Switch to iomem functions and support little endian.

PATCH In review Richard Röjfors 1 participant 1 message Nov 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 2/4 xilinx_spi: Switch to iomem functions and support little endian.

This patch changes the out_(be)(8|16|32) and in_(be)(8|16|32) calls to 32 bits ioread/iowrite.

The read and write function are attached to the internal struct as callbacks, callback is selected depending on endianess.

This will also build on platforms not supporting the in/out calls for instance x86.

---

drivers/spi/Kconfig +1 -1
index c08fd4f..04ba35f 100644
@@ -236,7 +236,7 @@ config SPI_TXX9
 
 config SPI_XILINX
 	tristate "Xilinx SPI controller"
-	depends on EXPERIMENTAL
+	depends on HAS_IOMEM && EXPERIMENTAL
 	select SPI_BITBANG
 	select SPI_XILINX_OF if (XILINX_VIRTEX || MICROBLAZE)
 	help
drivers/spi/xilinx_spi.c +54 -42

202 lines not on this page · raw message

include/linux/spi/xilinx_spi.h +2 -0
index 06df0ab..a705ad8 100644
@@ -4,11 +4,13 @@
 /**
  * struct xspi_platform_data - Platform data of the Xilinx SPI driver
  * @num_chipselect:	Number of chip select by the IP
+ * @little_endian	If registers should be accessed little endian or not
  * @devices:		Devices to add when the driver is probed.
  * @num_devices:	Number of devices in the devices array.
  */
 struct xspi_platform_data {
 	u16 num_chipselect;
+	bool little_endian;
 	struct spi_board_info *devices;
 	u8 num_devices;
 };