diff --git a/drivers/spi/intel_spi_priv.h b/drivers/spi/intel_spi_priv.h index 354ed9e0e9..367470510b 100644 --- a/drivers/spi/intel_spi_priv.h +++ b/drivers/spi/intel_spi_priv.h @@ -33,6 +33,40 @@ #ifndef __INTEL_SPI_PRIV_H__ #define __INTEL_SPI_PRIV_H__ +#ifdef CONFIG_PCI +#include +#include +#endif /* CONFIG_PCI */ + +typedef void (*spi_intel_config_t)(struct device *dev); + +struct spi_intel_config { + uint32_t regs; + uint32_t irq; +#ifdef CONFIG_PCI + struct pci_dev_info pci_dev; +#endif /* CONFIG_PCI */ + spi_intel_config_t config_func; +#ifdef CONFIG_SPI_INTEL_CS_GPIO + char *cs_gpio_name; + uint32_t cs_gpio_pin; +#endif /* CONFIG_SPI_INTEL_CS_GPIO */ +}; + +struct spi_intel_data { +#ifdef CONFIG_SPI_INTEL_CS_GPIO + struct device *cs_gpio_port; +#endif /* CONFIG_SPI_INTEL_CS_GPIO */ + uint32_t sscr0; + uint32_t sscr1; + spi_callback callback; + uint8_t *tx_buf; + uint32_t tx_buf_len; + uint8_t *rx_buf; + uint32_t rx_buf_len; + uint32_t t_len; +}; + /* Registers */ #define INTEL_SPI_REG_SSCR0 (0x00) #define INTEL_SPI_REG_SSRC1 (0x04) diff --git a/include/drivers/spi/intel_spi.h b/include/drivers/spi/intel_spi.h index ea99454910..889e337011 100644 --- a/include/drivers/spi/intel_spi.h +++ b/include/drivers/spi/intel_spi.h @@ -33,49 +33,6 @@ #ifndef __INTEL_SPI_H__ #define __INTEL_SPI_H__ -#include - -#ifdef CONFIG_PCI -#include -#include -#endif /* CONFIG_PCI */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void spi_intel_isr(void *data); - -int spi_intel_init(struct device *dev); -typedef void (*spi_intel_config_t)(struct device *dev); - -struct spi_intel_config { - uint32_t regs; - uint32_t irq; -#ifdef CONFIG_PCI - struct pci_dev_info pci_dev; -#endif /* CONFIG_PCI */ - spi_intel_config_t config_func; -#ifdef CONFIG_SPI_INTEL_CS_GPIO - char *cs_gpio_name; - uint32_t cs_gpio_pin; -#endif /* CONFIG_SPI_INTEL_CS_GPIO */ -}; - -struct spi_intel_data { -#ifdef CONFIG_SPI_INTEL_CS_GPIO - struct device *cs_gpio_port; -#endif /* CONFIG_SPI_INTEL_CS_GPIO */ - uint32_t sscr0; - uint32_t sscr1; - spi_callback callback; - uint8_t *tx_buf; - uint32_t tx_buf_len; - uint8_t *rx_buf; - uint32_t rx_buf_len; - uint32_t t_len; -}; - /* SPI Maximum supported system frequencies */ #define SPI_MAX_CLK_FREQ_25MHZ ((0x800000 << 8)) #define SPI_MAX_CLK_FREQ_20MHz ((0x666666 << 8) | 1) @@ -110,8 +67,4 @@ struct spi_intel_data { #define SPI_MAX_CLK_FREQ_5KHZ ((0x20000 << 8) | 154) #define SPI_MAX_CLK_FREQ_1KHZ ((0x8000 << 8) | 194) -#ifdef __cplusplus -} -#endif - #endif /* __INTEL_SPI_H__ */