diff options
author | Jan Glauber <jglauber@cavium.com> | 2016-07-23 13:42:54 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-07-24 23:54:29 +0300 |
commit | 63d49afefc87d1503956185e94fad43140c2ba9e (patch) | |
tree | f095ecbf390b383ae0e42bbe2b8f88534af0c224 /drivers/spi/spi-cavium.h | |
parent | 22cc1b6b35ce560ebf9252027397d5f1b92bfa9b (diff) | |
download | linux-63d49afefc87d1503956185e94fad43140c2ba9e.tar.xz |
spi: octeon: Split driver into Octeon specific and common parts
Separate driver probing from SPI transfer functions.
Signed-off-by: Jan Glauber <jglauber@cavium.com>
Tested-by: Steven J. Hill <steven.hill@cavium.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-cavium.h')
-rw-r--r-- | drivers/spi/spi-cavium.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/spi/spi-cavium.h b/drivers/spi/spi-cavium.h index d41dba5968fd..88c5f36e7ea7 100644 --- a/drivers/spi/spi-cavium.h +++ b/drivers/spi/spi-cavium.h @@ -1,3 +1,32 @@ +#ifndef __SPI_CAVIUM_H +#define __SPI_CAVIUM_H + +#define OCTEON_SPI_MAX_BYTES 9 +#define OCTEON_SPI_MAX_CLOCK_HZ 16000000 + +struct octeon_spi_regs { + int config; + int status; + int tx; + int data; +}; + +struct octeon_spi { + void __iomem *register_base; + u64 last_cfg; + u64 cs_enax; + int sys_freq; + struct octeon_spi_regs regs; +}; + +#define OCTEON_SPI_CFG(x) (x->regs.config) +#define OCTEON_SPI_STS(x) (x->regs.status) +#define OCTEON_SPI_TX(x) (x->regs.tx) +#define OCTEON_SPI_DAT0(x) (x->regs.data) + +int octeon_spi_transfer_one_message(struct spi_master *master, + struct spi_message *msg); + /* MPI register descriptions */ #define CVMX_MPI_CFG (CVMX_ADD_IO_SEG(0x0001070000001000ull)) @@ -296,3 +325,5 @@ union cvmx_mpi_tx { struct cvmx_mpi_tx_s cn66xx; struct cvmx_mpi_tx_cn61xx cnf71xx; }; + +#endif /* __SPI_CAVIUM_H */ |