From: Andrew Bresticker <abrestic@chromium.org>
To: Sifan Naeem <sifan.naeem@imgtec.com>
Cc: Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org,
"Stable kernel (v4.1)" <stable@vger.kernel.org>
Subject: Re: [PATCH 2/2] spi: img-spfi: fix spfi_setup by removing gpio_request_one
Date: Mon, 27 Jul 2015 09:34:41 -0700 [thread overview]
Message-ID: <CAL1qeaHLn6-2QJkPjNCm3V-pVqBk09P2BP-Sp+gn1G4ZWpvkEw@mail.gmail.com> (raw)
In-Reply-To: <1437999076-693-2-git-send-email-sifan.naeem@imgtec.com>
Hi Sifan,
On Mon, Jul 27, 2015 at 5:11 AM, Sifan Naeem <sifan.naeem@imgtec.com> wrote:
> spfi_setup may be called many times bye the spi framework, but
> gpio_request_one can only be called once without freeing, repeatedly
> calling gpio_request_one will cause an error to be thrown, which causes
> the request to spi_setup to be marked as failed.
>
> We can simply use gpio_direction_output to set the direction of the
> gpio instead of gpio_request_one to put the gpio in to initial state,
> after which the spi framework can control the chipselect line via gpio
> using gpio_set_value.
I don't think we want to leave the CS GPIOs un-requested. Instead, we
could either request them all at probe() time (and then set direction
in setup()) or have a per-spi_device flag that indicates whether or
not the GPIO has been requested.
-Andrew
next prev parent reply other threads:[~2015-07-27 16:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-27 12:11 [PATCH 1/2] spi: img-spfi: check for timeout error before proceeding Sifan Naeem
2015-07-27 12:11 ` [PATCH 2/2] spi: img-spfi: fix spfi_setup by removing gpio_request_one Sifan Naeem
2015-07-27 16:34 ` Andrew Bresticker [this message]
[not found] ` <CAL1qeaHLn6-2QJkPjNCm3V-pVqBk09P2BP-Sp+gn1G4ZWpvkEw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-27 16:40 ` Mark Brown
2015-07-27 16:53 ` Sifan Naeem
2015-07-29 11:05 ` Sifan Naeem
[not found] ` <A0E307549471DA4DBAF2DE2DE6CBFB7E4966D9FF-brIQrgj5TFtJFJhlrACyRFBRoQTxkR7k@public.gmane.org>
2015-07-29 12:26 ` Mark Brown
[not found] ` <20150729122600.GB20130-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-07-29 12:43 ` Sifan Naeem
[not found] ` <1437999076-693-1-git-send-email-sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-07-27 16:30 ` [PATCH 1/2] spi: img-spfi: check for timeout error before proceeding Andrew Bresticker
2015-07-29 13:53 ` Mark Brown
2015-07-29 14:07 ` Sifan Naeem
2015-07-29 14:14 ` Applied "spi: img-spfi: check for timeout error before proceeding" to the spi tree 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=CAL1qeaHLn6-2QJkPjNCm3V-pVqBk09P2BP-Sp+gn1G4ZWpvkEw@mail.gmail.com \
--to=abrestic@chromium.org \
--cc=broonie@kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=sifan.naeem@imgtec.com \
--cc=stable@vger.kernel.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).