59 #include "../comedidev.h"
65 #define MPC624_SIZE 16
68 #define MPC624_MASTER_CONTROL 0
69 #define MPC624_GNMUXCH 1
74 #define MPC624_IRQ_MASK 6
77 #define MPC624_ADBUSY (1<<5)
78 #define MPC624_ADSDO (1<<4)
79 #define MPC624_ADFO (1<<3)
80 #define MPC624_ADCS (1<<2)
81 #define MPC624_ADSCK (1<<1)
82 #define MPC624_ADSDI (1<<0)
85 #define MPC624_OSR4 (1<<31)
86 #define MPC624_OSR3 (1<<30)
87 #define MPC624_OSR2 (1<<29)
88 #define MPC624_OSR1 (1<<28)
89 #define MPC624_OSR0 (1<<27)
92 #define MPC624_EOC_BIT (1<<31)
93 #define MPC624_DMY_BIT (1<<30)
94 #define MPC624_SGN_BIT (1<<29)
112 #define MPC624_SPEED_3_52_kHz (MPC624_OSR4 | MPC624_OSR0)
113 #define MPC624_SPEED_1_76_kHz (MPC624_OSR4 | MPC624_OSR1)
114 #define MPC624_SPEED_880_Hz (MPC624_OSR4 | MPC624_OSR1 | MPC624_OSR0)
115 #define MPC624_SPEED_440_Hz (MPC624_OSR4 | MPC624_OSR2)
116 #define MPC624_SPEED_220_Hz (MPC624_OSR4 | MPC624_OSR2 | MPC624_OSR0)
117 #define MPC624_SPEED_110_Hz (MPC624_OSR4 | MPC624_OSR2 | MPC624_OSR1)
118 #define MPC624_SPEED_55_Hz \
119 (MPC624_OSR4 | MPC624_OSR2 | MPC624_OSR1 | MPC624_OSR0)
120 #define MPC624_SPEED_27_5_Hz (MPC624_OSR4 | MPC624_OSR3)
121 #define MPC624_SPEED_13_75_Hz (MPC624_OSR4 | MPC624_OSR3 | MPC624_OSR0)
122 #define MPC624_SPEED_6_875_Hz \
123 (MPC624_OSR4 | MPC624_OSR3 | MPC624_OSR2 | MPC624_OSR1 | MPC624_OSR0)
131 #define devpriv ((struct skel_private *)dev->private)
160 unsigned char ucPort;
173 for (n = 0; n < insn->
n; n++) {
183 for (i = 0; i <
TIMEOUT; i++) {
197 data_out =
devpriv->ulConvertionRate;
199 for (i = 0; i < 32; i++) {
204 if (data_out & (1 << 31)) {
263 data_in &= 0x3FFFFFFF;
275 data_in = 0x20000000 - data_in;
301 if (alloc_private(dev,
sizeof(
struct skel_private)) < 0)
347 (
KERN_ERR "illegal conversion rate setting!"
348 " Valid numbers are 0..9. Using 9 => 6.875 Hz, ");
390 .driver_name =
"mpc624",
392 .attach = mpc624_attach,
393 .detach = mpc624_detach