Skip to content

Commit 2c54754

Browse files
andy-shevbroonie
authored andcommitted
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 <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 6be871d commit 2c54754

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/spi/spi-pxa2xx.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
13571357
struct ssp_device *ssp = NULL;
13581358
const void *match;
13591359
bool is_lpss_priv;
1360+
u32 num_cs = 1;
13601361
int status;
13611362

13621363
is_lpss_priv = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpss_priv");
@@ -1395,8 +1396,11 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev)
13951396
pdata->dma_filter = pxa2xx_spi_idma_filter;
13961397
}
13971398

1399+
/* Read number of chip select pins, if provided */
1400+
device_property_read_u32(dev, "num-cs", &num_cs);
1401+
1402+
pdata->num_chipselect = num_cs;
13981403
pdata->is_target = device_property_read_bool(dev, "spi-slave");
1399-
pdata->num_chipselect = 1;
14001404
pdata->enable_dma = true;
14011405
pdata->dma_burst_size = 1;
14021406

0 commit comments

Comments
 (0)