Lines Matching full:mps
74 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); in mpc52xx_psc_spi_activate_cs() local
75 struct mpc52xx_psc __iomem *psc = mps->psc; in mpc52xx_psc_spi_activate_cs()
108 mps->bits_per_word = cs->bits_per_word; in mpc52xx_psc_spi_activate_cs()
110 if (mps->cs_control) in mpc52xx_psc_spi_activate_cs()
111 mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 1 : 0); in mpc52xx_psc_spi_activate_cs()
116 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); in mpc52xx_psc_spi_deactivate_cs() local
118 if (mps->cs_control) in mpc52xx_psc_spi_deactivate_cs()
119 mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 0 : 1); in mpc52xx_psc_spi_deactivate_cs()
129 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); in mpc52xx_psc_spi_transfer_rxtx() local
130 struct mpc52xx_psc __iomem *psc = mps->psc; in mpc52xx_psc_spi_transfer_rxtx()
131 struct mpc52xx_psc_fifo __iomem *fifo = mps->fifo; in mpc52xx_psc_spi_transfer_rxtx()
181 wait_for_completion(&mps->done); in mpc52xx_psc_spi_transfer_rxtx()
202 struct mpc52xx_psc_spi *mps = in mpc52xx_psc_spi_work() local
205 spin_lock_irq(&mps->lock); in mpc52xx_psc_spi_work()
206 mps->busy = 1; in mpc52xx_psc_spi_work()
207 while (!list_empty(&mps->queue)) { in mpc52xx_psc_spi_work()
214 m = container_of(mps->queue.next, struct spi_message, queue); in mpc52xx_psc_spi_work()
216 spin_unlock_irq(&mps->lock); in mpc52xx_psc_spi_work()
252 spin_lock_irq(&mps->lock); in mpc52xx_psc_spi_work()
254 mps->busy = 0; in mpc52xx_psc_spi_work()
255 spin_unlock_irq(&mps->lock); in mpc52xx_psc_spi_work()
260 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); in mpc52xx_psc_spi_setup() local
277 spin_lock_irqsave(&mps->lock, flags); in mpc52xx_psc_spi_setup()
278 if (!mps->busy) in mpc52xx_psc_spi_setup()
280 spin_unlock_irqrestore(&mps->lock, flags); in mpc52xx_psc_spi_setup()
288 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(spi->master); in mpc52xx_psc_spi_transfer() local
294 spin_lock_irqsave(&mps->lock, flags); in mpc52xx_psc_spi_transfer()
295 list_add_tail(&m->queue, &mps->queue); in mpc52xx_psc_spi_transfer()
296 schedule_work(&mps->work); in mpc52xx_psc_spi_transfer()
297 spin_unlock_irqrestore(&mps->lock, flags); in mpc52xx_psc_spi_transfer()
307 static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps) in mpc52xx_psc_spi_port_config() argument
309 struct mpc52xx_psc __iomem *psc = mps->psc; in mpc52xx_psc_spi_port_config()
310 struct mpc52xx_psc_fifo __iomem *fifo = mps->fifo; in mpc52xx_psc_spi_port_config()
315 mclken_div = (mps->sysclk ? mps->sysclk : 512000000) / MCLK; in mpc52xx_psc_spi_port_config()
340 mps->bits_per_word = 8; in mpc52xx_psc_spi_port_config()
347 struct mpc52xx_psc_spi *mps = (struct mpc52xx_psc_spi *)dev_id; in mpc52xx_psc_spi_isr() local
348 struct mpc52xx_psc __iomem *psc = mps->psc; in mpc52xx_psc_spi_isr()
353 complete(&mps->done); in mpc52xx_psc_spi_isr()
364 struct mpc52xx_psc_spi *mps; in mpc52xx_psc_spi_do_probe() local
368 master = spi_alloc_master(dev, sizeof *mps); in mpc52xx_psc_spi_do_probe()
373 mps = spi_master_get_devdata(master); in mpc52xx_psc_spi_do_probe()
378 mps->irq = irq; in mpc52xx_psc_spi_do_probe()
382 mps->cs_control = NULL; in mpc52xx_psc_spi_do_probe()
383 mps->sysclk = 0; in mpc52xx_psc_spi_do_probe()
387 mps->cs_control = pdata->cs_control; in mpc52xx_psc_spi_do_probe()
388 mps->sysclk = pdata->sysclk; in mpc52xx_psc_spi_do_probe()
397 mps->psc = ioremap(regaddr, size); in mpc52xx_psc_spi_do_probe()
398 if (!mps->psc) { in mpc52xx_psc_spi_do_probe()
404 mps->fifo = ((void __iomem *)mps->psc) + sizeof(struct mpc52xx_psc); in mpc52xx_psc_spi_do_probe()
406 ret = request_irq(mps->irq, mpc52xx_psc_spi_isr, 0, "mpc52xx-psc-spi", in mpc52xx_psc_spi_do_probe()
407 mps); in mpc52xx_psc_spi_do_probe()
411 ret = mpc52xx_psc_spi_port_config(master->bus_num, mps); in mpc52xx_psc_spi_do_probe()
417 spin_lock_init(&mps->lock); in mpc52xx_psc_spi_do_probe()
418 init_completion(&mps->done); in mpc52xx_psc_spi_do_probe()
419 INIT_WORK(&mps->work, mpc52xx_psc_spi_work); in mpc52xx_psc_spi_do_probe()
420 INIT_LIST_HEAD(&mps->queue); in mpc52xx_psc_spi_do_probe()
429 free_irq(mps->irq, mps); in mpc52xx_psc_spi_do_probe()
431 if (mps->psc) in mpc52xx_psc_spi_do_probe()
432 iounmap(mps->psc); in mpc52xx_psc_spi_do_probe()
470 struct mpc52xx_psc_spi *mps = spi_master_get_devdata(master); in mpc52xx_psc_spi_of_remove() local
472 flush_work(&mps->work); in mpc52xx_psc_spi_of_remove()
474 free_irq(mps->irq, mps); in mpc52xx_psc_spi_of_remove()
475 if (mps->psc) in mpc52xx_psc_spi_of_remove()
476 iounmap(mps->psc); in mpc52xx_psc_spi_of_remove()