From f3d3dad659df423f46ea8ec5050eb1af69eb1bf1 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 9 Sep 2014 13:05:49 -0700 Subject: [PATCH] staging: comedi: adl_pci9118: clarify acquisition mode (ai_do) determination The async command can operation in 4 modes in this driver. Modes 1 and 4 use timers 1 and 2 as a cascaded timer to trigger each conversion. Mode 1 begins the acquisitions immediately (scan_begin_src == TRIG_FOLLOW) and Mode 4 begins after an external trigger (scan_begin_src == TRIG_EXT). Both modes use a convert_src == TRIG_TIMER. Mode 2 uses timers 1 and 2 in a double timed action (scan_begin_src == TRIG_TIMER and convert_src != TRIG_EXT (TRIG_TIMER and TRIG_NOW are valid)). Mode 3 does not use the timers. Each acquisition is triggered by an external signal (scan_begin_src == TRIG_FOLLOW and convert_src == TRIG_EXT. The (*do_cmdtest) validates the scan_begin_src as TRIG_FOLLOW, TRIG_TIMER, or TRIG_EXT. Remove the invalid check for TRIG_INT in the (*do_cmd). Clarify the logic used to determine the mode in the (*do_cmd). Also, simplify pci9118_calc_divisors(). Call i8253_cascade_ns_to_timer() directly in the (*do_cmd) for the mode 1 and mode 4 cases. Call pci9118_calc_divisors() only for mode 2 acquisitions. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed