0001
0002
0003
0004
0005 #ifndef __LINUX_SPI_ALTERA_H
0006 #define __LINUX_SPI_ALTERA_H
0007
0008 #include <linux/interrupt.h>
0009 #include <linux/regmap.h>
0010 #include <linux/spi/spi.h>
0011 #include <linux/types.h>
0012
0013 #define ALTERA_SPI_MAX_CS 32
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 struct altera_spi_platform_data {
0025 u16 mode_bits;
0026 u16 num_chipselect;
0027 u32 bits_per_word_mask;
0028 u16 num_devices;
0029 struct spi_board_info *devices;
0030 };
0031
0032 struct altera_spi {
0033 int irq;
0034 int len;
0035 int count;
0036 int bytes_per_word;
0037 u32 imr;
0038
0039
0040 const unsigned char *tx;
0041 unsigned char *rx;
0042
0043 struct regmap *regmap;
0044 u32 regoff;
0045 struct device *dev;
0046 };
0047
0048 extern irqreturn_t altera_spi_irq(int irq, void *dev);
0049 extern void altera_spi_init_master(struct spi_master *master);
0050 #endif