From: 21cnbao@gmail.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/8] spi: sirf: request and free cs gpio in setup and cleanup callbacks
Date: Sun, 07 Sep 2014 08:50:19 +0800 [thread overview]
Message-ID: <D031CA8D.21605%21cnbao@gmail.com> (raw)
In-Reply-To: <20140906135735.GE2601@sirena.org.uk>
On 14-9-6 ??9:57, "Mark Brown" <broonie@kernel.org> wrote:
>On Fri, Sep 05, 2014 at 11:34:57AM +0800, swingboard wrote:
>> 2014-09-05 3:19 GMT+08:00 Mark Brown <broonie@kernel.org>:
>
>> > I'm not quite sure I understand the rationale here - as far as I can
>> > tell this is making the GPIO request happen later not earlier so it's
>> > not clear to me what the problem this is fixing in the existing code.
>> > If the goal is to move the request around in the probe function why
>>not
>> > just move the existing code earlier in probe()?
>
>> As GPIO cs can be high or low validate and the used GPIO pin with
>> default value may high or low,
>> it is need do spi device's chipselect invalidation work in spi_setup,
>> the patch purpose for it.
>> master->cs_gpios only assigned after spi_bitbang_start and the
>> function call spi_setup,
>> if keep the existing code there will result gpio usage before gpio
>>request.
>> just move gpio request code in spi_sirfsoc_setup before gpio use.
>
>I'm still having a hard time understanding why pulling the code earlier
>in probe isn't a better fix here.
Gpio is unknown before spi_bitbang_start(). Everything is done in the big
routine spi_bitbang_start(). It includes:
Get cs_gpios, extend spi devices, and setup cs to de-active.
-barry
next prev parent reply other threads:[~2014-09-07 0:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 9:01 [PATCH 0/8] spi: sirf: a bundle of fixes and cleanups Barry Song
2014-09-02 9:01 ` [PATCH 1/8] spi: sirf: correct spi gpio and hardware chipselect behaviour Barry Song
2014-09-04 19:20 ` Mark Brown
2014-09-02 9:01 ` [PATCH 2/8] spi: sirf: request and free cs gpio in setup and cleanup callbacks Barry Song
2014-09-04 19:19 ` Mark Brown
2014-09-05 3:34 ` swingboard
2014-09-06 13:57 ` Mark Brown
2014-09-07 0:50 ` Barry Song [this message]
2015-04-28 3:36 ` Barry Song
2015-04-30 10:16 ` Mark Brown
2014-09-02 9:01 ` [PATCH 3/8] spi: sirf: enable RX_IO_DMA_INT interrupt Barry Song
2014-09-04 19:27 ` Mark Brown
2014-09-02 9:01 ` [PATCH 4/8] spi: sirf: fix 'cmd_transfer' function typos Barry Song
2014-09-04 22:36 ` Mark Brown
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=D031CA8D.21605%21cnbao@gmail.com \
--to=21cnbao@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).