Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-24 Thread Mark Brown
On Thu, May 24, 2018 at 07:56:20PM +0200, Alexandre Belloni wrote: > Back in 2014, I was suggesting using devm_gpio_request_one() in > of_spi_register_master(). That would take care of setting the direction > of the GPIO: > https://www.spinics.net/lists/arm-kernel/msg351251.html > I never took t

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-24 Thread Mark Brown
On Thu, May 24, 2018 at 07:04:11PM +0300, Radu Pirea wrote: > if (ctlr->cs_gpios){ > spi->cs_gpio = ctlr->cs_gpios[spi->chip_select]; > if(gpio_is_valid(spi->cs_gpio)) > gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); > > } You're expected to

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-24 Thread Alexandre Belloni
Hi, On 24/05/2018 19:04:11+0300, Radu Pirea wrote: > > > On 05/17/2018 07:54 AM, Mark Brown wrote: > > On Tue, May 15, 2018 at 12:22:24PM +0300, Radu Pirea wrote: > > > On Mon, 2018-05-14 at 20:38 +0300, Andy Shevchenko wrote: > > > > > > So, what is not going as expected in "SPI core takes car

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-24 Thread Radu Pirea
On 05/17/2018 07:54 AM, Mark Brown wrote: On Tue, May 15, 2018 at 12:22:24PM +0300, Radu Pirea wrote: On Mon, 2018-05-14 at 20:38 +0300, Andy Shevchenko wrote: So, what is not going as expected in "SPI core takes care of CSs" case? Did you use oscilloscope for that? Yes, I used and CSs w

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-23 Thread Mark Brown
On Wed, May 23, 2018 at 11:10:28AM +0300, Radu Pirea wrote: > On 05/17/2018 08:04 AM, Mark Brown wrote: > > > +// SPDX-License-Identifier: GPL-2.0 > > > +/* > > > + * Driver for AT91 USART Controllers as SPI > > > + * > > > + * Copyright (C) 2018 Microchip Technology Inc. > > Make the entire bloc

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-23 Thread Radu Pirea
On 05/17/2018 08:04 AM, Mark Brown wrote: On Fri, May 11, 2018 at 01:38:21PM +0300, Radu Pirea wrote: +config SPI_AT91_USART +tristate "Atmel USART Controller as SPI" + depends on HAS_DMA + depends on (ARCH_AT91 || COMPILE_TEST) +select MFD_AT91_USART + help

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-17 Thread Mark Brown
On Tue, May 15, 2018 at 12:22:24PM +0300, Radu Pirea wrote: > On Mon, 2018-05-14 at 20:38 +0300, Andy Shevchenko wrote: > > So, what is not going as expected in "SPI core takes care of CSs" > > case? > > Did you use oscilloscope for that? > Yes, I used and CSs was not asserted. Anyway, I will wil

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-17 Thread Mark Brown
On Fri, May 11, 2018 at 01:38:21PM +0300, Radu Pirea wrote: > +config SPI_AT91_USART > +tristate "Atmel USART Controller as SPI" > + depends on HAS_DMA > + depends on (ARCH_AT91 || COMPILE_TEST) > +select MFD_AT91_USART > + help > + This selects a driver for the A

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-15 Thread Radu Pirea
On Sun, 2018-05-13 at 16:33 +0300, Andy Shevchenko wrote: > On Fri, May 11, 2018 at 1:38 PM, Radu Pirea > wrote: > > This is the driver for at91-usart in spi mode. The USART IP can be > > configured > > to work in many modes and one of them is SPI. > > +#include > > +#include > > Here is someth

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-15 Thread Radu Pirea
On Mon, 2018-05-14 at 20:38 +0300, Andy Shevchenko wrote: > First of all, do not remove mailing lists from Cc and people if you > are not sure they do not need your stuff. > Sorry. My mistake. > On Mon, May 14, 2018 at 11:11 AM, Radu Pirea > wrote: > > On Sun, 2018-05-13 at 16:33 +0300, Andy She

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-14 Thread Andy Shevchenko
First of all, do not remove mailing lists from Cc and people if you are not sure they do not need your stuff. On Mon, May 14, 2018 at 11:11 AM, Radu Pirea wrote: > On Sun, 2018-05-13 at 16:33 +0300, Andy Shevchenko wrote: >> On Fri, May 11, 2018 at 1:38 PM, Radu Pirea > > wrote: >> > +static voi

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-13 Thread Andy Shevchenko
> I will refer to above as (1) later on. > The question is, why you didn't utilize what SPI core provides you? Here I should have referred to (1). -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi

2018-05-13 Thread Andy Shevchenko
On Fri, May 11, 2018 at 1:38 PM, Radu Pirea wrote: > This is the driver for at91-usart in spi mode. The USART IP can be configured > to work in many modes and one of them is SPI. > +#include > +#include Here is something wrong. You need to use latter one in new code. > +#include > +#include