[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-spi
Subject: Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects
From: Mark Brown <broonie () kernel ! org>
Date: 2015-04-29 10:47:37
Message-ID: 20150429104737.GC22845 () sirena ! org ! uk
[Download RAW message or body]
On Tue, Apr 28, 2015 at 06:06:43PM -0500, Michael Welling wrote:
> On Tue, Apr 28, 2015 at 03:34:25PM +0100, Mark Brown wrote:
> > > if (gpio_is_valid(spi->cs_gpio)) {
> > > if (cs_active)
> > > gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH);
> > > else
> > > gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
> > > }
> > That's good but please have braces around the inner if for clarity.
> I try to follow the CodingStyle documentation and it says differently:
> http://lxr.free-electrons.com/source/Documentation/CodingStyle#L156
That's for free standing if statements, the reason I'm asking for braces
at both levels here is that you've got a nested if - it's similar to
having braces on both branches of an if, being consistent within the
same statement.
> I have also been looking at ways of allowing more GPIO chipselects than
> DMA channels. Currently this driver is limited to one chipselect per
> DMA channel.
> Do you have any ideas on how to accomplish this?
Just use a single channel for the controller rather than allocating them
per device? It's not like the controller is going to be able to
interact with multiple devics simultaneously.
["signature.asc" (application/pgp-signature)]
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic