On Wednesday, November 05, 2014 4:08 AM, Ian Abbott wrote:
> On 04/11/14 16:50, H Hartley Sweeten wrote:
>> Remove the private data member 'ai_sample_count' and use the comedi_async
>> 'scans_done' member to detect the end-of-acquisition.
>>
>> Also, remove the unnecessary COMEDI_CB_EOS event. The core automatically
>> detects and adds that event.
>>
>> Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
>> Cc: Ian Abbott <abbo...@mev.co.uk>
>> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
>> ---
>>   drivers/staging/comedi/drivers/s626.c | 15 ++-------------
>>   1 file changed, 2 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/staging/comedi/drivers/s626.c 
>> b/drivers/staging/comedi/drivers/s626.c
>> index 6976bb0..842b7db 100644
>> --- a/drivers/staging/comedi/drivers/s626.c
>> +++ b/drivers/staging/comedi/drivers/s626.c
>> @@ -78,7 +78,6 @@ struct s626_buffer_dma {
>>
>>   struct s626_private {
>>      uint8_t ai_cmd_running;         /* ai_cmd is running */
>> -    int ai_sample_count;            /* number of samples to acquire */
>>      unsigned int ai_sample_timer;   /* time between samples in
>>                                       * units of the timer */
>>      int ai_convert_count;           /* conversion counter */
>> @@ -1496,16 +1495,8 @@ static bool s626_handle_eos_interrupt(struct 
>> comedi_device *dev)
>>              comedi_buf_write_samples(s, &tempdata, 1);
>>      }
>>
>> -    /* end of scan occurs */
>> -    async->events |= COMEDI_CB_EOS;
>> -
>> -    if (cmd->stop_src == TRIG_COUNT) {
>> -            devpriv->ai_sample_count--;
>> -            if (devpriv->ai_sample_count <= 0) {
>> -                    devpriv->ai_cmd_running = 0;
>> -                    async->events |= COMEDI_CB_EOA;
>> -            }
>> -    }
>> +    if (cmd->stop_src == TRIG_COUNT && async->scans_done >= cmd->stop_arg)
>> +            async->events |= COMEDI_CB_EOA;
>
> I think you still need to set devpriv->ai_cmd_running to 0 here, don't you?

Ugh.. Looks like it's still needed. I'll update this patch and send a v2.

Thanks,
Hartley

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to