[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <000901c9d79a$f36a86b0$da3f9410$%szyprowski@samsung.com>
Date: Mon, 18 May 2009 11:27:59 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: 'Daniel Mack' <daniel@...aq.de>, 'Ben Dooks' <ben-linux@...ff.org>
Cc: 'LKML' <linux-kernel@...r.kernel.org>,
linux-arm-kernel@...ts.arm.linux.org.uk, kyungmin.park@...sung.com
Subject: RE: [PATCH] [drivers] [SPI] SPI_GPIO: add support for controllers with
missing MISO pin
Hello,
On Monday, May 18, 2009 10:57 AM Daniel Mack wrote:
> 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.
Ok. I will update my patch. Thank you for the idea.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists