Lines Matching full:mps

35 #define psc_addr(mps, regname) ({					\  argument
37 switch (mps->type) { \
39 struct mpc52xx_psc __iomem *psc = mps->psc; \
44 struct mpc5125_psc __iomem *psc = mps->psc; \
88 struct mpc512x_psc_spi *mps = spi_controller_get_devdata(spi->controller); in mpc512x_psc_spi_activate_cs() local
94 sicr = in_be32(psc_addr(mps, sicr)); in mpc512x_psc_spi_activate_cs()
111 out_be32(psc_addr(mps, sicr), sicr); in mpc512x_psc_spi_activate_cs()
113 ccr = in_be32(psc_addr(mps, ccr)); in mpc512x_psc_spi_activate_cs()
118 bclkdiv = (mps->mclk_rate / speed) - 1; in mpc512x_psc_spi_activate_cs()
121 out_be32(psc_addr(mps, ccr), ccr); in mpc512x_psc_spi_activate_cs()
122 mps->bits_per_word = cs->bits_per_word; in mpc512x_psc_spi_activate_cs()
146 struct mpc512x_psc_spi *mps = spi_controller_get_devdata(spi->controller); in mpc512x_psc_spi_transfer_rxtx() local
147 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_transfer_rxtx()
185 reinit_completion(&mps->txisrdone); in mpc512x_psc_spi_transfer_rxtx()
188 wait_for_completion(&mps->txisrdone); in mpc512x_psc_spi_transfer_rxtx()
329 struct mpc512x_psc_spi *mps = spi_controller_get_devdata(host); in mpc512x_psc_spi_prep_xfer_hw() local
334 in_8(psc_addr(mps, mr2)); in mpc512x_psc_spi_prep_xfer_hw()
335 out_8(psc_addr(mps, mr2), 0x0); in mpc512x_psc_spi_prep_xfer_hw()
338 out_8(psc_addr(mps, command), MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE); in mpc512x_psc_spi_prep_xfer_hw()
345 struct mpc512x_psc_spi *mps = spi_controller_get_devdata(host); in mpc512x_psc_spi_unprep_xfer_hw() local
346 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_unprep_xfer_hw()
351 out_8(psc_addr(mps, command), MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE); in mpc512x_psc_spi_unprep_xfer_hw()
384 struct mpc512x_psc_spi *mps) in mpc512x_psc_spi_port_config() argument
386 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_port_config()
393 out_8(psc_addr(mps, command), MPC52xx_PSC_RST_RX); in mpc512x_psc_spi_port_config()
394 out_8(psc_addr(mps, command), MPC52xx_PSC_RST_TX); in mpc512x_psc_spi_port_config()
395 out_8(psc_addr(mps, command), MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE); in mpc512x_psc_spi_port_config()
398 out_be16(psc_addr(mps, isr_imr.imr), 0); in mpc512x_psc_spi_port_config()
414 out_be32(psc_addr(mps, sicr), sicr); in mpc512x_psc_spi_port_config()
416 ccr = in_be32(psc_addr(mps, ccr)); in mpc512x_psc_spi_port_config()
419 bclkdiv = (mps->mclk_rate / speed) - 1; in mpc512x_psc_spi_port_config()
421 out_be32(psc_addr(mps, ccr), ccr); in mpc512x_psc_spi_port_config()
424 out_8(psc_addr(mps, ctur), 0x00); in mpc512x_psc_spi_port_config()
425 out_8(psc_addr(mps, ctlr), 0x82); in mpc512x_psc_spi_port_config()
437 mps->bits_per_word = 8; in mpc512x_psc_spi_port_config()
444 struct mpc512x_psc_spi *mps = (struct mpc512x_psc_spi *)dev_id; in mpc512x_psc_spi_isr() local
445 struct mpc512x_psc_fifo __iomem *fifo = mps->fifo; in mpc512x_psc_spi_isr()
452 complete(&mps->txisrdone); in mpc512x_psc_spi_isr()
461 struct mpc512x_psc_spi *mps; in mpc512x_psc_spi_of_probe() local
467 host = devm_spi_alloc_host(dev, sizeof(*mps)); in mpc512x_psc_spi_of_probe()
472 mps = spi_controller_get_devdata(host); in mpc512x_psc_spi_of_probe()
473 mps->type = (int)device_get_match_data(dev); in mpc512x_psc_spi_of_probe()
488 mps->psc = tempp; in mpc512x_psc_spi_of_probe()
489 mps->fifo = in mpc512x_psc_spi_of_probe()
492 mps->irq = platform_get_irq(pdev, 0); in mpc512x_psc_spi_of_probe()
493 if (mps->irq < 0) in mpc512x_psc_spi_of_probe()
494 return mps->irq; in mpc512x_psc_spi_of_probe()
496 ret = devm_request_irq(dev, mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED, in mpc512x_psc_spi_of_probe()
497 "mpc512x-psc-spi", mps); in mpc512x_psc_spi_of_probe()
500 init_completion(&mps->txisrdone); in mpc512x_psc_spi_of_probe()
506 mps->mclk_rate = clk_get_rate(clk); in mpc512x_psc_spi_of_probe()
512 ret = mpc512x_psc_spi_port_config(host, mps); in mpc512x_psc_spi_of_probe()