• Home
  • Raw
  • Download

Lines Matching refs:master

191 	struct spi_master *master;  member
248 int (*transfer_one)(struct spi_master *master, struct spi_device *spi,
469 dev_err(&rspi->master->dev, "transmit timeout\n"); in rspi_data_out()
483 dev_err(&rspi->master->dev, "receive timeout\n"); in rspi_data_in()
529 desc_rx = dmaengine_prep_slave_sg(rspi->master->dma_rx, in rspi_dma_transfer()
549 desc_tx = dmaengine_prep_slave_sg(rspi->master->dma_tx, in rspi_dma_transfer()
587 dma_async_issue_pending(rspi->master->dma_rx); in rspi_dma_transfer()
589 dma_async_issue_pending(rspi->master->dma_tx); in rspi_dma_transfer()
597 dev_err(&rspi->master->dev, "DMA timeout\n"); in rspi_dma_transfer()
601 dmaengine_terminate_all(rspi->master->dma_tx); in rspi_dma_transfer()
603 dmaengine_terminate_all(rspi->master->dma_rx); in rspi_dma_transfer()
617 dmaengine_terminate_all(rspi->master->dma_rx); in rspi_dma_transfer()
621 dev_driver_string(&rspi->master->dev), in rspi_dma_transfer()
622 dev_name(&rspi->master->dev)); in rspi_dma_transfer()
663 static bool rspi_can_dma(struct spi_master *master, struct spi_device *spi, in rspi_can_dma() argument
666 struct rspi_data *rspi = spi_master_get_devdata(master); in rspi_can_dma()
674 if (!rspi->master->can_dma || !__rspi_can_dma(rspi, xfer)) in rspi_dma_check_then_transfer()
701 static int rspi_transfer_one(struct spi_master *master, struct spi_device *spi, in rspi_transfer_one() argument
704 struct rspi_data *rspi = spi_master_get_devdata(master); in rspi_transfer_one()
719 static int rspi_rz_transfer_one(struct spi_master *master, in rspi_rz_transfer_one() argument
723 struct rspi_data *rspi = spi_master_get_devdata(master); in rspi_rz_transfer_one()
742 dev_err(&rspi->master->dev, "transmit timeout\n"); in qspi_trigger_transfer_out_in()
750 dev_err(&rspi->master->dev, "receive timeout\n"); in qspi_trigger_transfer_out_in()
785 if (rspi->master->can_dma && __rspi_can_dma(rspi, xfer)) { in qspi_transfer_out()
803 if (rspi->master->can_dma && __rspi_can_dma(rspi, xfer)) { in qspi_transfer_in()
812 static int qspi_transfer_one(struct spi_master *master, struct spi_device *spi, in qspi_transfer_one() argument
815 struct rspi_data *rspi = spi_master_get_devdata(master); in qspi_transfer_one()
833 struct rspi_data *rspi = spi_master_get_devdata(spi->master); in rspi_setup()
918 static int rspi_prepare_message(struct spi_master *master, in rspi_prepare_message() argument
921 struct rspi_data *rspi = spi_master_get_devdata(master); in rspi_prepare_message()
937 static int rspi_unprepare_message(struct spi_master *master, in rspi_unprepare_message() argument
940 struct rspi_data *rspi = spi_master_get_devdata(master); in rspi_unprepare_message()
1044 static int rspi_request_dma(struct device *dev, struct spi_master *master, in rspi_request_dma() argument
1062 master->dma_tx = rspi_request_dma_chan(dev, DMA_MEM_TO_DEV, dma_tx_id, in rspi_request_dma()
1064 if (!master->dma_tx) in rspi_request_dma()
1067 master->dma_rx = rspi_request_dma_chan(dev, DMA_DEV_TO_MEM, dma_rx_id, in rspi_request_dma()
1069 if (!master->dma_rx) { in rspi_request_dma()
1070 dma_release_channel(master->dma_tx); in rspi_request_dma()
1071 master->dma_tx = NULL; in rspi_request_dma()
1075 master->can_dma = rspi_can_dma; in rspi_request_dma()
1080 static void rspi_release_dma(struct spi_master *master) in rspi_release_dma() argument
1082 if (master->dma_tx) in rspi_release_dma()
1083 dma_release_channel(master->dma_tx); in rspi_release_dma()
1084 if (master->dma_rx) in rspi_release_dma()
1085 dma_release_channel(master->dma_rx); in rspi_release_dma()
1092 rspi_release_dma(rspi->master); in rspi_remove()
1137 static int rspi_parse_dt(struct device *dev, struct spi_master *master) in rspi_parse_dt() argument
1149 master->num_chipselect = num_cs; in rspi_parse_dt()
1154 static inline int rspi_parse_dt(struct device *dev, struct spi_master *master) in rspi_parse_dt() argument
1175 struct spi_master *master; in rspi_probe() local
1182 master = spi_alloc_master(&pdev->dev, sizeof(struct rspi_data)); in rspi_probe()
1183 if (master == NULL) { in rspi_probe()
1191 ret = rspi_parse_dt(&pdev->dev, master); in rspi_probe()
1198 master->num_chipselect = rspi_pd->num_chipselect; in rspi_probe()
1200 master->num_chipselect = 2; /* default */ in rspi_probe()
1210 rspi = spi_master_get_devdata(master); in rspi_probe()
1213 rspi->master = master; in rspi_probe()
1233 master->bus_num = pdev->id; in rspi_probe()
1234 master->setup = rspi_setup; in rspi_probe()
1235 master->auto_runtime_pm = true; in rspi_probe()
1236 master->transfer_one = ops->transfer_one; in rspi_probe()
1237 master->prepare_message = rspi_prepare_message; in rspi_probe()
1238 master->unprepare_message = rspi_unprepare_message; in rspi_probe()
1239 master->mode_bits = ops->mode_bits; in rspi_probe()
1240 master->flags = ops->flags; in rspi_probe()
1241 master->dev.of_node = pdev->dev.of_node; in rspi_probe()
1278 ret = rspi_request_dma(&pdev->dev, master, res); in rspi_probe()
1282 ret = devm_spi_register_master(&pdev->dev, master); in rspi_probe()
1293 rspi_release_dma(master); in rspi_probe()
1297 spi_master_put(master); in rspi_probe()
1317 return spi_master_suspend(rspi->master); in rspi_suspend()
1325 return spi_master_resume(rspi->master); in rspi_resume()