Lines Matching refs:pi

22 #define PC			pi->private
38 static int bpck_read_regr(struct pi_adapter *pi, int cont, int regr) in bpck_read_regr() argument
44 switch (pi->mode) { in bpck_read_regr()
69 static void bpck_write_regr(struct pi_adapter *pi, int cont, int regr, int val) in bpck_write_regr() argument
75 switch (pi->mode) { in bpck_write_regr()
93 #define WR(r,v) bpck_write_regr(pi,2,r,v)
94 #define RR(r) (bpck_read_regr(pi,2,r))
96 static void bpck_write_block(struct pi_adapter *pi, char *buf, int count) in bpck_write_block() argument
100 switch (pi->mode) { in bpck_write_block()
151 static void bpck_read_block(struct pi_adapter *pi, char *buf, int count) in bpck_read_block() argument
155 switch (pi->mode) { in bpck_read_block()
209 static int bpck_probe_unit(struct pi_adapter *pi) in bpck_probe_unit() argument
214 id = pi->unit; in bpck_probe_unit()
235 static void bpck_connect(struct pi_adapter *pi) in bpck_connect() argument
237 pi->saved_r0 = r0(); in bpck_connect()
238 w0(0xff-pi->unit); w2(4); w0(pi->unit); in bpck_connect()
242 switch (pi->mode) { in bpck_connect()
271 static void bpck_disconnect(struct pi_adapter *pi) in bpck_disconnect() argument
274 if (pi->mode >= 2) { in bpck_disconnect()
279 w2(0x4c); w0(pi->saved_r0); in bpck_disconnect()
282 static void bpck_force_spp(struct pi_adapter *pi) in bpck_force_spp() argument
285 pi->saved_r0 = r0(); in bpck_force_spp()
286 w0(0xff-pi->unit); w2(4); w0(pi->unit); in bpck_force_spp()
294 w2(0x4c); w0(pi->saved_r0); in bpck_force_spp()
299 static int bpck_test_proto(struct pi_adapter *pi) in bpck_test_proto() argument
304 bpck_force_spp(pi); in bpck_test_proto()
306 switch (pi->mode) { in bpck_test_proto()
309 bpck_connect(pi); in bpck_test_proto()
317 bpck_disconnect(pi); in bpck_test_proto()
321 bpck_connect(pi); in bpck_test_proto()
329 bpck_disconnect(pi); in bpck_test_proto()
335 om = pi->mode; in bpck_test_proto()
336 pi->mode = 0; in bpck_test_proto()
337 bpck_connect(pi); in bpck_test_proto()
340 bpck_disconnect(pi); in bpck_test_proto()
342 pi->mode = om; in bpck_test_proto()
343 bpck_connect(pi); in bpck_test_proto()
346 switch (pi->mode) { in bpck_test_proto()
363 bpck_disconnect(pi); in bpck_test_proto()
368 dev_dbg(&pi->dev, "bpck: 0x%x unit %d mode %d: ", in bpck_test_proto()
369 pi->port, pi->unit, pi->mode); in bpck_test_proto()
382 static void bpck_read_eeprom(struct pi_adapter *pi, char *buf) in bpck_read_eeprom() argument
386 bpck_force_spp(pi); in bpck_read_eeprom()
388 om = pi->mode; od = pi->delay; in bpck_read_eeprom()
389 pi->mode = 0; pi->delay = 6; in bpck_read_eeprom()
391 bpck_connect(pi); in bpck_read_eeprom()
421 bpck_disconnect(pi); in bpck_read_eeprom()
424 bpck_connect(pi); in bpck_read_eeprom()
427 bpck_disconnect(pi); in bpck_read_eeprom()
430 pi->mode = om; pi->delay = od; in bpck_read_eeprom()
433 static int bpck_test_port(struct pi_adapter *pi) in bpck_test_port() argument
472 static void bpck_log_adapter(struct pi_adapter *pi) in bpck_log_adapter() argument
477 bpck_read_eeprom(pi,scratch); in bpck_log_adapter()
479 dev_info(&pi->dev, in bpck_log_adapter()
481 &scratch[110], pi->unit, pi->port, pi->mode, in bpck_log_adapter()
482 mode_str[pi->mode], pi->delay); in bpck_log_adapter()