]> git.karo-electronics.de Git - linux-beck.git/commit
staging: comedi: pcl818: cleanup setup_channel_list()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Mar 2014 18:30:17 +0000 (11:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 01:06:18 +0000 (17:06 -0800)
commit933ccd824d3bf099ae59f3ddf76f55f94b8bb22f
treede87e0cdf1d2ac5f9da70b120e6a5a510c77a271
parent19720c07f1f82c21311f3f7ac3e9b993598d6b70
staging: comedi: pcl818: cleanup setup_channel_list()

Move this function to remove the need for the forward declaration. Rename it
so it has namespace associated with the driver. Remove the unnecessary
comedi_subdevice parameter from the function.

The hardware has per-channel programmable gain. This function first sets the
range for each channel then sets the mux register to automatically scan the
channels.

The use of 'muxonechan' when programming the ranges is incorrect. Only the low
4-bits are supposed to be set when programming the ranges.

Introduce a couple helper functions to set the range for a channel and to set
the first/last channels to scan.

Tidy up the range and mux register defines.

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>
drivers/staging/comedi/drivers/pcl818.c