xilinx_spi: add support for the DS570 IP.
Subsystems (2)
PATCH v3 3/4 xilinx_spi: add support for the DS570 IP.
This patch adds in support for the DS570 IP.
It's register compatible with the DS464, but adds support for 8/16/32 SPI.
The 8/16/32 support is added by attaching callbacks reading/writing the proper amount of data. To indicate to the driver which amount of bits to use a new field is introduced in the platform data struct.
Acked-by Grant Likely <[email protected]>
Tested-by John Linn <[email protected]>
Signed-off-by Richard Röjfors <[email protected]>
---
drivers/spi/Kconfig +3 -1
@@ -235,7 +235,7 @@ config SPI_TXX9 SPI driver for Toshiba TXx9 MIPS SoCs config SPI_XILINX - tristate "Xilinx SPI controller" + tristate "Xilinx SPI controller common module" depends on HAS_IOMEM && EXPERIMENTAL select SPI_BITBANG select SPI_XILINX_OF if (XILINX_VIRTEX || MICROBLAZE)
@@ -245,6 +245,8 @@ config SPI_XILINX See the "OPB Serial Peripheral Interface (SPI) (v1.00e)" Product Specification document (DS464) for hardware details. + Or for the DS570, see "XPS Serial Peripheral Interface (SPI) (v2.00b)" + config SPI_XILINX_OF tristate "Xilinx SPI controller OF device" depends on SPI_XILINX && (XILINX_VIRTEX || MICROBLAZE)
drivers/spi/xilinx_spi.c +90 -33
205 lines not on this page · raw message
drivers/spi/xilinx_spi_of.c +1 -0
@@ -72,6 +72,7 @@ static int __devinit xilinx_spi_of_probe(struct of_device *ofdev,return -EINVAL ; } pdata->num_chipselect = *prop; + pdata->bits_per_word =8 ; master =xilinx_spi_init (&ofdev->dev, &r_mem, r_irq.start,-1 );if (!master)return -ENODEV ;
include/linux/spi/xilinx_spi.h +4 -2
@@ -3,14 +3,16 @@/** * 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 +* @num_chipselect: Number of chip select by the IP. +* @little_endian: If registers should be accessed little endian or not. +* @bits_per_word: Number of bits per word. * @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; +u8 bits_per_word;struct spi_board_info *devices;u8 num_devices; };