patch-2.3.41 linux/drivers/parport/parport_amiga.c
Next file: linux/drivers/parport/parport_mfc3.c
Previous file: linux/drivers/parport/init.c
Back to the patch index
Back to the overall index
- Lines: 131
- Date:
Wed Jan 26 12:45:20 2000
- Orig file:
v2.3.40/linux/drivers/parport/parport_amiga.c
- Orig date:
Tue Aug 31 17:29:14 1999
diff -u --recursive --new-file v2.3.40/linux/drivers/parport/parport_amiga.c linux/drivers/parport/parport_amiga.c
@@ -1,6 +1,6 @@
/* Low-level parallel port routines for the Amiga buildin port
*
- * Author: Joerg Dorchain <dorchain@wirbel.com>
+ * Author: Joerg Dorchain <joerg@dorchain.net>
*
* This is a complete rewrite of the code, but based heaviy upon the old
* lp_intern. code.
@@ -25,7 +25,7 @@
#ifdef DEBUG
#define DPRINTK printk
#else
-#define DPRINTK(format, args...)
+static inline void DPRINTK(void *nothing, ...) {}
#endif
static struct parport *this_port = NULL;
@@ -90,7 +90,7 @@
return old;
}
-
+#if 0 /* currently unused */
static unsigned char status_pc_to_amiga(unsigned char status)
{
unsigned char ret = 1;
@@ -107,6 +107,7 @@
/* not connected */;
return ret;
}
+#endif
static unsigned char status_amiga_to_pc(unsigned char status)
{
@@ -138,6 +139,28 @@
parport_generic_irq(irq, (struct parport *) dev_id, regs);
}
+static void amiga_enable_irq(struct parport *p)
+{
+ enable_irq(IRQ_AMIGA_CIAA_FLG);
+}
+
+static void amiga_disable_irq(struct parport *p)
+{
+ disable_irq(IRQ_AMIGA_CIAA_FLG);
+}
+
+static void amiga_data_forward(struct parport *p)
+{
+ DPRINTK("forward\n");
+ ciaa.ddrb = 0xff; /* all pins output */
+}
+
+static void amiga_data_reverse(struct parport *p)
+{
+ DPRINTK("reverse\n");
+ ciaa.ddrb = 0; /* all pins input */
+}
+
static void amiga_init_state(struct pardevice *dev, struct parport_state *s)
{
s->u.amiga.data = 0;
@@ -162,16 +185,6 @@
ciab.ddra |= (ciab.ddra & 0xf8) | s->u.amiga.statusdir;
}
-static void amiga_enable_irq(struct parport *p)
-{
- enable_irq(IRQ_AMIGA_CIAA_FLG);
-}
-
-static void amiga_disable_irq(struct parport *p)
-{
- disable_irq(IRQ_AMIGA_CIAA_FLG);
-}
-
static void amiga_inc_use_count(void)
{
MOD_INC_USE_COUNT;
@@ -195,8 +208,8 @@
amiga_enable_irq,
amiga_disable_irq,
- NULL, /* data_forward */
- NULL, /* data_reverse */
+ amiga_data_forward,
+ amiga_data_reverse,
amiga_init_state,
amiga_save_state,
@@ -205,18 +218,18 @@
amiga_inc_use_count,
amiga_dec_use_count,
- 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 */
+ parport_ieee1284_epp_write_data,
+ parport_ieee1284_epp_read_data,
+ parport_ieee1284_epp_write_addr,
+ parport_ieee1284_epp_read_addr,
+
+ parport_ieee1284_ecp_write_data,
+ parport_ieee1284_ecp_read_data,
+ parport_ieee1284_ecp_write_addr,
+
+ parport_ieee1284_write_compat,
+ parport_ieee1284_read_nibble,
+ parport_ieee1284_read_byte,
};
/* ----------- Initialisation code --------------------------------- */
@@ -252,7 +265,7 @@
#ifdef MODULE
-MODULE_AUTHOR("Joerg Dorchain");
+MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");
MODULE_DESCRIPTION("Parport Driver for Amiga builtin Port");
MODULE_SUPPORTED_DEVICE("Amiga builtin Parallel Port");
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)