1 /* SPDX-License-Identifier: BSD-3-Clause 2 * 3 * Copyright(c) 2017 Intel Corporation. All rights reserved. 4 * 5 * Author: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> 6 */ 7 8 #ifndef __SOF_DRIVERS_SPI_H__ 9 #define __SOF_DRIVERS_SPI_H__ 10 11 #include <stddef.h> 12 #include <stdint.h> 13 14 enum spi_type { 15 SOF_SPI_INTEL_SLAVE, 16 SOF_SPI_INTEL_MASTER, 17 }; 18 19 enum spi_xfer_direction { 20 SPI_DIR_RX, 21 SPI_DIR_TX, 22 }; 23 24 struct spi_plat_fifo_data { 25 uint32_t handshake; 26 }; 27 28 struct spi_platform_data { 29 uint32_t base; 30 struct spi_plat_fifo_data fifo[2]; 31 enum spi_type type; 32 }; 33 34 struct spi; 35 36 int spi_push(struct spi *spi, const void *data, size_t size); 37 int spi_probe(struct spi *spi); 38 struct spi *spi_get(enum spi_type type); 39 int spi_install(const struct spi_platform_data *plat, size_t n); 40 void spi_init(void); 41 42 #endif /* __SOF_DRIVERS_SPI_H__ */ 43