Re: [PATCH 00/31] staging: comedi: pcl711: cleanup driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013-09-21 00:33, H Hartley Sweeten wrote:
Tidy up this driver a bit.

Unfortunately not a great reduction in the lines of code but it did
uncover a couple bugs in the 8112 board and async command support.

The async command support still needs to be looked over.
   1) The analog input sample read in the interrupt routine is not
      returned to the user.
   2) The scan_end_src and/or stop_src appears to be broken. As noted
      in the interrupt routine, nothing sets 'ntrig' which is used to
      cause the COMEDI_CB_EOA event.

H Hartley Sweeten (31):
   staging: comedi: pcl711: convert boardinfo declaration to C99 format
   staging: comedi: pcl711: remove all '= 0' boardinfo
   staging: comedi: pcl711: remove unused boardinfo
   staging: comedi: pcl711: convert boardinfo flags to bit-fields
   staging: comedi: pcl711: tidy up the comedi_lrange tables
   staging: comedi: pcl711: don't fail attach if irq is unavailable
   staging: comedi: pcl711: remove PCL711_SIZE
   staging: comedi: pcl711: tidy up the subdevice init
   staging: comedi: pcl711: save the irq for the pcl711b only when used
   staging: comedi: pcl711: tidy up the register map defines
   staging: comedi: pcl711: tidy up pcl711_ao_insn()
   staging: comedi: pcl711: tidy up pcl711_ao_insn_read()
   staging: comedi: pcl711: introduce pcl711_ai_get_sample()
   staging: comedi: pcl711: use dev->read_subdev in interrupt handler
   staging: comedi: pcl711: factor out the ai end-of-conversion wait
   staging: comedi: pcl711: fix pcl711_set_changain()
   staging: comedi: pcl711: add differential input support for 8112 boards
   staging: comedi: pcl711: define the mode register magic numbers
   staging: comedi: pcl711: remove unnecessary test of 'board->is_8112'
   staging: comedi: pcl711: fix software trigger for board->is_8112
   staging: comedi: pcl711: tidy up pcl711_ai_insn()
   staging: comedi: pcl711: remove 'is_8112' from boardinfo
   staging: comedi: pcl711: remove 'is_pcl711b' from boardinfo
   staging: comedi: pcl711: remove unused private data members
   staging: comedi: pcl711: use 8253.h helper to set the timers
   staging: comedi: pcl711: remove 'i8253_osc_base'
   staging: comedi: pcl711: no need to calc the timer values twice
   staging: comedi: pcl711: rename some of the register map defines
   staging: comedi: pcl711: tidy up multi line comments
   staging: comedi: pcl711: reorder includes
   staging: comedi: pcl711: change MODULE_DESCRIPTION

  drivers/staging/comedi/drivers/pcl711.c | 656
+++++++++++++++-----------------
  1 file changed, 317 insertions(+), 339 deletions(-)

--
1.8.3.2

Looks good.

I can take a look at the async command support once this series has been committed if you like. Basically, comedi_buf_put() can be used in the interrupt handler to write the sample to the comedi buffer. If it returns 0 (unsuccessful), the interrupt routine should set the COMEDI_CB_OVERFLOW event flag (it can also set COMEDI_CB_ERROR, but that is already set by comedi_buf_put()). If comedi_buf_put() returns 1 (successful), then since the "scan length" is always 1 (a single sample) in this driver, it can set the COMEDI_CB_EOS event flag. pcl711_ai_cmd() should set devpriv->ntrig to the number of scans (or the number of conversions) if cmd->stop_src == TRIG_COUNT. The interrupt handler should only decrement devpriv->ntrig if s->async->cmd.stop_src == TRIG_COUNT. (Also, devpriv->ntrig should be an unsigned int.)

Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx>

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux