summaryrefslogtreecommitdiff
path: root/include/linux/spi
diff options
context:
space:
mode:
authorMatthew Gerlach <matthew.gerlach@linux.intel.com>2021-04-16 19:57:19 +0300
committerMark Brown <broonie@kernel.org>2021-04-20 19:26:40 +0300
commitb0c3d9354de1f87eebc00694d5218b6611265933 (patch)
treefcd1cf992774191604f341b0d19accd9527add55 /include/linux/spi
parent1b8a7d4282c038b3846f2485d86cb990c55c38d9 (diff)
downloadlinux-b0c3d9354de1f87eebc00694d5218b6611265933.tar.xz
spi: altera: separate core code from platform code
In preparation of adding support for a new bus type, separate the core spi-altera code from the platform driver code. Signed-off-by: Matthew Gerlach <matthew.gerlach@linux.intel.com> Link: https://lore.kernel.org/r/20210416165720.554144-2-matthew.gerlach@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/altera.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/spi/altera.h b/include/linux/spi/altera.h
index 2d42641499a6..2e2a622e56da 100644
--- a/include/linux/spi/altera.h
+++ b/include/linux/spi/altera.h
@@ -5,10 +5,13 @@
#ifndef __LINUX_SPI_ALTERA_H
#define __LINUX_SPI_ALTERA_H
+#include <linux/interrupt.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <linux/types.h>
+#define ALTERA_SPI_MAX_CS 32
+
/**
* struct altera_spi_platform_data - Platform data of the Altera SPI driver
* @mode_bits: Mode bits of SPI master.
@@ -26,4 +29,22 @@ struct altera_spi_platform_data {
struct spi_board_info *devices;
};
+struct altera_spi {
+ int irq;
+ int len;
+ int count;
+ int bytes_per_word;
+ u32 imr;
+
+ /* data buffers */
+ const unsigned char *tx;
+ unsigned char *rx;
+
+ struct regmap *regmap;
+ u32 regoff;
+ struct device *dev;
+};
+
+extern irqreturn_t altera_spi_irq(int irq, void *dev);
+extern void altera_spi_init_master(struct spi_master *master);
#endif /* __LINUX_SPI_ALTERA_H */