Fixed use of ai channels >= 64 on 6225. Based on patch from
authorFrank Mori Hess <fmhess@speakeasy.net>
Sat, 29 Sep 2007 00:01:47 +0000 (00:01 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sat, 29 Sep 2007 00:01:47 +0000 (00:01 +0000)
Ingmar Schoegl <ischoegl@mail.utexas.edu>.

comedi/drivers/ni_mio_common.c
comedi/drivers/ni_stc.h

index 552a4c6f9d57418d5a3068c23d171a4b4f07635d..b3c68e95fd00c1ad5be3220d9d7c1e6d73411741 100644 (file)
@@ -1795,7 +1795,7 @@ static void ni_m_series_load_channelgain_list(comedi_device *dev,unsigned int n_
                                break;
                }
                config_bits |= MSeries_AI_Config_Channel_Bits(chan);
-               config_bits |= MSeries_AI_Config_Bank_Bits(chan);
+               config_bits |= MSeries_AI_Config_Bank_Bits(boardtype.reg_type, chan);
                config_bits |= MSeries_AI_Config_Gain_Bits(range_code);
                if(i == n_chan - 1) config_bits |= MSeries_AI_Config_Last_Channel_Bit;
                if(dither) config_bits |= MSeries_AI_Config_Dither_Bit;
index e544d8d3f11f16fe36e2d6dd1faf17f35e84d5a8..a2184514e9891af903a4b7db58b02737e72a7e93 100644 (file)
@@ -1142,9 +1142,15 @@ static inline unsigned MSeries_AI_Config_Channel_Bits(unsigned channel)
 {
        return channel & 0xf;
 }
-static inline unsigned MSeries_AI_Config_Bank_Bits(unsigned channel)
+static inline unsigned MSeries_AI_Config_Bank_Bits(enum ni_reg_type reg_type, unsigned channel)
 {
-       return channel & 0x30;
+       unsigned bits = channel & 0x30;
+       if(reg_type == ni_reg_622x)
+       {
+               if(channel & 0x40)
+                       bits |= 0x400;
+       }
+       return bits;
 }
 static inline unsigned MSeries_AI_Config_Gain_Bits(unsigned range)
 {