Lines Matching refs:ss

79 static void sh_qspi_init(struct sh_qspi_slave *ss)  in sh_qspi_init()  argument
83 writeb(SPCR_MSTR, &ss->regs->spcr); in sh_qspi_init()
86 writeb(0x00, &ss->regs->sslp); in sh_qspi_init()
89 writeb(SPPCR_IO3FV|SPPCR_IO2FV, &ss->regs->sppcr); in sh_qspi_init()
92 writeb(0x01, &ss->regs->spbr); in sh_qspi_init()
95 writeb(0x00, &ss->regs->spdcr); in sh_qspi_init()
98 writeb(0x00, &ss->regs->spckd); in sh_qspi_init()
101 writeb(0x00, &ss->regs->sslnd); in sh_qspi_init()
104 writeb(0x00, &ss->regs->spnd); in sh_qspi_init()
107 writew(SPCMD_INIT2, &ss->regs->spcmd0); in sh_qspi_init()
110 setbits_8(&ss->regs->spbfcr, SPBFCR_TXRST|SPBFCR_RXRST); in sh_qspi_init()
113 clrbits_8(&ss->regs->spbfcr, SPBFCR_TXRST|SPBFCR_RXRST); in sh_qspi_init()
116 writeb(0x00, &ss->regs->spscr); in sh_qspi_init()
119 setbits_8(&ss->regs->spcr, SPCR_SPE); in sh_qspi_init()
129 struct sh_qspi_slave *ss = to_sh_qspi(slave); in spi_cs_activate() local
132 writeb(SPCR_MSTR, &ss->regs->spcr); in spi_cs_activate()
135 writew(SPCMD_INIT1, &ss->regs->spcmd0); in spi_cs_activate()
138 setbits_8(&ss->regs->spbfcr, SPBFCR_TXRST|SPBFCR_RXRST); in spi_cs_activate()
141 clrbits_8(&ss->regs->spbfcr, SPBFCR_TXRST|SPBFCR_RXRST); in spi_cs_activate()
144 writeb(0x00, &ss->regs->spscr); in spi_cs_activate()
147 setbits_8(&ss->regs->spcr, SPCR_SPE); in spi_cs_activate()
152 struct sh_qspi_slave *ss = to_sh_qspi(slave); in spi_cs_deactivate() local
155 clrbits_8(&ss->regs->spcr, SPCR_SPE); in spi_cs_deactivate()
166 struct sh_qspi_slave *ss; in spi_setup_slave() local
171 ss = spi_alloc_slave(struct sh_qspi_slave, bus, cs); in spi_setup_slave()
172 if (!ss) { in spi_setup_slave()
177 ss->regs = (struct sh_qspi_regs *)SH_QSPI_BASE; in spi_setup_slave()
180 sh_qspi_init(ss); in spi_setup_slave()
182 return &ss->slave; in spi_setup_slave()
204 struct sh_qspi_slave *ss = to_sh_qspi(slave); in spi_xfer() local
209 u32 *spbmul0 = &ss->regs->spbmul0; in spi_xfer()
247 clrsetbits_8(&ss->regs->spbfcr, SPBFCR_TXTRG | SPBFCR_RXTRG, in spi_xfer()
250 ret = wait_for_bit_8(&ss->regs->spsr, SPSR_SPTEF, in spi_xfer()
256 writeb(*tdata, &ss->regs->spdr); in spi_xfer()
261 ret = wait_for_bit_8(&ss->regs->spsr, SPSR_SPRFF, in spi_xfer()
267 *rdata = readb(&ss->regs->spdr); in spi_xfer()