Some platforms use a chip select mechanism other than that provided by
the controller. Expose the mechanism for the platform code to
register the external chip select control function with the driver.
Change-Id: If2807645a629833ebd50bab9073c56d70ea1826d
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/spi/spi.h>
+#include <linux/spi/spi-dw.h>
#include "dw_spi.h"
#define QUEUE_RUNNING 0
#define QUEUE_STOPPED 1
-#define SPI_DW_DEASSERT 0
-#define SPI_DW_ASSERT 1
-
/* Slave spi_dev related */
struct chip_data {
struct spi_device *spi_dev;
dw_writel(dws, imr, new_mask);
}
-/*
- * Each SPI slave device to work with dw_api controller should
- * has such a structure claiming its working mode (PIO/DMA etc),
- * which can be save in the "controller_data" member of the
- * struct spi_device
- */
-struct spi_dw_chip {
- void (*cs_control)(u32 command);
-};
-
extern int spi_dw_add_host(struct spi_dw *dws);
extern void spi_dw_remove_host(struct spi_dw *dws);
extern int spi_dw_suspend_host(struct spi_dw *dws);
--- /dev/null
+#ifndef _SPI_DW_H_
+#define _SPI_DW_H_
+
+#define SPI_DW_DEASSERT 0
+#define SPI_DW_ASSERT 1
+
+/*
+ * If the platform does not use on of the chip select lines provided
+ * by the SOC it may register a chip select control function. The
+ * address of initialized spi_dw_chip stucture in the controller_data
+ * member of spi_board_info structure registered with the subsystem.
+ */
+struct spi_dw_chip {
+ void (*cs_control)(u32 command);
+};
+
+#endif /* _SPI_DW_H_ */