aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/adl_pci9111.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-09-26 11:40:15 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-26 16:40:13 -0700
commitcb9cfd7ed3f6ed4c40167b4251cdb382b6b3ba1c (patch)
tree78aa9b8f1bd856b24b91e834580f3aa9531f703e /drivers/staging/comedi/drivers/adl_pci9111.c
parentfa57560c5d4d58591dda2b160731eb4da3619016 (diff)
staging: comedi: 8253.h: tidy up the i8253_cascade_ns_to_timer*() users
Introduce a couple defines for the common 8254 oscillator base values used in the comedi drivers and remove the custom defines and open coded values. Change the i8253_cascade_ns_to_timer_2div() calls in the drivers to the more generic i8253_cascade_ns_to_timer(). They are identical due to the #define in the 8253.h header. Remove the extra mask by TRIG_ROUND_MASK of the 'round_mode' parameter to i8253_cascade_ns_to_timer(). That function already handles the mask. Tidy up all the calls to i8253_cascade_ns_to_timer(). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/adl_pci9111.c')
-rw-r--r--drivers/staging/comedi/drivers/adl_pci9111.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c
index 89ca5078e8b..4db46f0f315 100644
--- a/drivers/staging/comedi/drivers/adl_pci9111.c
+++ b/drivers/staging/comedi/drivers/adl_pci9111.c
@@ -86,8 +86,6 @@ TODO:
#define PCI9111_AI_INSTANT_READ_UDELAY_US 2
#define PCI9111_AI_INSTANT_READ_TIMEOUT 100
-#define PCI9111_8254_CLOCK_PERIOD_NS 500
-
/*
* IO address map and bit defines
*/
@@ -393,11 +391,10 @@ static int pci9111_ai_do_cmd_test(struct comedi_device *dev,
if (cmd->convert_src == TRIG_TIMER) {
tmp = cmd->convert_arg;
- i8253_cascade_ns_to_timer_2div(PCI9111_8254_CLOCK_PERIOD_NS,
- &dev_private->div1,
- &dev_private->div2,
- &cmd->convert_arg,
- cmd->flags & TRIG_ROUND_MASK);
+ i8253_cascade_ns_to_timer(I8254_OSC_BASE_2MHZ,
+ &dev_private->div1,
+ &dev_private->div2,
+ &cmd->convert_arg, cmd->flags);
if (tmp != cmd->convert_arg)
error++;
}