Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi/pxa2xx: add support for SPI_LOOP

This is useful when testing the functionality of the controller from userspace
and there aren't any real SPI slave devices connected to the bus.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Lu Cao <lucao@marvell.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

authored by

Mika Westerberg and committed by
Mark Brown
b833172f 7d94a505

+4 -1
+4 -1
drivers/spi/spi-pxa2xx.c
··· 846 846 chip->cr1 |= (((spi->mode & SPI_CPHA) != 0) ? SSCR1_SPH : 0) 847 847 | (((spi->mode & SPI_CPOL) != 0) ? SSCR1_SPO : 0); 848 848 849 + if (spi->mode & SPI_LOOP) 850 + chip->cr1 |= SSCR1_LBM; 851 + 849 852 /* NOTE: PXA25x_SSP _could_ use external clocking ... */ 850 853 if (!pxa25x_ssp_comp(drv_data)) 851 854 dev_dbg(&spi->dev, "%ld Hz actual, %s\n", ··· 942 939 master->dev.parent = &pdev->dev; 943 940 master->dev.of_node = pdev->dev.of_node; 944 941 /* the spi->mode bits understood by this driver: */ 945 - master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; 942 + master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP; 946 943 947 944 master->bus_num = ssp->port_id; 948 945 master->num_chipselect = platform_info->num_chipselect;