Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-29 Thread Mark Brown
On Tue, Apr 28, 2015 at 06:06:43PM -0500, Michael Welling wrote: > On Tue, Apr 28, 2015 at 03:34:25PM +0100, Mark Brown wrote: > > > if (gpio_is_valid(spi->cs_gpio)) { > > > if (cs_active) > > > gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH); > > > el

Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-28 Thread Michael Welling
On Tue, Apr 28, 2015 at 03:34:25PM +0100, Mark Brown wrote: > On Mon, Apr 27, 2015 at 08:21:50PM -0500, Michael Welling wrote: > > > Before I send another patch how does this look? > > > if (gpio_is_valid(spi->cs_gpio)) { > > if (cs_active) > > gpio_set_value(s

Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-28 Thread Michael Welling
On Tue, Apr 28, 2015 at 11:04:09AM -0300, Ezequiel Garcia wrote: > On 04/27/2015 10:21 PM, Michael Welling wrote: > > On Mon, Apr 27, 2015 at 08:55:50PM +0100, Mark Brown wrote: > >> On Sun, Apr 26, 2015 at 10:44:30PM -0500, Michael Welling wrote: > >> > >>> + if (gpio_is_valid(spi->cs_gpio)) { > >

Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-28 Thread Michael Welling
On Tue, Apr 28, 2015 at 07:32:21AM +0200, Martin Sperl wrote: > > > On 28.04.2015, at 03:21, Michael Welling wrote: > > If I were to attempt to convert the driver to use the core chipselect > > support, > > how would I go about doing it? > > > > Is there another driver that I can use for refere

Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-28 Thread Mark Brown
On Mon, Apr 27, 2015 at 08:21:50PM -0500, Michael Welling wrote: > Before I send another patch how does this look? > if (gpio_is_valid(spi->cs_gpio)) { > if (cs_active) > gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH); > else >

Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-28 Thread Ezequiel Garcia
On 04/27/2015 10:21 PM, Michael Welling wrote: > On Mon, Apr 27, 2015 at 08:55:50PM +0100, Mark Brown wrote: >> On Sun, Apr 26, 2015 at 10:44:30PM -0500, Michael Welling wrote: >> >>> + if (gpio_is_valid(spi->cs_gpio)) { >>> + gpio_set_value(spi->cs_gpio, (cs_active) ? >>> +

Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-27 Thread Martin Sperl
> On 28.04.2015, at 03:21, Michael Welling wrote: > If I were to attempt to convert the driver to use the core chipselect support, > how would I go about doing it? > > Is there another driver that I can use for reference? You may look into this patch: e34ff011c70e5f4ef219141711142d5111ae6ebb for

Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-27 Thread Michael Welling
On Mon, Apr 27, 2015 at 08:55:50PM +0100, Mark Brown wrote: > On Sun, Apr 26, 2015 at 10:44:30PM -0500, Michael Welling wrote: > > > + if (gpio_is_valid(spi->cs_gpio)) { > > + gpio_set_value(spi->cs_gpio, (cs_active) ? > > + !!(spi->mode & SPI_CS_HIGH) : > > +

Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-27 Thread Mark Brown
On Sun, Apr 26, 2015 at 10:44:30PM -0500, Michael Welling wrote: > + if (gpio_is_valid(spi->cs_gpio)) { > + gpio_set_value(spi->cs_gpio, (cs_active) ? > + !!(spi->mode & SPI_CS_HIGH) : > + !(spi->mode & SPI_CS_HIGH)); > + } Two problems

[PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

2015-04-26 Thread Michael Welling
This patch allows for GPIOs specified in the devicetree to be used as SPI chipselects on TI OMAP2 SoCs. Tested on the AM3354. Signed-off-by: Michael Welling --- v2: Considers the possible use of SPI_CS_HIGH during chip select activation. drivers/spi/spi-omap2-mcspi.c | 13 + 1 f