From: Mark Brown <broonie@kernel.org>
To: Michael Welling <mwelling@ieee.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects
Date: Wed, 29 Apr 2015 11:47:37 +0100 [thread overview]
Message-ID: <20150429104737.GC22845@sirena.org.uk> (raw)
In-Reply-To: <20150428230643.GC19294@deathray>
[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]
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.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2015-04-29 10:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-27 3:44 [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects Michael Welling
2015-04-27 19:55 ` Mark Brown
2015-04-28 1:21 ` Michael Welling
2015-04-28 5:32 ` Martin Sperl
2015-04-28 22:49 ` Michael Welling
2015-04-28 14:04 ` Ezequiel Garcia
2015-04-28 22:50 ` Michael Welling
2015-04-28 14:34 ` Mark Brown
2015-04-28 23:06 ` Michael Welling
2015-04-29 10:47 ` Mark Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150429104737.GC22845@sirena.org.uk \
--to=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mwelling@ieee.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox