1 From c3fbb1e6771dabb14571552c036a049ffa470eb1 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Fri, 30 Apr 2021 08:34:36 +0100
4 Subject: [PATCH] spi: bcm2835: Increase the CS limit to 24
6 Increase the maximum number of CS lines to 24, and ensure this limit is
9 See: https://github.com/raspberrypi/linux/pull/4281
11 Suggested-by: Joe Burmeister <joe.burmeister@devtank.co.uk>
12 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
14 drivers/spi/spi-bcm2835.c | 6 ++++++
15 1 file changed, 6 insertions(+)
17 --- a/drivers/spi/spi-bcm2835.c
18 +++ b/drivers/spi/spi-bcm2835.c
20 #include <linux/gpio/consumer.h>
21 #include <linux/gpio/machine.h> /* FIXME: using chip internals */
22 #include <linux/gpio/driver.h> /* FIXME: using chip internals */
23 +#include <linux/of_gpio.h>
24 #include <linux/of_irq.h>
25 #include <linux/spi/spi.h>
27 @@ -1299,6 +1300,11 @@ static int bcm2835_spi_probe(struct plat
28 struct bcm2835_spi *bs;
31 + if (of_gpio_named_count(pdev->dev.of_node, "cs-gpios") >
33 + return dev_err_probe(&pdev->dev, -EINVAL,
34 + "too many chip selects\n");
36 ctlr = devm_spi_alloc_master(&pdev->dev, ALIGN(sizeof(*bs),
37 dma_get_cache_alignment()));