• Home
  • Raw
  • Download

Lines Matching refs:master

195 static int mtk_spi_prepare_message(struct spi_master *master,  in mtk_spi_prepare_message()  argument
202 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_prepare_message()
270 struct mtk_spi *mdata = spi_master_get_devdata(spi->master); in mtk_spi_set_cs()
287 static void mtk_spi_prepare_transfer(struct spi_master *master, in mtk_spi_prepare_transfer() argument
291 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_prepare_transfer()
328 static void mtk_spi_setup_packet(struct spi_master *master) in mtk_spi_setup_packet() argument
331 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_setup_packet()
343 static void mtk_spi_enable_transfer(struct spi_master *master) in mtk_spi_enable_transfer() argument
346 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_enable_transfer()
368 static void mtk_spi_update_mdata_len(struct spi_master *master) in mtk_spi_update_mdata_len() argument
371 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_update_mdata_len()
396 static void mtk_spi_setup_dma_addr(struct spi_master *master, in mtk_spi_setup_dma_addr() argument
399 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_setup_dma_addr()
422 static int mtk_spi_fifo_transfer(struct spi_master *master, in mtk_spi_fifo_transfer() argument
428 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_fifo_transfer()
433 mtk_spi_prepare_transfer(master, xfer); in mtk_spi_fifo_transfer()
434 mtk_spi_setup_packet(master); in mtk_spi_fifo_transfer()
447 mtk_spi_enable_transfer(master); in mtk_spi_fifo_transfer()
452 static int mtk_spi_dma_transfer(struct spi_master *master, in mtk_spi_dma_transfer() argument
457 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_dma_transfer()
466 mtk_spi_prepare_transfer(master, xfer); in mtk_spi_dma_transfer()
489 mtk_spi_update_mdata_len(master); in mtk_spi_dma_transfer()
490 mtk_spi_setup_packet(master); in mtk_spi_dma_transfer()
491 mtk_spi_setup_dma_addr(master, xfer); in mtk_spi_dma_transfer()
492 mtk_spi_enable_transfer(master); in mtk_spi_dma_transfer()
497 static int mtk_spi_transfer_one(struct spi_master *master, in mtk_spi_transfer_one() argument
501 if (master->can_dma(master, spi, xfer)) in mtk_spi_transfer_one()
502 return mtk_spi_dma_transfer(master, spi, xfer); in mtk_spi_transfer_one()
504 return mtk_spi_fifo_transfer(master, spi, xfer); in mtk_spi_transfer_one()
507 static bool mtk_spi_can_dma(struct spi_master *master, in mtk_spi_can_dma() argument
519 struct mtk_spi *mdata = spi_master_get_devdata(spi->master); in mtk_spi_setup()
533 struct spi_master *master = dev_id; in mtk_spi_interrupt() local
534 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_interrupt()
543 if (!master->can_dma(master, NULL, trans)) { in mtk_spi_interrupt()
561 spi_finalize_current_transfer(master); in mtk_spi_interrupt()
567 mtk_spi_setup_packet(master); in mtk_spi_interrupt()
582 mtk_spi_enable_transfer(master); in mtk_spi_interrupt()
614 spi_finalize_current_transfer(master); in mtk_spi_interrupt()
618 mtk_spi_update_mdata_len(master); in mtk_spi_interrupt()
619 mtk_spi_setup_packet(master); in mtk_spi_interrupt()
620 mtk_spi_setup_dma_addr(master, trans); in mtk_spi_interrupt()
621 mtk_spi_enable_transfer(master); in mtk_spi_interrupt()
628 struct spi_master *master; in mtk_spi_probe() local
633 master = spi_alloc_master(&pdev->dev, sizeof(*mdata)); in mtk_spi_probe()
634 if (!master) { in mtk_spi_probe()
639 master->auto_runtime_pm = true; in mtk_spi_probe()
640 master->dev.of_node = pdev->dev.of_node; in mtk_spi_probe()
641 master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; in mtk_spi_probe()
643 master->set_cs = mtk_spi_set_cs; in mtk_spi_probe()
644 master->prepare_message = mtk_spi_prepare_message; in mtk_spi_probe()
645 master->transfer_one = mtk_spi_transfer_one; in mtk_spi_probe()
646 master->can_dma = mtk_spi_can_dma; in mtk_spi_probe()
647 master->setup = mtk_spi_setup; in mtk_spi_probe()
656 mdata = spi_master_get_devdata(master); in mtk_spi_probe()
660 master->mode_bits |= SPI_CS_HIGH; in mtk_spi_probe()
663 master->flags = SPI_MASTER_MUST_TX; in mtk_spi_probe()
696 platform_set_drvdata(pdev, master); in mtk_spi_probe()
713 IRQF_TRIGGER_NONE, dev_name(&pdev->dev), master); in mtk_spi_probe()
757 ret = devm_spi_register_master(&pdev->dev, master); in mtk_spi_probe()
764 if (mdata->pad_num != master->num_chipselect) { in mtk_spi_probe()
767 mdata->pad_num, master->num_chipselect); in mtk_spi_probe()
772 if (!master->cs_gpios && master->num_chipselect > 1) { in mtk_spi_probe()
779 if (master->cs_gpios) { in mtk_spi_probe()
780 for (i = 0; i < master->num_chipselect; i++) { in mtk_spi_probe()
782 master->cs_gpios[i], in mtk_spi_probe()
807 spi_master_put(master); in mtk_spi_probe()
814 struct spi_master *master = platform_get_drvdata(pdev); in mtk_spi_remove() local
815 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_remove()
828 struct spi_master *master = dev_get_drvdata(dev); in mtk_spi_suspend() local
829 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_suspend()
831 ret = spi_master_suspend(master); in mtk_spi_suspend()
844 struct spi_master *master = dev_get_drvdata(dev); in mtk_spi_resume() local
845 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_resume()
855 ret = spi_master_resume(master); in mtk_spi_resume()
866 struct spi_master *master = dev_get_drvdata(dev); in mtk_spi_runtime_suspend() local
867 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_runtime_suspend()
876 struct spi_master *master = dev_get_drvdata(dev); in mtk_spi_runtime_resume() local
877 struct mtk_spi *mdata = spi_master_get_devdata(master); in mtk_spi_runtime_resume()