Lines Matching +full:spi +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0+
2 /* SC16IS7xx SPI interface driver */
8 #include <linux/spi/spi.h>
14 /* SPI definitions */
17 static int sc16is7xx_spi_probe(struct spi_device *spi) in sc16is7xx_spi_probe() argument
25 /* Setup SPI bus */ in sc16is7xx_spi_probe()
26 spi->bits_per_word = 8; in sc16is7xx_spi_probe()
27 /* For all variants, only mode 0 is supported */ in sc16is7xx_spi_probe()
28 if ((spi->mode & SPI_MODE_X_MASK) != SPI_MODE_0) in sc16is7xx_spi_probe()
29 return dev_err_probe(&spi->dev, -EINVAL, "Unsupported SPI mode\n"); in sc16is7xx_spi_probe()
31 spi->mode = spi->mode ? : SPI_MODE_0; in sc16is7xx_spi_probe()
32 spi->max_speed_hz = spi->max_speed_hz ? : 4 * HZ_PER_MHZ; in sc16is7xx_spi_probe()
33 ret = spi_setup(spi); in sc16is7xx_spi_probe()
37 devtype = spi_get_device_match_data(spi); in sc16is7xx_spi_probe()
39 return dev_err_probe(&spi->dev, -ENODEV, "Failed to match device\n"); in sc16is7xx_spi_probe()
43 for (i = 0; i < devtype->nr_uart; i++) { in sc16is7xx_spi_probe()
53 regmaps[i] = devm_regmap_init_spi(spi, ®cfg); in sc16is7xx_spi_probe()
56 return sc16is7xx_probe(&spi->dev, devtype, regmaps, spi->irq); in sc16is7xx_spi_probe()
59 static void sc16is7xx_spi_remove(struct spi_device *spi) in sc16is7xx_spi_remove() argument
61 sc16is7xx_remove(&spi->dev); in sc16is7xx_spi_remove()
74 MODULE_DEVICE_TABLE(spi, sc16is7xx_spi_id_table);
89 MODULE_DESCRIPTION("SC16IS7xx SPI interface driver");