patch-2.3.13 linux/drivers/parport/parport_amiga.c

Next file: linux/drivers/parport/parport_arc.c
Previous file: linux/drivers/parport/init.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.12/linux/drivers/parport/parport_amiga.c linux/drivers/parport/parport_amiga.c
@@ -25,7 +25,7 @@
 #ifdef DEBUG
 #define DPRINTK printk
 #else
-static inline int DPRINTK() {return 0;}
+#define DPRINTK(format, args...)
 #endif
 
 static struct parport *this_port = NULL;
@@ -48,10 +48,6 @@
 {
 	unsigned char ret = 0;
 
-	if (control & PARPORT_CONTROL_DIRECTION) /* XXX: What is this? */
-		;
-	if (control & PARPORT_CONTROL_INTEN) /* XXX: What is INTEN? */
-		;
 	if (control & PARPORT_CONTROL_SELECT) /* XXX: What is SELECP? */
 		;
 	if (control & PARPORT_CONTROL_INIT) /* INITP */
@@ -66,7 +62,7 @@
 
 static unsigned char control_amiga_to_pc(unsigned char control)
 {
-	return PARPORT_CONTROL_INTEN | PARPORT_CONTROL_SELECT |
+	return PARPORT_CONTROL_SELECT |
 	      PARPORT_CONTROL_AUTOFD | PARPORT_CONTROL_STROBE;
 	/* fake value: interrupt enable, select in, no reset,
 	no autolf, no strobe - seems to be closest the wiring diagram */
@@ -127,12 +123,6 @@
 	return ret;
 }
 
-static void amiga_write_status( struct parport *p, unsigned char status)
-{
-DPRINTK("write_status %02x\n",status);
-	ciab.pra |= (ciab.pra & 0xf8) | status_pc_to_amiga(status);
-}
-
 static unsigned char amiga_read_status(struct parport *p)
 {
 	unsigned char status;
@@ -142,20 +132,13 @@
 	return status;
 }
 
-static void amiga_change_mode( struct parport *p, int m)
-{
-	/* XXX: This port only has one mode, and I am
-	not sure about the corresponding PC-style mode*/
-}
-
 /* as this ports irq handling is already done, we use a generic funktion */
 static void amiga_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	parport_generic_irq(irq, (struct parport *) dev_id, regs);
 }
 
-
-static void amiga_init_state(struct parport_state *s)
+static void amiga_init_state(struct pardevice *dev, struct parport_state *s)
 {
 	s->u.amiga.data = 0;
 	s->u.amiga.datadir = 255;
@@ -215,8 +198,6 @@
 	NULL, /* data_forward */
 	NULL, /* data_reverse */
 
-	amiga_interrupt, 
-
 	amiga_init_state,
 	amiga_save_state,
 	amiga_restore_state,
@@ -224,18 +205,18 @@
 	amiga_inc_use_count,
 	amiga_dec_use_count,
 
-	parport_ieee1284_epp_write_data,
-	parport_ieee1284_epp_read_data, /* impossible? */
-	parport_ieee1284_epp_write_addr,
-	parport_ieee1284_epp_read_addr, /* impossible? */
-
-	parport_ieee1284_ecp_write_data,
-	parport_ieee1284_ecp_read_data, /* impossible? */
-	parport_ieee1284_ecp_write_addr,
-
-	parport_ieee1284_write_compat, /* FIXME - need to write amiga one */
-	parport_ieee1284_read_nibble,
-	parport_ieee1284_read_byte, /* impossible? */
+	NULL, /* epp_write_data */
+	NULL, /* epp_read_data */
+	NULL, /* epp_write_addr */
+	NULL, /* epp_read_addr */
+
+	NULL, /* ecp_write_data */
+	NULL, /* ecp_read_data */
+	NULL, /* ecp_write_addr */
+
+	NULL, /* compat_write_data */
+	NULL, /* nibble_read_data */
+	NULL, /* byte_read_data */
 };
 
 /* ----------- Initialisation code --------------------------------- */
@@ -251,20 +232,17 @@
 					IRQ_AMIGA_CIAA_FLG, PARPORT_DMA_NONE,
 					&pp_amiga_ops)))
 			return 0;
-		this_port = p;
-		printk(KERN_INFO "%s: Amiga built-in port using irq\n", p->name);
-		/* XXX: set operating mode */
-		parport_proc_register(p);
-		if (request_irq(IRQ_AMIGA_CIAA_FLG, amiga_interrupt, 0,
-				p->name, p)) {
+		if (!request_irq(IRQ_AMIGA_CIAA_FLG, amiga_interrupt, 0, p->name, p)) {
 			parport_unregister_port (p);
 			return 0;
 		}
 
-		if (parport_probe_hook)
-			(*parport_probe_hook)(p);
+		this_port = p;
+		printk(KERN_INFO "%s: Amiga built-in port using irq\n", p->name);
+		/* XXX: set operating mode */
+		parport_proc_register(p);
 
-		parport_announce_port (p);
+		parport_announce_port(p);
 
 		return 1;
 
@@ -285,8 +263,8 @@
 
 void cleanup_module(void)
 {
-	if (p->irq != PARPORT_IRQ_NONE)
-		free_irq(IRQ_AMIGA_CIAA_FLG, p);
+	if (this_port->irq != PARPORT_IRQ_NONE)
+		free_irq(IRQ_MFP_BUSY, this_port);
 	parport_proc_unregister(this_port);
 	parport_unregister_port(this_port);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)