Lines Matching refs:orion_spi

92 struct orion_spi {  struct
108 static inline void __iomem *spi_reg(struct orion_spi *orion_spi, u32 reg) in spi_reg() argument
110 return orion_spi->base + reg; in spi_reg()
114 orion_spi_setbits(struct orion_spi *orion_spi, u32 reg, u32 mask) in orion_spi_setbits() argument
116 void __iomem *reg_addr = spi_reg(orion_spi, reg); in orion_spi_setbits()
125 orion_spi_clrbits(struct orion_spi *orion_spi, u32 reg, u32 mask) in orion_spi_clrbits() argument
127 void __iomem *reg_addr = spi_reg(orion_spi, reg); in orion_spi_clrbits()
141 struct orion_spi *orion_spi; in orion_spi_baudrate_set() local
144 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_baudrate_set()
145 devdata = orion_spi->devdata; in orion_spi_baudrate_set()
147 tclk_hz = clk_get_rate(orion_spi->clk); in orion_spi_baudrate_set()
225 reg = readl(spi_reg(orion_spi, ORION_SPI_IF_CONFIG_REG)); in orion_spi_baudrate_set()
227 writel(reg, spi_reg(orion_spi, ORION_SPI_IF_CONFIG_REG)); in orion_spi_baudrate_set()
236 struct orion_spi *orion_spi; in orion_spi_mode_set() local
238 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_mode_set()
240 reg = readl(spi_reg(orion_spi, ORION_SPI_IF_CONFIG_REG)); in orion_spi_mode_set()
251 writel(reg, spi_reg(orion_spi, ORION_SPI_IF_CONFIG_REG)); in orion_spi_mode_set()
258 struct orion_spi *orion_spi; in orion_spi_50mhz_ac_timing_erratum() local
260 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_50mhz_ac_timing_erratum()
276 reg = readl(spi_reg(orion_spi, ORION_SPI_TIMING_PARAMS_REG)); in orion_spi_50mhz_ac_timing_erratum()
279 if (clk_get_rate(orion_spi->clk) == 250000000 && in orion_spi_50mhz_ac_timing_erratum()
286 writel(reg, spi_reg(orion_spi, ORION_SPI_TIMING_PARAMS_REG)); in orion_spi_50mhz_ac_timing_erratum()
295 struct orion_spi *orion_spi; in orion_spi_setup_transfer() local
300 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_setup_transfer()
310 if (orion_spi->devdata->is_errata_50mhz_ac) in orion_spi_setup_transfer()
318 orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG, in orion_spi_setup_transfer()
321 orion_spi_clrbits(orion_spi, ORION_SPI_IF_CONFIG_REG, in orion_spi_setup_transfer()
329 struct orion_spi *orion_spi; in orion_spi_set_cs() local
333 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_set_cs()
334 ctrl_reg = spi_reg(orion_spi, ORION_SPI_IF_CTRL_REG); in orion_spi_set_cs()
367 static inline int orion_spi_wait_till_ready(struct orion_spi *orion_spi) in orion_spi_wait_till_ready() argument
372 if (readl(spi_reg(orion_spi, ORION_SPI_INT_CAUSE_REG))) in orion_spi_wait_till_ready()
386 struct orion_spi *orion_spi; in orion_spi_write_read_8bit() local
391 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_write_read_8bit()
396 tx_reg = spi_reg(orion_spi, ORION_SPI_DATA_OUT_REG); in orion_spi_write_read_8bit()
397 rx_reg = spi_reg(orion_spi, ORION_SPI_DATA_IN_REG); in orion_spi_write_read_8bit()
398 int_reg = spi_reg(orion_spi, ORION_SPI_INT_CAUSE_REG); in orion_spi_write_read_8bit()
408 if (orion_spi_wait_till_ready(orion_spi) < 0) { in orion_spi_write_read_8bit()
435 struct orion_spi *orion_spi; in orion_spi_write_read_16bit() local
442 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_write_read_16bit()
443 tx_reg = spi_reg(orion_spi, ORION_SPI_DATA_OUT_REG); in orion_spi_write_read_16bit()
444 rx_reg = spi_reg(orion_spi, ORION_SPI_DATA_IN_REG); in orion_spi_write_read_16bit()
445 int_reg = spi_reg(orion_spi, ORION_SPI_INT_CAUSE_REG); in orion_spi_write_read_16bit()
455 if (orion_spi_wait_till_ready(orion_spi) < 0) { in orion_spi_write_read_16bit()
471 struct orion_spi *orion_spi; in orion_spi_write_read() local
478 orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_write_read()
485 vaddr = orion_spi->child[cs].direct_access.vaddr; in orion_spi_write_read()
551 struct orion_spi *orion_spi = spi_controller_get_devdata(spi->controller); in orion_spi_setup() local
552 struct device *dev = orion_spi->dev; in orion_spi_setup()
566 static int orion_spi_reset(struct orion_spi *orion_spi) in orion_spi_reset() argument
569 orion_spi_clrbits(orion_spi, ORION_SPI_IF_CTRL_REG, 0x1); in orion_spi_reset()
572 writel(0, spi_reg(orion_spi, SPI_DIRECT_WRITE_CONFIG_REG)); in orion_spi_reset()
648 struct orion_spi *spi; in orion_spi_probe()
803 struct orion_spi *spi = spi_controller_get_devdata(host); in orion_spi_remove()
818 struct orion_spi *spi = spi_controller_get_devdata(host); in orion_spi_runtime_suspend()
828 struct orion_spi *spi = spi_controller_get_devdata(host); in orion_spi_runtime_resume()