[PATCH V2 - RESEND] SPI: BCM2835: allow arbitrary GPIO to act as SPI-chip_select

Mark Brown broonie at kernel.org
Wed Mar 25 08:16:11 PDT 2015


On Wed, Mar 25, 2015 at 08:10:57AM +0100, Martin Sperl wrote:

> +static inline void bcm2835_set_cs(struct spi_device *spi, bool enable)
> +{
> +	if (spi->mode & SPI_CS_HIGH)
> +		enable = !enable;
> +
> +	if (gpio_is_valid(spi->cs_gpio))
> +		gpio_set_value(spi->cs_gpio, !enable);
> +}

This appears to be open coding the core spi_set_cs() support for GPIOs,
why are we not just setting cs_gpio and letting the core take care of
things?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-rpi-kernel/attachments/20150325/2b2da6c8/attachment.sig>


More information about the linux-rpi-kernel mailing list