Re: [PATCH] spi: omap2-mcspi: Add support for GPIO chipselects

From: Mark Brown
Date: Thu Apr 09 2015 - 06:52:26 EST

On Wed, Apr 08, 2015 at 04:36:01PM -0500, Michael Welling wrote:
> This patch allows for GPIOs specified in the devicetree to be used as SPI chipselects
> on TI OMAP2 SoCs.

Please keep your commit messages under 80 columns.

> + if (gpio_is_valid(spi->cs_gpio)) {
> + if (gpio_request(spi->cs_gpio, dev_name(&spi->dev)) == 0)
> + gpio_direction_output(spi->cs_gpio,
> + !(spi->mode & SPI_CS_HIGH));
> + }

For this to work we need to be sure that unspecified GPIOs are invalid
which isn't normally the default - zero tends to be a valid GPIO and
that's also the default for otherwise uninitialized data. Is there
something that takes care of this?

Attachment: signature.asc
Description: Digital signature