Commit b731ec4f authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] parport_gsc

Update to the latest parport_gsc in the PA tree.
parent 57b1dfbd
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* by Helge Deller <deller@gmx.de> * (C) 1999-2001 by Helge Deller <deller@gmx.de>
* *
* *
* based on parport_pc.c by * based on parport_pc.c by
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/superio.h>
#include <linux/parport.h> #include <linux/parport.h>
#include <asm/gsc.h>
#include <asm/pdc.h> #include <asm/pdc.h>
#include <asm/hardware.h> #include <asm/hardware.h>
#include <asm/parport_gsc.h> #include <asm/parport_gsc.h>
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
MODULE_AUTHOR("Helge Deller <deller@gmx.de>"); MODULE_AUTHOR("Helge Deller <deller@gmx.de>");
MODULE_DESCRIPTION("HP-PARISC PC-style parallel port driver"); MODULE_DESCRIPTION("HP-PARISC PC-style parallel port driver");
MODULE_SUPPORTED_DEVICE("integrated PC-style parallel port"); MODULE_SUPPORTED_DEVICE("integrated PC-style parallel port");
MODULE_LICENSE("GPL");
/* /*
...@@ -347,13 +348,6 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, ...@@ -347,13 +348,6 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
struct parport tmp; struct parport tmp;
struct parport *p = &tmp; struct parport *p = &tmp;
#if 1
#warning Take this out when region handling works again, <deller@gmx,de>
#else
if (check_region(base, 3))
return NULL;
#endif
priv = kmalloc (sizeof (struct parport_gsc_private), GFP_KERNEL); priv = kmalloc (sizeof (struct parport_gsc_private), GFP_KERNEL);
if (!priv) { if (!priv) {
printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base); printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base);
...@@ -430,12 +424,6 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, ...@@ -430,12 +424,6 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
printk("]\n"); printk("]\n");
parport_proc_register(p); parport_proc_register(p);
request_region (p->base, 3, p->name);
if (p->size > 3)
request_region (p->base + 3, p->size - 3, p->name);
if (p->modes & PARPORT_MODE_ECP)
request_region (p->base_hi, 3, p->name);
if (p->irq != PARPORT_IRQ_NONE) { if (p->irq != PARPORT_IRQ_NONE) {
if (request_irq (p->irq, parport_gsc_interrupt, if (request_irq (p->irq, parport_gsc_interrupt,
0, p->name, p)) { 0, p->name, p)) {
...@@ -465,62 +453,56 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base, ...@@ -465,62 +453,56 @@ struct parport *__devinit parport_gsc_probe_port (unsigned long base,
static int __initdata parport_count; static int __initdata parport_count;
static int __init parport_init_chip(struct hp_device *d, struct pa_iodc_driver *dri) static int __devinit parport_init_chip(struct parisc_device *dev)
{ {
unsigned long port; unsigned long port;
int irq;
irq = busdevice_alloc_irq(d);
if (!irq) { if (!dev->irq) {
printk(KERN_DEBUG "IRQ not found for parallel device at 0x%p\n", d->hpa); printk("IRQ not found for parallel device at 0x%lx\n", dev->hpa);
return -ENODEV; return -ENODEV;
} }
port = ((unsigned long) d->hpa) + PARPORT_GSC_OFFSET; port = dev->hpa + PARPORT_GSC_OFFSET;
/* /* some older machines with ASP-chip don't support
some older machines with ASP-chip don't support the enhanced parport modes * the enhanced parport modes.
*/ */
if (!pdc_add_valid( (void *)(port+4))) { if (boot_cpu_data.cpu_type > pcxt && !pdc_add_valid(port+4)) {
/* Initialize bidirectional-mode (0x10) & data-tranfer-mode #1 (0x20) */
printk(KERN_DEBUG "%s: initialize bidirectional-mode.\n", __FUNCTION__); /* Initialize bidirectional-mode (0x10) & data-tranfer-mode #1 (0x20) */
parport_writeb ( (0x10 + 0x20), port + 4); printk("%s: initialize bidirectional-mode.\n", __FUNCTION__);
parport_writeb ( (0x10 + 0x20), port + 4);
} else { } else {
printk(KERN_DEBUG "%s: enhanced parport-modes not supported.\n", __FUNCTION__); printk("%s: enhanced parport-modes not supported.\n", __FUNCTION__);
} }
if (parport_gsc_probe_port(port, 0, if (parport_gsc_probe_port(port, 0, dev->irq,
irq, /* PARPORT_IRQ_NONE */ /* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, NULL))
PARPORT_DMA_NONE, NULL)) parport_count++;
parport_count++;
return 0; return 0;
} }
static struct pa_iodc_driver parport_drivers_for[] __initdata = { static struct parisc_device_id parport_tbl[] = {
{HPHW_FIO, 0x0, 0x0, 0x74, 0x0, 0, /* 715/64 */ { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x74 },
DRIVER_CHECK_SVERSION + DRIVER_CHECK_HWTYPE, { 0, }
"parallel device", "HP 7xx - Series", (void *) parport_init_chip},
{ 0 }
}; };
int __init parport_gsc_init(void) MODULE_DEVICE_TABLE(parisc, parport_tbl);
{
parport_count = 0;
register_driver(parport_drivers_for);
return 0;
}
static struct parisc_driver parport_driver = {
name: "Parallel",
id_table: parport_tbl,
probe: parport_init_chip,
};
static int __init parport_gsc_init_module(void) int __devinit parport_gsc_init(void)
{ {
return !parport_gsc_init(); return register_parisc_driver(&parport_driver);
} }
static void __exit parport_gsc_exit_module(void) static void __devexit parport_gsc_exit(void)
{ {
struct parport *p = parport_enumerate(), *tmp; struct parport *p = parport_enumerate(), *tmp;
while (p) { while (p) {
...@@ -532,11 +514,6 @@ static void __exit parport_gsc_exit_module(void) ...@@ -532,11 +514,6 @@ static void __exit parport_gsc_exit_module(void)
free_dma(p->dma); free_dma(p->dma);
if (p->irq != PARPORT_IRQ_NONE) if (p->irq != PARPORT_IRQ_NONE)
free_irq(p->irq, p); free_irq(p->irq, p);
release_region(p->base, 3);
if (p->size > 3)
release_region(p->base + 3, p->size - 3);
if (p->modes & PARPORT_MODE_ECP)
release_region(p->base_hi, 3);
parport_proc_unregister(p); parport_proc_unregister(p);
if (priv->dma_buf) if (priv->dma_buf)
pci_free_consistent(priv->dev, PAGE_SIZE, pci_free_consistent(priv->dev, PAGE_SIZE,
...@@ -548,7 +525,8 @@ static void __exit parport_gsc_exit_module(void) ...@@ -548,7 +525,8 @@ static void __exit parport_gsc_exit_module(void)
} }
p = tmp; p = tmp;
} }
unregister_parisc_driver(&parport_driver);
} }
module_init(parport_gsc_init_module); module_init(parport_gsc_init);
module_exit(parport_gsc_exit_module); module_exit(parport_gsc_exit);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment