Skip to content

Commit 0c1e81d

Browse files
Ondrej Zarydamien-lemoal
authored andcommitted
ata: pata_parport: fit3: implement IDE command set registers
fit3 protocol driver does not support accessing IDE control registers (device control/altstatus). The DOS driver does not use these registers either (as observed from DOSEMU trace). But the HW seems to be capable of accessing these registers - I simply tried bit 3 and it works! The control register is required to properly reset ATAPI devices or they will be detected only once (after a power cycle). Tested with EXP Computer CD-865 with MC-1285B EPP cable and TransDisk 3000. Signed-off-by: Ondrej Zary <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
1 parent f343e57 commit 0c1e81d

File tree

1 file changed

+2
-12
lines changed
  • drivers/ata/pata_parport

1 file changed

+2
-12
lines changed

drivers/ata/pata_parport/fit3.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
*
1010
* The TD-2000 and certain older devices use a different protocol.
1111
* Try the fit2 protocol module with them.
12-
*
13-
* NB: The FIT adapters do not appear to support the control
14-
* registers. So, we map ALT_STATUS to STATUS and NO-OP writes
15-
* to the device control register - this means that IDE reset
16-
* will not work on these devices.
1712
*/
1813

1914
#include <linux/module.h>
@@ -37,8 +32,7 @@
3732

3833
static void fit3_write_regr(struct pi_adapter *pi, int cont, int regr, int val)
3934
{
40-
if (cont == 1)
41-
return;
35+
regr += cont << 3;
4236

4337
switch (pi->mode) {
4438
case 0:
@@ -59,11 +53,7 @@ static int fit3_read_regr(struct pi_adapter *pi, int cont, int regr)
5953
{
6054
int a, b;
6155

62-
if (cont) {
63-
if (regr != 6)
64-
return 0xff;
65-
regr = 7;
66-
}
56+
regr += cont << 3;
6757

6858
switch (pi->mode) {
6959
case 0:

0 commit comments

Comments
 (0)