Lines Matching full:mps

38 #define psc_addr(mps, regname) ({					\  argument
40 switch (mps->type) { \
42 struct mpc52xx_psc __iomem *psc = mps->psc; \
47 struct mpc5125_psc __iomem *psc = mps->psc; \
95 struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master); in mpc512x_psc_spi_activate_cs() local
101 sicr = in_be32(psc_addr(mps, sicr)); in mpc512x_psc_spi_activate_cs()
118 out_be32(psc_addr(mps, sicr), sicr); in mpc512x_psc_spi_activate_cs()
120 ccr = in_be32(psc_addr(mps, ccr)); in mpc512x_psc_spi_activate_cs()
125 bclkdiv = (mps->mclk_rate / speed) - 1; in mpc512x_psc_spi_activate_cs()
128 out_be32(psc_addr(mps, ccr), ccr); in mpc512x_psc_spi_activate_cs()
129 mps->bits_per_word = cs->bits_per_word; in mpc512x_psc_spi_activate_cs()
131 if (mps->cs_control && gpio_is_valid(spi->cs_gpio)) in mpc512x_psc_spi_activate_cs()
132 mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 1 : 0); in mpc512x_psc_spi_activate_cs()
137 struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master); in mpc512x_psc_spi_deactivate_cs() local
139 if (mps->cs_control && gpio_is_valid(spi->cs_gpio)) in mpc512x_psc_spi_deactivate_cs()
140 mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 0 : 1); in mpc512x_psc_spi_deactivate_cs()
152 struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master); in mpc512x_psc_spi_transfer_rxtx() local
153 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_transfer_rxtx()
191 reinit_completion(&mps->txisrdone); in mpc512x_psc_spi_transfer_rxtx()
194 wait_for_completion(&mps->txisrdone); in mpc512x_psc_spi_transfer_rxtx()
335 struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); in mpc512x_psc_spi_prep_xfer_hw() local
340 in_8(psc_addr(mps, mr2)); in mpc512x_psc_spi_prep_xfer_hw()
341 out_8(psc_addr(mps, mr2), 0x0); in mpc512x_psc_spi_prep_xfer_hw()
344 out_8(psc_addr(mps, command), MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE); in mpc512x_psc_spi_prep_xfer_hw()
351 struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); in mpc512x_psc_spi_unprep_xfer_hw() local
352 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_unprep_xfer_hw()
357 out_8(psc_addr(mps, command), MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE); in mpc512x_psc_spi_unprep_xfer_hw()
405 struct mpc512x_psc_spi *mps) in mpc512x_psc_spi_port_config() argument
407 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_port_config()
414 out_8(psc_addr(mps, command), MPC52xx_PSC_RST_RX); in mpc512x_psc_spi_port_config()
415 out_8(psc_addr(mps, command), MPC52xx_PSC_RST_TX); in mpc512x_psc_spi_port_config()
416 out_8(psc_addr(mps, command), MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE); in mpc512x_psc_spi_port_config()
419 out_be16(psc_addr(mps, isr_imr.imr), 0); in mpc512x_psc_spi_port_config()
435 out_be32(psc_addr(mps, sicr), sicr); in mpc512x_psc_spi_port_config()
437 ccr = in_be32(psc_addr(mps, ccr)); in mpc512x_psc_spi_port_config()
440 bclkdiv = (mps->mclk_rate / speed) - 1; in mpc512x_psc_spi_port_config()
442 out_be32(psc_addr(mps, ccr), ccr); in mpc512x_psc_spi_port_config()
445 out_8(psc_addr(mps, ctur), 0x00); in mpc512x_psc_spi_port_config()
446 out_8(psc_addr(mps, ctlr), 0x82); in mpc512x_psc_spi_port_config()
458 mps->bits_per_word = 8; in mpc512x_psc_spi_port_config()
465 struct mpc512x_psc_spi *mps = (struct mpc512x_psc_spi *)dev_id; in mpc512x_psc_spi_isr() local
466 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_isr()
473 complete(&mps->txisrdone); in mpc512x_psc_spi_isr()
488 struct mpc512x_psc_spi *mps; in mpc512x_psc_spi_do_probe() local
494 master = spi_alloc_master(dev, sizeof *mps); in mpc512x_psc_spi_do_probe()
499 mps = spi_master_get_devdata(master); in mpc512x_psc_spi_do_probe()
500 mps->type = (int)of_device_get_match_data(dev); in mpc512x_psc_spi_do_probe()
501 mps->irq = irq; in mpc512x_psc_spi_do_probe()
504 mps->cs_control = mpc512x_spi_cs_control; in mpc512x_psc_spi_do_probe()
506 mps->cs_control = pdata->cs_control; in mpc512x_psc_spi_do_probe()
525 mps->psc = tempp; in mpc512x_psc_spi_do_probe()
526 mps->fifo = in mpc512x_psc_spi_do_probe()
528 ret = devm_request_irq(dev, mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED, in mpc512x_psc_spi_do_probe()
529 "mpc512x-psc-spi", mps); in mpc512x_psc_spi_do_probe()
532 init_completion(&mps->txisrdone); in mpc512x_psc_spi_do_probe()
542 mps->clk_mclk = clk; in mpc512x_psc_spi_do_probe()
543 mps->mclk_rate = clk_get_rate(clk); in mpc512x_psc_spi_do_probe()
553 mps->clk_ipg = clk; in mpc512x_psc_spi_do_probe()
555 ret = mpc512x_psc_spi_port_config(master, mps); in mpc512x_psc_spi_do_probe()
566 clk_disable_unprepare(mps->clk_ipg); in mpc512x_psc_spi_do_probe()
568 clk_disable_unprepare(mps->clk_mclk); in mpc512x_psc_spi_do_probe()
578 struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); in mpc512x_psc_spi_do_remove() local
580 clk_disable_unprepare(mps->clk_mclk); in mpc512x_psc_spi_do_remove()
581 clk_disable_unprepare(mps->clk_ipg); in mpc512x_psc_spi_do_remove()