4 * Copyright (C) 2011 Renesas Solutions Corp.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 unsigned long tbr_rbr
;
39 #define SH_SPI_TBE 0x80
40 #define SH_SPI_TBF 0x40
41 #define SH_SPI_RBE 0x20
42 #define SH_SPI_RBF 0x10
43 #define SH_SPI_PFONRD 0x08
44 #define SH_SPI_SSDB 0x04
45 #define SH_SPI_SSD 0x02
46 #define SH_SPI_SSA 0x01
49 #define SH_SPI_RSTF 0x80
50 #define SH_SPI_LOOPBK 0x40
51 #define SH_SPI_CPOL 0x20
52 #define SH_SPI_CPHA 0x10
53 #define SH_SPI_L1M0 0x08
56 #define SH_SPI_MAX_BYTE 0xFF
59 #define SH_SPI_TBEI 0x80
60 #define SH_SPI_TBFI 0x40
61 #define SH_SPI_RBEI 0x20
62 #define SH_SPI_RBFI 0x10
63 #define SH_SPI_SSS1 0x08
64 #define SH_SPI_WPABRT 0x04
65 #define SH_SPI_SSS0 0x01
67 #define SH_SPI_FIFO_SIZE 32
68 #define SH_SPI_NUM_CS 4
71 struct spi_slave slave
;
72 struct sh_spi_regs
*regs
;
75 static inline struct sh_spi
*to_sh_spi(struct spi_slave
*slave
)
77 return container_of(slave
, struct sh_spi
, slave
);