summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-04-17 13:54:28 +0300
committerMark Brown <broonie@kernel.org>2024-05-03 11:11:31 +0900
commit2c547549ac69380bb03b495c5ef3dbc03c9c7a48 (patch)
treecfd0512df33c6ceea9df5bb114175a15e0675ba4
parent6be871d5fd2ecac8987a63fbf7ee38e007d14133 (diff)
downloadlinux-stable-2c547549ac69380bb03b495c5ef3dbc03c9c7a48.tar.gz
linux-stable-2c547549ac69380bb03b495c5ef3dbc03c9c7a48.tar.bz2
linux-stable-2c547549ac69380bb03b495c5ef3dbc03c9c7a48.zip
spi: pxa2xx: Allow number of chip select pins to be read from property
In some cases the number of the chip select pins might come from the device property. Allow driver to use it. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20240417110334.2671228-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-pxa2xx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 2f60b2fde8d5..ab6fd55237cd 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1357,6 +1357,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
struct ssp_device *ssp = NULL;
const void *match;
bool is_lpss_priv;
+ u32 num_cs = 1;
int status;
is_lpss_priv = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv");
@@ -1395,8 +1396,11 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
pdata->dma_filter = pxa2xx_spi_idma_filter;
}
+ /* Read number of chip select pins, if provided */
+ device_property_read_u32(dev, "num-cs", &num_cs);
+
+ pdata->num_chipselect = num_cs;
pdata->is_target = device_property_read_bool(dev, "spi-slave");
- pdata->num_chipselect = 1;
pdata->enable_dma = true;
pdata->dma_burst_size = 1;