Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Andrey Pronin
On Fri, Jul 01, 2016 at 07:17:08PM +0200, Mark Brown wrote: > On Fri, Jul 01, 2016 at 10:05:50AM -0700, Doug Anderson wrote: > > > I'm curious why you you need a timer at all. Can't you just keep > > track of the jiffies that you last sent and do subtraction? ...or you > > could get even more ac

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Andrey Pronin
On Fri, Jul 01, 2016 at 09:02:30AM +0100, Mark Brown wrote: > On Wed, Jun 29, 2016 at 08:54:24PM -0700, apro...@chromium.org wrote: > > From: Andrey Pronin > > > > Some SPI devices may go to sleep after a period of inactivity > > on SPI. For such devices, if enough time has passed since the > > l

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Mark Brown
On Fri, Jul 01, 2016 at 10:05:50AM -0700, Doug Anderson wrote: > I'm curious why you you need a timer at all. Can't you just keep > track of the jiffies that you last sent and do subtraction? ...or you > could get even more accurate and use a ktime_t. That avoids a whole > lot of synchronizatio

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Doug Anderson
Hi, On Fri, Jul 1, 2016 at 1:21 AM, Mark Brown wrote: > On Thu, Jun 30, 2016 at 09:23:26PM -0700, Doug Anderson wrote: > >> Also, something doesn't seem terribly robust about this, buy maybe I'm >> being paranoid. If something happens where the timer hasn't fired >> quickly enough then you might

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Mark Brown
On Wed, Jun 29, 2016 at 08:54:24PM -0700, apro...@chromium.org wrote: > From: Andrey Pronin > > Some SPI devices may go to sleep after a period of inactivity > on SPI. For such devices, if enough time has passed since the > last SPI transaction, toggle CS and wait for the device to > start before

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-07-01 Thread Mark Brown
On Thu, Jun 30, 2016 at 09:23:26PM -0700, Doug Anderson wrote: > Also, something doesn't seem terribly robust about this, buy maybe I'm > being paranoid. If something happens where the timer hasn't fired > quickly enough then you might not know that you need to assert the > wakeup, right? I don'

Re: [PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-06-30 Thread Doug Anderson
Andrey, On Wed, Jun 29, 2016 at 8:54 PM, wrote: > From: Andrey Pronin > > Some SPI devices may go to sleep after a period of inactivity > on SPI. For such devices, if enough time has passed since the > last SPI transaction, toggle CS and wait for the device to > start before communicating with

[PATCH 1/4] spi: Add option to wake a device by toggling CS

2016-06-29 Thread apronin
From: Andrey Pronin Some SPI devices may go to sleep after a period of inactivity on SPI. For such devices, if enough time has passed since the last SPI transaction, toggle CS and wait for the device to start before communicating with it. Signed-off-by: Andrey Pronin --- drivers/spi/spi.c