Lines Matching defs:spi

10  * spi-ath79.c, Copyright (C) 2009-2011 Gabor Juhos <juhosg@openwrt.org>
11 * spi-atmel.c, Copyright (C) 2006 Atmel Corporation
32 #include <linux/spi/spi.h>
75 #define DRV_NAME "spi-bcm2835"
165 snprintf(name, sizeof(name), "spi-bcm2835-%s", dname);
398 struct spi_device *spi,
651 * @spi: SPI slave
660 struct spi_device *spi,
702 bs->chip_select = spi->chip_select;
714 * @spi: SPI slave
759 struct spi_device *spi,
778 ret = bcm2835_spi_prepare_sg(ctlr, spi, tfr, bs, true);
804 ret = bcm2835_spi_prepare_sg(ctlr, spi, tfr, bs, false);
806 cookie = dmaengine_submit(bs->clear_rx_desc[spi->chip_select]);
841 struct spi_device *spi,
1028 struct spi_device *spi,
1062 dev_dbg_ratelimited(&spi->dev,
1071 return bcm2835_spi_transfer_one_irq(ctlr, spi,
1083 struct spi_device *spi,
1089 u32 cs = bs->prepare_cs[spi->chip_select];
1110 if (spi->mode & SPI_3WIRE && tfr->rx_buf)
1130 return bcm2835_spi_transfer_one_poll(ctlr, spi, tfr, cs);
1134 * this 1 idle clock cycle pattern but runs the spi clock without gaps
1136 if (ctlr->can_dma && bcm2835_spi_can_dma(ctlr, spi, tfr))
1137 return bcm2835_spi_transfer_one_dma(ctlr, spi, tfr, cs);
1140 return bcm2835_spi_transfer_one_irq(ctlr, spi, tfr, cs, true);
1146 struct spi_device *spi = msg->spi;
1166 bcm2835_wr(bs, BCM2835_SPI_CS, bs->prepare_cs[spi->chip_select]);
1196 static int bcm2835_spi_setup(struct spi_device *spi)
1198 struct spi_controller *ctlr = spi->controller;
1203 if (spi->chip_select >= BCM2835_SPI_NUM_CS) {
1204 dev_err(&spi->dev, "only %d chip-selects supported\n",
1216 if (spi->mode & SPI_CPOL)
1218 if (spi->mode & SPI_CPHA)
1220 bs->prepare_cs[spi->chip_select] = cs;
1227 bs->clear_rx_cs[spi->chip_select] = cs |
1240 if (spi->mode & SPI_NO_CS)
1246 if (spi->cs_gpiod)
1248 if (spi->chip_select > 1) {
1253 dev_err(&spi->dev,
1263 * and fix it. Why is the GPIO descriptor in spi->cs_gpiod
1272 spi->cs_gpiod = gpiochip_request_own_desc(chip, 8 - spi->chip_select,
1276 if (IS_ERR(spi->cs_gpiod))
1277 return PTR_ERR(spi->cs_gpiod);
1280 dev_info(&spi->dev, "setting up native-CS%i to use GPIO\n",
1281 spi->chip_select);
1391 { .compatible = "brcm,bcm2835-spi", },