Re: [RFC PATCH 12/36] staging: comedi: cb_das16_cs: convert driver to use the comedi_8254 module

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

 



On 20/02/15 23:04, H Hartley Sweeten wrote:
The hardware supported by this drive has an 8254 timer. Currently this driver
does not use the timer functions.

For aesthetics, use the comedi_8254 module to provide support for the 8254
timer. This will ensure that the counters are all reset and make it easier
to add functionality later.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
  drivers/staging/comedi/Kconfig               |  1 +
  drivers/staging/comedi/drivers/cb_das16_cs.c | 12 +++++++-----
  2 files changed, 8 insertions(+), 5 deletions(-)

[snip]
diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index 1079b6c..e7612cb 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -41,16 +41,13 @@ Status: experimental
  #include "../comedi_pcmcia.h"

  #include "comedi_fc.h"
-#include "8253.h"
+#include "comedi_8254.h"

  #define DAS16CS_ADC_DATA		0
  #define DAS16CS_DIO_MUX			2
  #define DAS16CS_MISC1			4
  #define DAS16CS_MISC2			6
-#define DAS16CS_CTR0			8
-#define DAS16CS_CTR1			10
-#define DAS16CS_CTR2			12
-#define DAS16CS_CTR_CONTROL		14
+#define DAS16CS_TIMER_BASE		8
  #define DAS16CS_DIO			16

  struct das16cs_board {
@@ -279,6 +276,11 @@ static int das16cs_auto_attach(struct comedi_device *dev,
  	if (!devpriv)
  		return -ENOMEM;

+	dev->pacer = comedi_8254_init(dev->iobase + DAS16CS_TIMER_BASE,
+				      I8254_OSC_BASE_10MHZ, I8254_IO16, 1);

Again, it depends if patch 01 is wrong or not regarding the interpretation of regshift value. The registers should be on 2-byte boundaries.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
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