Lines Matching refs:pi

46 static int friq_read_regr(struct pi_adapter *pi, int cont, int regr)  in friq_read_regr()  argument
60 static void friq_write_regr(struct pi_adapter *pi, int cont, int regr, int val) in friq_write_regr() argument
69 static void friq_read_block_int(struct pi_adapter *pi, char *buf, int count, int regr) in friq_read_block_int() argument
73 switch (pi->mode) { in friq_read_block_int()
126 static void friq_read_block(struct pi_adapter *pi, char *buf, int count) in friq_read_block() argument
128 friq_read_block_int(pi, buf, count, 0x08); in friq_read_block()
131 static void friq_write_block(struct pi_adapter *pi, char *buf, int count) in friq_write_block() argument
135 switch (pi->mode) { in friq_write_block()
166 static void friq_connect(struct pi_adapter *pi) in friq_connect() argument
168 pi->saved_r0 = r0(); in friq_connect()
169 pi->saved_r2 = r2(); in friq_connect()
173 static void friq_disconnect(struct pi_adapter *pi) in friq_disconnect() argument
176 w0(pi->saved_r0); in friq_disconnect()
177 w2(pi->saved_r2); in friq_disconnect()
180 static int friq_test_proto(struct pi_adapter *pi) in friq_test_proto() argument
186 pi->saved_r0 = r0(); in friq_test_proto()
189 w0(pi->saved_r0); in friq_test_proto()
191 friq_connect(pi); in friq_test_proto()
193 friq_write_regr(pi, 0, 6, 0xa0 + j * 0x10); in friq_test_proto()
195 friq_write_regr(pi, 0, 2, k ^ 0xaa); in friq_test_proto()
196 friq_write_regr(pi, 0, 3, k ^ 0x55); in friq_test_proto()
197 if (friq_read_regr(pi, 0, 2) != (k ^ 0xaa)) in friq_test_proto()
201 friq_disconnect(pi); in friq_test_proto()
203 friq_connect(pi); in friq_test_proto()
204 friq_read_block_int(pi, scratch, 512, 0x10); in friq_test_proto()
210 friq_disconnect(pi); in friq_test_proto()
212 dev_dbg(&pi->dev, in friq_test_proto()
214 pi->port, pi->mode, e[0], e[1], r); in friq_test_proto()
219 static void friq_log_adapter(struct pi_adapter *pi) in friq_log_adapter() argument
223 dev_info(&pi->dev, in friq_log_adapter()
225 pi->port, pi->mode, mode_string[pi->mode], pi->delay); in friq_log_adapter()
227 pi->private = 1; in friq_log_adapter()
228 friq_connect(pi); in friq_log_adapter()
230 friq_disconnect(pi); in friq_log_adapter()
233 static void friq_release_proto(struct pi_adapter *pi) in friq_release_proto() argument
235 if (pi->private) { /* turn off the power */ in friq_release_proto()
236 friq_connect(pi); in friq_release_proto()
238 friq_disconnect(pi); in friq_release_proto()
239 pi->private = 0; in friq_release_proto()