From: Barry Song <21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
swingboard <swingboard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Qipan Li <Qipan.Li-kQvG35nSl+M@public.gmane.org>,
<workgroup.linux-kQvG35nSl+M@public.gmane.org>,
<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Barry Song <Barry.Song-kQvG35nSl+M@public.gmane.org>,
Barry Song <Baohua.Song-kQvG35nSl+M@public.gmane.org>,
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [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-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
On 14-9-6 下午9:57, "Mark Brown" <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
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
[not found] ` <1409648468-5436-1-git-send-email-Barry.Song-kQvG35nSl+M@public.gmane.org>
2014-09-02 9:01 ` [PATCH 1/8] spi: sirf: correct spi gpio and hardware chipselect behaviour Barry Song
[not found] ` <1409648468-5436-2-git-send-email-Barry.Song-kQvG35nSl+M@public.gmane.org>
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
[not found] ` <1409648468-5436-3-git-send-email-Barry.Song-kQvG35nSl+M@public.gmane.org>
2014-09-04 19:19 ` Mark Brown
[not found] ` <20140904191954.GO29327-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-09-05 3:34 ` swingboard
[not found] ` <CA+qxAP06x5uHzObuWzmcAjFz4YKHRxxH5FE5cGZYzKQNUsJdyg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-06 13:57 ` Mark Brown
[not found] ` <20140906135735.GE2601-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-09-07 0:50 ` Barry Song [this message]
[not found] ` <D031CA8D.21605%21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-28 3:36 ` Barry Song
[not found] ` <CAGsJ_4yhSFnzyZV6B3j90LyJbstsyBJHCnk=LZqVDsL_u8foPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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
[not found] ` <1409648468-5436-4-git-send-email-Barry.Song-kQvG35nSl+M@public.gmane.org>
2014-09-04 19:27 ` Mark Brown
2014-09-02 9:01 ` [PATCH 4/8] spi: sirf: fix 'cmd_transfer' function typos Barry Song
[not found] ` <1409648468-5436-5-git-send-email-Barry.Song-kQvG35nSl+M@public.gmane.org>
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-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=Baohua.Song-kQvG35nSl+M@public.gmane.org \
--cc=Barry.Song-kQvG35nSl+M@public.gmane.org \
--cc=Qipan.Li-kQvG35nSl+M@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swingboard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=workgroup.linux-kQvG35nSl+M@public.gmane.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).