Lines Matching refs:SPI_REG
81 #define SPI_REG(priv, reg) ((priv)->base + \ macro
149 byte = readb(SPI_REG(priv, SPI_RXD)); in sun4i_spi_drain_fifo()
161 writeb(byte, SPI_REG(priv, SPI_TXD)); in sun4i_spi_fill_fifo()
170 reg = readl(SPI_REG(priv, SPI_TCR)); in sun4i_spi_set_cs()
180 writel(reg, SPI_REG(priv, SPI_TCR)); in sun4i_spi_set_cs()
314 setbits_le32(SPI_REG(priv, SPI_GCR), SUN4I_CTL_ENABLE | in sun4i_spi_claim_bus()
318 setbits_le32(SPI_REG(priv, SPI_GCR), in sun4i_spi_claim_bus()
321 setbits_le32(SPI_REG(priv, SPI_TCR), SPI_BIT(priv, SPI_TCR_CS_MANUAL) | in sun4i_spi_claim_bus()
331 clrbits_le32(SPI_REG(priv, SPI_GCR), SUN4I_CTL_ENABLE); in sun4i_spi_release_bus()
362 setbits_le32(SPI_REG(priv, SPI_FCR), SPI_BIT(priv, SPI_FCR_RF_RST) | in sun4i_spi_xfer()
370 writel(SUN4I_BURST_CNT(nbytes), SPI_REG(priv, SPI_BC)); in sun4i_spi_xfer()
371 writel(SUN4I_XMIT_CNT(nbytes), SPI_REG(priv, SPI_TC)); in sun4i_spi_xfer()
375 SPI_REG(priv, SPI_BCTL)); in sun4i_spi_xfer()
381 setbits_le32(SPI_REG(priv, SPI_TCR), in sun4i_spi_xfer()
385 ret = readl_poll_timeout(SPI_REG(priv, SPI_FSR), in sun4i_spi_xfer()
437 reg = readl(SPI_REG(priv, SPI_CCR)); in sun4i_spi_set_speed()
452 writel(reg, SPI_REG(priv, SPI_CCR)); in sun4i_spi_set_speed()
462 reg = readl(SPI_REG(priv, SPI_TCR)); in sun4i_spi_set_mode()
472 writel(reg, SPI_REG(priv, SPI_TCR)); in sun4i_spi_set_mode()