Lines Matching refs:pp

66 static int get_1284_register(struct parport *pp, unsigned char reg, unsigned char *val)  in get_1284_register()  argument
68 struct parport_uss720_private *priv = pp->private_data; in get_1284_register()
91 parport_generic_irq(0, pp, NULL); in get_1284_register()
99 static int set_1284_register(struct parport *pp, unsigned char reg, unsigned char val) in set_1284_register() argument
101 struct parport_uss720_private *priv = pp->private_data; in set_1284_register()
130 static int change_mode(struct parport *pp, int m) in change_mode() argument
132 struct parport_uss720_private *priv = pp->private_data; in change_mode()
135 if (get_1284_register(pp, 6, NULL)) in change_mode()
143 if (change_mode(pp, ECR_PS2)) in change_mode()
149 long expire = jiffies + pp->physport->cad->timeout; in change_mode()
155 if (get_1284_register(pp, 6, NULL)) in change_mode()
170 if (set_1284_register(pp, 6, m << 5)) in change_mode()
178 static int clear_epp_timeout(struct parport *pp) in clear_epp_timeout() argument
182 if (get_1284_register(pp, 1, &stat)) in clear_epp_timeout()
193 struct parport *pp = (struct parport *)dev_id;
194 struct parport_uss720_private *priv = pp->private_data;
201 parport_generic_irq(0, pp, NULL);
206 static void parport_uss720_write_data(struct parport *pp, unsigned char d) in parport_uss720_write_data() argument
208 set_1284_register(pp, 0, d); in parport_uss720_write_data()
211 static unsigned char parport_uss720_read_data(struct parport *pp) in parport_uss720_read_data() argument
215 if (get_1284_register(pp, 0, &ret)) in parport_uss720_read_data()
220 static void parport_uss720_write_control(struct parport *pp, unsigned char d) in parport_uss720_write_control() argument
222 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_write_control()
225 if (set_1284_register(pp, 2, d)) in parport_uss720_write_control()
230 static unsigned char parport_uss720_read_control(struct parport *pp) in parport_uss720_read_control() argument
232 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_read_control()
236 static unsigned char parport_uss720_frob_control(struct parport *pp, unsigned char mask, unsigned c… in parport_uss720_frob_control() argument
238 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_frob_control()
244 if (set_1284_register(pp, 2, d)) in parport_uss720_frob_control()
250 static unsigned char parport_uss720_read_status(struct parport *pp) in parport_uss720_read_status() argument
254 if (get_1284_register(pp, 1, &ret)) in parport_uss720_read_status()
259 static void parport_uss720_disable_irq(struct parport *pp) in parport_uss720_disable_irq() argument
261 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_disable_irq()
265 if (set_1284_register(pp, 2, d)) in parport_uss720_disable_irq()
270 static void parport_uss720_enable_irq(struct parport *pp) in parport_uss720_enable_irq() argument
272 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_enable_irq()
276 if (set_1284_register(pp, 2, d)) in parport_uss720_enable_irq()
281 static void parport_uss720_data_forward (struct parport *pp) in parport_uss720_data_forward() argument
283 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_data_forward()
287 if (set_1284_register(pp, 2, d)) in parport_uss720_data_forward()
292 static void parport_uss720_data_reverse (struct parport *pp) in parport_uss720_data_reverse() argument
294 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_data_reverse()
298 if (set_1284_register(pp, 2, d)) in parport_uss720_data_reverse()
309 static void parport_uss720_save_state(struct parport *pp, struct parport_state *s) in parport_uss720_save_state() argument
311 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_save_state()
313 if (get_1284_register(pp, 2, NULL)) in parport_uss720_save_state()
319 static void parport_uss720_restore_state(struct parport *pp, struct parport_state *s) in parport_uss720_restore_state() argument
321 set_1284_register(pp, 2, s->u.pc.ctr); in parport_uss720_restore_state()
322 set_1284_register(pp, 6, s->u.pc.ecr); in parport_uss720_restore_state()
323 get_1284_register(pp, 2, NULL); in parport_uss720_restore_state()
326 static size_t parport_uss720_epp_read_data(struct parport *pp, void *buf, size_t length, int flags) in parport_uss720_epp_read_data() argument
328 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_epp_read_data()
332 if (change_mode(pp, ECR_EPP)) in parport_uss720_epp_read_data()
335 if (get_1284_register(pp, 4, buff)) in parport_uss720_epp_read_data()
339 clear_epp_timeout(pp); in parport_uss720_epp_read_data()
343 change_mode(pp, ECR_PS2); in parport_uss720_epp_read_data()
347 static size_t parport_uss720_epp_write_data(struct parport *pp, const void *buf, size_t length, int… in parport_uss720_epp_write_data() argument
350 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_epp_write_data()
354 if (change_mode(pp, ECR_EPP)) in parport_uss720_epp_write_data()
357 if (set_1284_register(pp, 4, *buff)) in parport_uss720_epp_write_data()
360 if (get_1284_register(pp, 1, NULL)) in parport_uss720_epp_write_data()
363 clear_epp_timeout(pp); in parport_uss720_epp_write_data()
367 change_mode(pp, ECR_PS2); in parport_uss720_epp_write_data()
370 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_epp_write_data()
377 if (change_mode(pp, ECR_EPP)) in parport_uss720_epp_write_data()
382 change_mode(pp, ECR_PS2); in parport_uss720_epp_write_data()
387 static size_t parport_uss720_epp_read_addr(struct parport *pp, void *buf, size_t length, int flags) in parport_uss720_epp_read_addr() argument
389 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_epp_read_addr()
393 if (change_mode(pp, ECR_EPP)) in parport_uss720_epp_read_addr()
396 if (get_1284_register(pp, 3, buff)) in parport_uss720_epp_read_addr()
400 clear_epp_timeout(pp); in parport_uss720_epp_read_addr()
404 change_mode(pp, ECR_PS2); in parport_uss720_epp_read_addr()
408 static size_t parport_uss720_epp_write_addr(struct parport *pp, const void *buf, size_t length, int… in parport_uss720_epp_write_addr() argument
410 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_epp_write_addr()
414 if (change_mode(pp, ECR_EPP)) in parport_uss720_epp_write_addr()
417 if (set_1284_register(pp, 3, *buff)) in parport_uss720_epp_write_addr()
420 if (get_1284_register(pp, 1, NULL)) in parport_uss720_epp_write_addr()
423 clear_epp_timeout(pp); in parport_uss720_epp_write_addr()
427 change_mode(pp, ECR_PS2); in parport_uss720_epp_write_addr()
431 static size_t parport_uss720_ecp_write_data(struct parport *pp, const void *buffer, size_t len, int… in parport_uss720_ecp_write_data() argument
433 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_ecp_write_data()
440 if (change_mode(pp, ECR_ECP)) in parport_uss720_ecp_write_data()
445 change_mode(pp, ECR_PS2); in parport_uss720_ecp_write_data()
449 static size_t parport_uss720_ecp_read_data(struct parport *pp, void *buffer, size_t len, int flags) in parport_uss720_ecp_read_data() argument
451 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_ecp_read_data()
458 if (change_mode(pp, ECR_ECP)) in parport_uss720_ecp_read_data()
463 change_mode(pp, ECR_PS2); in parport_uss720_ecp_read_data()
467 static size_t parport_uss720_ecp_write_addr(struct parport *pp, const void *buffer, size_t len, int… in parport_uss720_ecp_write_addr() argument
472 if (change_mode(pp, ECR_ECP)) in parport_uss720_ecp_write_addr()
475 if (set_1284_register(pp, 5, *buff)) in parport_uss720_ecp_write_addr()
479 change_mode(pp, ECR_PS2); in parport_uss720_ecp_write_addr()
483 static size_t parport_uss720_write_compat(struct parport *pp, const void *buffer, size_t len, int f… in parport_uss720_write_compat() argument
485 struct parport_uss720_private *priv = pp->private_data; in parport_uss720_write_compat()
492 if (change_mode(pp, ECR_PPF)) in parport_uss720_write_compat()
497 change_mode(pp, ECR_PS2); in parport_uss720_write_compat()
559 struct parport *pp; in uss720_probe() local
581 if (!(pp = parport_register_port(0, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, &parport_uss720_ops))) { in uss720_probe()
586 pp->private_data = priv; in uss720_probe()
588pp->modes = PARPORT_MODE_PCSPP | PARPORT_MODE_TRISTATE | PARPORT_MODE_EPP | PARPORT_MODE_ECP | PAR… in uss720_probe()
591 set_1284_register(pp, 7, 0x00); in uss720_probe()
592 set_1284_register(pp, 6, 0x30); /* PS/2 mode */ in uss720_probe()
593 set_1284_register(pp, 2, 0x0c); in uss720_probe()
595 get_1284_register(pp, 0, NULL); in uss720_probe()
605 pp, &priv->irqhandle); in uss720_probe()
611 parport_proc_register(pp); in uss720_probe()
612 parport_announce_port(pp); in uss720_probe()
615 return pp; in uss720_probe()
619 parport_unregister_port(pp); in uss720_probe()
628 struct parport *pp = (struct parport *)ptr; in uss720_disconnect() local
629 struct parport_uss720_private *priv = pp->private_data; in uss720_disconnect()
635 parport_proc_unregister(pp); in uss720_disconnect()
636 parport_unregister_port(pp); in uss720_disconnect()