Commit b833172f authored by Mika Westerberg's avatar Mika Westerberg Committed by Mark Brown

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: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: default avatarLu Cao <lucao@marvell.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 7d94a505
...@@ -846,6 +846,9 @@ static int setup(struct spi_device *spi) ...@@ -846,6 +846,9 @@ static int setup(struct spi_device *spi)
chip->cr1 |= (((spi->mode & SPI_CPHA) != 0) ? SSCR1_SPH : 0) chip->cr1 |= (((spi->mode & SPI_CPHA) != 0) ? SSCR1_SPH : 0)
| (((spi->mode & SPI_CPOL) != 0) ? SSCR1_SPO : 0); | (((spi->mode & SPI_CPOL) != 0) ? SSCR1_SPO : 0);
if (spi->mode & SPI_LOOP)
chip->cr1 |= SSCR1_LBM;
/* NOTE: PXA25x_SSP _could_ use external clocking ... */ /* NOTE: PXA25x_SSP _could_ use external clocking ... */
if (!pxa25x_ssp_comp(drv_data)) if (!pxa25x_ssp_comp(drv_data))
dev_dbg(&spi->dev, "%ld Hz actual, %s\n", dev_dbg(&spi->dev, "%ld Hz actual, %s\n",
...@@ -939,7 +942,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) ...@@ -939,7 +942,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
master->dev.parent = &pdev->dev; master->dev.parent = &pdev->dev;
master->dev.of_node = pdev->dev.of_node; master->dev.of_node = pdev->dev.of_node;
/* the spi->mode bits understood by this driver: */ /* the spi->mode bits understood by this driver: */
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
master->bus_num = ssp->port_id; master->bus_num = ssp->port_id;
master->num_chipselect = platform_info->num_chipselect; master->num_chipselect = platform_info->num_chipselect;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment