/* Setup the channel-gain table from a comedi list  */
static void rtd_load_channelgain_list(struct comedi_device *dev, unsigned int n_chan, unsigned int *list)
/* Setup the channel-gain table from a comedi list  */
static void rtd_load_channelgain_list(struct comedi_device *dev, unsigned int n_chan, unsigned int *list)
{
	if (n_chan > 1) {
		int ii;
		RtdClearCGT(dev);
		RtdEnableCGT(dev, 1);
		for (ii = 0; ii < n_chan; ii++) {
			RtdWriteCGTable(dev, rtdConvertChanGain(dev, list[ii],
								ii));
		}
	} else {
		RtdEnableCGT(dev, 0);
		RtdWriteCGLatch(dev, rtdConvertChanGain(dev, list[0], 0));
	}
}