On Wednesday, May 04, 2016 9:01 AM, Ian Abbott wrote: > On 04/05/16 01:25, H Hartley Sweeten wrote: >> The A/D ranges are not programmable but the gain is. Currently this driver >> uses a configuration option to select the comedi_lrange that will be used >> for the analog input subdevice. This requires that the user makes sure the >> correct option value is used. >> >> The user space library uses the range information to convert between raw >> values and physical units. If the user passed an incorrect option when >> attaching the driver the conversion will be incorrect. >> >> A previous patch allowed the gain to be set based on the chanspec range. >> Prior to that the gain was always set to 1 so any conversion with a gain >> that is not 1 would be incorrect anyway. >> >> Simplify the analog input ranges by providing a range_table for the pgh and >> pgl boards that contain all the possible range/gain options. The user can >> then select the correct range (and gain) when converting values or reading >> the analog inputs. >> >> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> >> Cc: Ian Abbott <abbotti@xxxxxxxxx> >> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> [snip] > I think it will be better to put the UNI_RANGE entries at the bottom. > Then, if the user previously defaulted option[3] to 0, the first four > ranges in the table would be the same as they were before (not that the > ranges worked properly before anyway!). The manual I found for the dt2811 (actually it's for a PC-74 board that is register compatible), lists the "default factory" settings for the D/A jumpers but not for the A/D jumpers so I created the combined table in the order the manual describes the input ranges. But changing it to match how the configuration options were listed is not a problem. I'll fix this up and repost the series shortly. Thanks, Hartley _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel