From: Daniel Mack <daniel@caiaq.de>
To: Ben Dooks <ben-linux@fluff.org>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
"'LKML'" <linux-kernel@vger.kernel.org>,
linux-arm-kernel@lists.arm.linux.org.uk,
kyungmin.park@samsung.com
Subject: Re: [PATCH] [drivers] [SPI] SPI_GPIO: add support for controllers with missing MISO pin
Date: Mon, 18 May 2009 10:57:10 +0200 [thread overview]
Message-ID: <20090518085710.GE14595@buzzloop.caiaq.de> (raw)
In-Reply-To: <20090518083412.GA28648@trinity.fluff.org>
On Mon, May 18, 2009 at 09:34:12AM +0100, Ben Dooks wrote:
> > > > static inline int getmiso(const struct spi_device *spi)
> > > > {
> > > > - return !!gpio_get_value(SPI_MISO_GPIO);
> > > > + if (SPI_MISO_GPIO)
> > > > + return !!gpio_get_value(SPI_MISO_GPIO);
> > > > + else
> > > > + return 0;
> > > > }
> > >
> > > Is zero a good approximation for 'no gpio' ?
> >
> > Now I found that zero might be a valid gpio pin number on some architectures
> > (it just means GPIO0 pin). This is imho a bit strange behavior of gpiolib as
> > there should be also a special values for INVALID or NOGPIO cases. Does
> > anyone have any ideas how such cases should be handled properly?
>
> I belive there is a gpio_is_valid() function to tell you precisely if the
> given GPIO is valid.
And then -1 can be passed in from the platform data which will fail the
gpio_is_valid() test.
Daniel
next prev parent reply other threads:[~2009-05-18 8:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-07 12:24 [PATCH] [drivers] [SPI] SPI_GPIO: add support for controllers with missing MISO pin Marek Szyprowski
2009-05-07 12:31 ` Ben Dooks
2009-05-18 8:30 ` Marek Szyprowski
2009-05-18 8:34 ` Ben Dooks
2009-05-18 8:57 ` Daniel Mack [this message]
2009-05-18 9:27 ` Marek Szyprowski
-- strict thread matches above, loose matches on Subject: below --
2009-05-25 13:02 Marek Szyprowski
2009-05-25 13:02 ` Marek Szyprowski
2009-06-23 8:55 Marek Szyprowski
2009-06-23 18:55 ` David Brownell
2009-06-25 12:16 ` Marek Szyprowski
2009-06-25 15:36 ` David Brownell
2009-06-23 8:55 Marek Szyprowski
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=20090518085710.GE14595@buzzloop.caiaq.de \
--to=daniel@caiaq.de \
--cc=ben-linux@fluff.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.