Lines Matching +full:- +full:p1
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * (c) 1997-1998 Grant R. Guenther <grant@torque.net>
5 * on26.c is a low-level protocol driver for the
19 * mode codes: 0 nybble reads, 8-bit writes
20 * 1 8-bit reads and writes
21 * 2 8-bit EPP mode
22 * 3 EPP-16
23 * 4 EPP-32
28 #define P1 \ macro
39 * cont = 0 - access the IDE register file
40 * cont = 1 - access the IDE command set
49 switch (pi->mode) { in on26_read_regr()
51 w0(1); P1; w0(r); P2; w0(0); P1; in on26_read_regr()
57 w0(1); P1; w0(r); P2; w0(0); P1; in on26_read_regr()
69 return -1; in on26_read_regr()
76 switch (pi->mode) { in on26_write_regr()
79 w0(1); P1; w0(r); P2; w0(0); P1; in on26_write_regr()
104 pi->saved_r0 = r0(); in on26_connect()
105 pi->saved_r2 = r2(); in on26_connect()
108 if (pi->mode) in on26_connect()
113 w0(2); P1; w0(8); P2; in on26_connect()
114 w0(2); P1; w0(x); P2; in on26_connect()
119 if (pi->mode >= 2) { in on26_disconnect()
122 w0(4); P1; w0(4); P1; in on26_disconnect()
125 w0(pi->saved_r0); in on26_disconnect()
126 w2(pi->saved_r2); in on26_disconnect()
136 pi->saved_r0 = r0(); in on26_test_port()
137 pi->saved_r2 = r2(); in on26_test_port()
139 d = pi->delay; in on26_test_port()
140 m = pi->mode; in on26_test_port()
141 pi->delay = 5; in on26_test_port()
142 pi->mode = 0; in on26_test_port()
156 w0(2); P1; w0(0); P2; in on26_test_port()
157 w0(3); P1; w0(0); P2; in on26_test_port()
158 w0(2); P1; w0(8); P2; udelay(100); in on26_test_port()
159 w0(2); P1; w0(0xa); P2; udelay(100); in on26_test_port()
160 w0(2); P1; w0(8); P2; udelay(1000); in on26_test_port()
175 dev_err(&pi->dev, in on26_test_port()
178 w0(4); P1; w0(4); P1; in on26_test_port()
183 pi->delay = d; in on26_test_port()
184 pi->mode = m; in on26_test_port()
185 w0(pi->saved_r0); in on26_test_port()
186 w2(pi->saved_r2); in on26_test_port()
195 switch (pi->mode) { in on26_read_block()
197 w0(1); P1; w0(1); P2; w0(2); P1; w0(0x18); P2; w0(0); P1; in on26_read_block()
204 w0(2); P1; w0(8); P2; in on26_read_block()
207 w0(1); P1; w0(1); P2; w0(2); P1; w0(0x19); P2; w0(0); P1; in on26_read_block()
213 w0(2); P1; w0(9); P2; in on26_read_block()
246 switch (pi->mode) { in on26_write_block()
249 w0(1); P1; w0(1); P2; in on26_write_block()
250 w0(2); P1; w0(0x18 + pi->mode); P2; w0(0); P1; in on26_write_block()
257 w0(2); P1; w0(8 + pi->mode); P2; in on26_write_block()
288 char *mode_string[5] = { "4-bit", "8-bit", "EPP-8", "EPP-16", "EPP-32" }; in on26_log_adapter()
290 dev_info(&pi->dev, in on26_log_adapter()
292 pi->port, pi->mode, mode_string[pi->mode], pi->delay); in on26_log_adapter()