From 26318c1c167517a83f3561767738d08e98757630 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 5 Sep 2014 09:25:42 -0700 Subject: [PATCH] staging: comedi: adl_pci9118: fix ai range/aref programming Currently the analog input range and aref are set in setup_channel_list(). This works for the (*insn_read) but the (*do_cmd) has a problem. In (*do_cmd) the ai control register is reset to 0 before the function works out the bits needed to control the acquisition. This happens after the setup_channel_list() call so the range is reset to bipolar and the aref to single-ended. Introduce a helper function, pci9118_ai_set_range_aref(), to handle the programming of the range and aref bits. This function first clears the cached value of the ai control register in the private data then sets the appropriate bits. The (*insn_read) and (*do_cmd) can then set the other bits needed to control the acquisition. Then setup_channel_list() just needs to program the chanlist scan data. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed