summaryrefslogtreecommitdiffstats
path: root/drivers/block/paride
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
commit78c388aed2b7184182c08428db1de6c872d815f5 (patch)
tree4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /drivers/block/paride
parenteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff)
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'drivers/block/paride')
-rw-r--r--drivers/block/paride/frpw.c6
-rw-r--r--drivers/block/paride/jumbo70
-rw-r--r--drivers/block/paride/on26.c63
-rw-r--r--drivers/block/paride/pcd.c14
-rw-r--r--drivers/block/paride/pd.c9
-rw-r--r--drivers/block/paride/pf.c12
-rw-r--r--drivers/block/paride/pg.c21
-rw-r--r--drivers/block/paride/pt.c18
8 files changed, 185 insertions, 28 deletions
diff --git a/drivers/block/paride/frpw.c b/drivers/block/paride/frpw.c
index f965fb9da..680f9e592 100644
--- a/drivers/block/paride/frpw.c
+++ b/drivers/block/paride/frpw.c
@@ -12,10 +12,11 @@
1.01 GRG 1998.05.06 init_proto, release_proto
fix chip detect
added EPP-16 and EPP-32
+ 1.02 GRG 1998.09.23 added hard reset to initialisation process
*/
-#define FRPW_VERSION "1.01"
+#define FRPW_VERSION "1.02"
#include <linux/module.h>
#include <linux/delay.h>
@@ -184,6 +185,9 @@ static int frpw_test_pnp ( PIA *pi )
{ int olddelay, a, b;
+ w0(0); w2(8); udelay(50); w2(0xc); /* parallel bus reset */
+ mdelay(1500);
+
olddelay = pi->delay;
pi->delay = 10;
diff --git a/drivers/block/paride/jumbo b/drivers/block/paride/jumbo
new file mode 100644
index 000000000..b952fde92
--- /dev/null
+++ b/drivers/block/paride/jumbo
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# This script can be used to build "jumbo" modules that contain the
+# base PARIDE support, one protocol module and one high-level driver.
+#
+echo -n "High level driver [pcd] : "
+read X
+HLD=${X:-pcd}
+#
+echo -n "Protocol module [bpck] : "
+read X
+PROTO=${X:-bpck}
+#
+echo -n "Use MODVERSIONS [y] ? "
+read X
+UMODV=${X:-y}
+#
+echo -n "For SMP kernel [n] ? "
+read X
+USMP=${X:-n}
+#
+echo -n "Support PARPORT [n] ? "
+read X
+UPARP=${X:-n}
+#
+echo
+#
+case $USMP in
+ y* | Y* ) FSMP="-D__SMP__"
+ ;;
+ *) FSMP=""
+ ;;
+esac
+#
+MODI="-include ../../../include/linux/modversions.h"
+#
+case $UMODV in
+ y* | Y* ) FMODV="-DMODVERSIONS $MODI"
+ ;;
+ *) FMODV=""
+ ;;
+esac
+#
+case $UPARP in
+ y* | Y* ) FPARP="-DCONFIG_PARPORT"
+ ;;
+ *) FPARP=""
+ ;;
+esac
+#
+TARG=$HLD-$PROTO.o
+FPROTO=-DCONFIG_PARIDE_`echo "$PROTO" | tr [a-z] [A-Z]`
+FK="-D__KERNEL__ -I ../../../include"
+FLCH=-D_LINUX_CONFIG_H
+#
+echo cc $FK $FSMP $FLCH $FPARP $FPROTO -Wall -O2 -o Jb.o -c paride.c
+cc $FK $FSMP $FLCH $FPARP $FPROTO -Wall -O2 -o Jb.o -c paride.c
+#
+echo cc $FK $FSMP -Wall -O2 -o Jp.o -c $PROTO.c
+cc $FK $FSMP -Wall -O2 -o Jp.o -c $PROTO.c
+#
+echo cc $FK $FSMP $FMODV -DMODULE -DPARIDE_JUMBO -Wall -O2 -o Jd.o -c $HLD.c
+cc $FK $FSMP $FMODV -DMODULE -DPARIDE_JUMBO -Wall -O2 -o Jd.o -c $HLD.c
+#
+echo ld -r -o $TARG Jp.o Jb.o Jd.o
+ld -r -o $TARG Jp.o Jb.o Jd.o
+#
+#
+rm Jp.o Jb.o Jd.o
+#
diff --git a/drivers/block/paride/on26.c b/drivers/block/paride/on26.c
index 89457cc80..78477593e 100644
--- a/drivers/block/paride/on26.c
+++ b/drivers/block/paride/on26.c
@@ -10,10 +10,11 @@
/* Changes:
1.01 GRG 1998.05.06 init_proto, release_proto
+ 1.02 GRG 1998.09.23 updates for the -E rev chip
*/
-#define ON26_VERSION "1.01"
+#define ON26_VERSION "1.02"
#include <linux/module.h>
#include <linux/delay.h>
@@ -91,8 +92,8 @@ static void on26_write_regr( PIA *pi, int cont, int regr, int val )
}
}
-#define CCP(x) w0(0xff);w0(0xaa);w0(0x55);w0(0);w0(0xff);\
- w0(0x87);w0(0x78);w0(x);w2(4);
+#define CCP(x) w0(0xfe);w0(0xaa);w0(0x55);w0(0);w0(0xff);\
+ w0(0x87);w0(0x78);w0(x);w2(4);w2(5);w2(4);w0(0xff);
static void on26_connect ( PIA *pi )
@@ -102,7 +103,6 @@ static void on26_connect ( PIA *pi )
pi->saved_r2 = r2();
CCP(0x20);
- w2(0xcd); w2(0xcc); w0(0xff);
x = 8; if (pi->mode) x = 9;
w0(2); P1; w0(8); P2;
@@ -114,11 +114,62 @@ static void on26_disconnect ( PIA *pi )
{ if (pi->mode >= 2) { w3(4); w3(4); w3(4); w3(4); }
else { w0(4); P1; w0(4); P1; }
CCP(0x30);
- w2(0xcd); w2(0xcc); w0(0xff);
w0(pi->saved_r0);
w2(pi->saved_r2);
}
+static int on26_test_port( PIA *pi) /* hard reset */
+
+{ int i, m, d;
+
+ pi->saved_r0 = r0();
+ pi->saved_r2 = r2();
+
+ d = pi->delay;
+ m = pi->mode;
+ pi->delay = 5;
+ pi->mode = 0;
+
+ w2(0xc);
+
+ CCP(0x30); CCP(0);
+
+ w0(0xfe);w0(0xaa);w0(0x55);w0(0);w0(0xff);
+ i = ((r1() & 0xf0) << 4); w0(0x87);
+ i |= (r1() & 0xf0); w0(0x78);
+ w0(0x20);w2(4);w2(5);
+ i |= ((r1() & 0xf0) >> 4);
+ w2(4);w0(0xff);
+
+ if (i == 0xb5f) {
+
+ w0(2); P1; w0(0); P2;
+ w0(3); P1; w0(0); P2;
+ w0(2); P1; w0(8); P2; udelay(100);
+ w0(2); P1; w0(0xa); P2; udelay(100);
+ w0(2); P1; w0(8); P2; udelay(1000);
+
+ on26_write_regr(pi,0,6,0xa0);
+
+ for (i=0;i<100;i++) {
+ if (!(on26_read_regr(pi,0,7) & 0x80)) break;
+ udelay(100000);
+ }
+
+ w0(4); P1; w0(4); P1;
+ }
+
+ CCP(0x30);
+
+ pi->delay = d;
+ pi->mode = m;
+ w0(pi->saved_r0);
+ w2(pi->saved_r2);
+
+ return 5;
+}
+
+
static void on26_read_block( PIA *pi, char * buf, int count )
{ int k, a, b;
@@ -240,7 +291,7 @@ struct pi_protocol on26 = {"on26",0,5,2,1,1,
on26_read_block,
on26_connect,
on26_disconnect,
- 0,
+ on26_test_port,
0,
0,
on26_log_adapter,
diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 4a083abbf..6366afa6b 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -96,10 +96,11 @@
pcd_completion, use HZ in loop timing
1.05 GRG 1998.08.16 Conformed to "Uniform CD-ROM" standard
1.06 GRG 1998.08.19 Added audio ioctl support
+ 1.07 GRG 1998.09.24 Increased reset timeout, added jumbo support
*/
-#define PCD_VERSION "1.06"
+#define PCD_VERSION "1.07"
#define PCD_MAJOR 46
#define PCD_NAME "pcd"
#define PCD_UNITS 4
@@ -191,7 +192,7 @@ MODULE_PARM(drive3,"1-6i");
#define PCD_TMO 800 /* timeout in jiffies */
#define PCD_DELAY 50 /* spin delay in uS */
#define PCD_READY_TMO 20 /* in seconds */
-#define PCD_RESET_TMO 30 /* in tenths of a second */
+#define PCD_RESET_TMO 100 /* in tenths of a second */
#define PCD_SPIN (1000000*PCD_TMO)/(HZ*PCD_DELAY)
@@ -365,6 +366,12 @@ int init_module(void)
{ int err;
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
err = pcd_init();
return err;
@@ -552,8 +559,7 @@ static int pcd_tray_move(struct cdrom_device_info *cdi, int position)
static void pcd_sleep( int cs )
{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}
static int pcd_reset( int unit )
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 69274fe48..3518a59d6 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -110,10 +110,11 @@
Added slave support
1.03 GRG 1998.06.16 Eliminate an Ugh.
1.04 GRG 1998.08.15 Extra debugging, use HZ in loop timing
+ 1.05 GRG 1998.09.24 Added jumbo support
*/
-#define PD_VERSION "1.04"
+#define PD_VERSION "1.05"
#define PD_MAJOR 45
#define PD_NAME "pd"
#define PD_UNITS 4
@@ -611,6 +612,12 @@ int init_module(void)
{ int err, unit;
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
err = pd_init();
if (err) return err;
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index a2f1f1da9..255352f0a 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -109,10 +109,11 @@
up transfer size.
1.02 GRG 1998.06.16 Eliminated an Ugh
1.03 GRG 1998.08.16 Use HZ in loop timings, extra debugging
+ 1.04 GRG 1998.09.24 Added jumbo support
*/
-#define PF_VERSION "1.03"
+#define PF_VERSION "1.04"
#define PF_MAJOR 47
#define PF_NAME "pf"
#define PF_UNITS 4
@@ -509,6 +510,12 @@ int init_module(void)
{ int err;
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
err = pf_init();
return err;
@@ -653,8 +660,7 @@ static void pf_eject( int unit )
static void pf_sleep( int cs )
{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index fd001008d..1563a2afc 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -34,10 +34,10 @@
To use this device, you must have the following device
special files defined:
- /dev/pg0 b 97 0
- /dev/pg1 b 97 1
- /dev/pg2 b 97 2
- /dev/pg3 b 97 3
+ /dev/pg0 c 97 0
+ /dev/pg1 c 97 1
+ /dev/pg2 c 97 2
+ /dev/pg3 c 97 3
(You'll need to change the 97 to something else if you use
the 'major' parameter to install the driver on a different
@@ -117,9 +117,11 @@
/* Changes:
1.01 GRG 1998.06.16 Bug fixes
+ 1.02 GRG 1998.09.24 Added jumbo support
+
*/
-#define PG_VERSION "1.01"
+#define PG_VERSION "1.02"
#define PG_MAJOR 97
#define PG_NAME "pg"
#define PG_UNITS 4
@@ -324,6 +326,12 @@ int init_module(void)
{ int err;
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
err = pg_init();
return err;
@@ -349,8 +357,7 @@ void cleanup_module(void)
static void pg_sleep( int cs )
{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}
static int pg_wait( int unit, int go, int stop, int tmo, char * msg )
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 44c4dadfb..1a09c84b0 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -100,10 +100,11 @@
1.02 GRG 1998.06.16 Eliminate an Ugh.
1.03 GRG 1998.08.15 Adjusted PT_TMO, use HZ in loop timing,
extra debugging
-
+ 1.04 GRG 1998.09.24 Repair minor coding error, added jumbo support
+
*/
-#define PT_VERSION "1.03"
+#define PT_VERSION "1.04"
#define PT_MAJOR 96
#define PT_NAME "pt"
#define PT_UNITS 4
@@ -328,6 +329,12 @@ int init_module(void)
{ int err;
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
err = pt_init();
return err;
@@ -457,8 +464,7 @@ static int pt_atapi( int unit, char * cmd, int dlen, char * buf, char * fun )
static void pt_sleep( int cs )
{ current->state = TASK_INTERRUPTIBLE;
- current->timeout = jiffies + cs;
- schedule();
+ schedule_timeout(cs);
}
static int pt_poll_dsc( int unit, int pause, int tmo, char *msg )
@@ -584,8 +590,8 @@ static int pt_identify( int unit )
char *ms[2] = {"master","slave"};
char mf[10], id[18];
char id_cmd[12] = { ATAPI_IDENTIFY,0,0,0,36,0,0,0,0,0,0,0};
- char ms_cmd[12] = { ATAPI_MODE_SENSE,0,0x2a,0,128,0,0,0,0,0,0,0};
- char ls_cmd[12] = { ATAPI_LOG_SENSE,0,0x71,0,0,0,0,0,128,0,0,0};
+ char ms_cmd[12] = { ATAPI_MODE_SENSE,0,0x2a,0,36,0,0,0,0,0,0,0};
+ char ls_cmd[12] = { ATAPI_LOG_SENSE,0,0x71,0,0,0,0,0,36,0,0,0};
char buf[36];
s = pt_atapi(unit,id_cmd,36,buf,"identify");