summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-04-29 12:59:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-05-03 20:06:35 -0400
commit90c32ce300fb79f45d55803bc021c4e49ed9b85f (patch)
treed4e6d494bcc81325aaaab3698bfe87f118e6a53b
parente72f7ad46e73b5cd372cdf6834d0dd0e0000d7ad (diff)
staging: comedi: amplc_pci244: clarify 8254 timer programming
Refactor the 8254 timer programming to use the i8254_set_mode() and i8254_write() helpers instead of i8254_load(). This allows us to use the I8254_MODE* defines to clarify the code. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/amplc_pci224.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c
index 3002156e7e79..c2b352c3c6a6 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -868,6 +868,7 @@ static void pci224_ao_start_pacer(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct pci224_private *devpriv = dev->private;
+ unsigned long timer_base = devpriv->iobase1 + PCI224_Z2_CT0;
/*
* The output of timer Z2-0 will be used as the scan trigger
@@ -881,13 +882,13 @@ static void pci224_ao_start_pacer(struct comedi_device *dev,
/* Z2-2 needs 10 MHz clock. */
outb(CLK_CONFIG(2, CLK_10MHZ), devpriv->iobase1 + PCI224_ZCLK_SCE);
/* Load Z2-2 mode (2) and counter (div1). */
- i8254_load(devpriv->iobase1 + PCI224_Z2_CT0, 0,
- 2, devpriv->cached_div1, 2);
+ i8254_set_mode(timer_base, 0, 2, I8254_MODE2 | I8254_BINARY);
+ i8254_write(timer_base, 0, 2, devpriv->cached_div1);
/* Z2-0 is clocked from Z2-2's output. */
outb(CLK_CONFIG(0, CLK_OUTNM1), devpriv->iobase1 + PCI224_ZCLK_SCE);
/* Load Z2-0 mode (2) and counter (div2). */
- i8254_load(devpriv->iobase1 + PCI224_Z2_CT0, 0,
- 0, devpriv->cached_div2, 2);
+ i8254_set_mode(timer_base, 0, 0, I8254_MODE2 | I8254_BINARY);
+ i8254_write(timer_base, 0, 0, devpriv->cached_div2);
}
static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)