20 #define FIT3_VERSION "1.0"
22 #include <linux/module.h>
25 #include <linux/kernel.h>
26 #include <linux/types.h>
27 #include <linux/wait.h>
32 #define j44(a,b) (((a>>3)&0x0f)|((b<<1)&0xf0))
34 #define w7(byte) {out_p(7,byte);}
35 #define r7() (in_p(7) & 0xff)
44 {
if (cont == 1)
return;
62 static int fit3_read_regr(
PIA *pi,
int cont,
int regr )
67 if (regr != 6)
return 0xff;
80 w2(0xec);
w2(0xee);
w2(0xef); a =
r0();
95 static void fit3_read_block(
PIA *pi,
char *
buf,
int count )
102 for (k=0;k<count/2;k++) {
107 buf[2*
k ] =
j44(a,b);
108 buf[2*k+1] =
j44(c,d);
115 for (k=0;k<count/2;k++) {
127 for (k=0;k<
count;k++) buf[k] =
r4();
134 static void fit3_write_block(
PIA *pi,
char * buf,
int count )
142 for (k=0;k<count/2;k++) {
143 w0(buf[2*k ]);
w2(0xd);
149 for (k=0;k<
count;k++)
w4(buf[k]);
155 static void fit3_connect (
PIA *pi )
165 static void fit3_disconnect (
PIA *pi )
174 {
char *mode_string[3] = {
"4-bit",
"8-bit",
"EPP"};
176 printk(
"%s: fit3 %s, FIT 3000 adapter at 0x%x, "
177 "mode %d (%s), delay %d\n",
190 .write_regr = fit3_write_regr,
191 .read_regr = fit3_read_regr,
192 .write_block = fit3_write_block,
193 .read_block = fit3_read_block,
194 .connect = fit3_connect,
195 .disconnect = fit3_disconnect,
196 .log_adapter = fit3_log_adapter,
199 static int __init fit3_init(
void)
204 static void __exit fit3_exit(
void)