aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/parport')
-rw-r--r--drivers/parport/Kconfig2
-rw-r--r--drivers/parport/ieee1284.c2
-rw-r--r--drivers/parport/parport_cs.c78
-rw-r--r--drivers/parport/parport_ip32.c1
-rw-r--r--drivers/parport/parport_pc.c18
-rw-r--r--drivers/parport/parport_sunbpp.c8
-rw-r--r--drivers/parport/share.c6
7 files changed, 31 insertions, 84 deletions
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig
index 855f389eea40..d92185a5523b 100644
--- a/drivers/parport/Kconfig
+++ b/drivers/parport/Kconfig
@@ -142,7 +142,7 @@ config PARPORT_AX88796
142 the AX88796 network controller chip. This code is also available 142 the AX88796 network controller chip. This code is also available
143 as a module (say M), called parport_ax88796. 143 as a module (say M), called parport_ax88796.
144 144
145 The driver is not dependant on the AX88796 network driver, and 145 The driver is not dependent on the AX88796 network driver, and
146 should not interfere with the networking functions of the chip. 146 should not interfere with the networking functions of the chip.
147 147
148config PARPORT_1284 148config PARPORT_1284
diff --git a/drivers/parport/ieee1284.c b/drivers/parport/ieee1284.c
index 8901ecf6e037..f9fd4b33a546 100644
--- a/drivers/parport/ieee1284.c
+++ b/drivers/parport/ieee1284.c
@@ -355,7 +355,7 @@ int parport_negotiate (struct parport *port, int mode)
355 return 0; 355 return 0;
356 } 356 }
357 357
358 /* Go to compability forward idle mode */ 358 /* Go to compatibility forward idle mode */
359 if (port->ieee1284.mode != IEEE1284_MODE_COMPAT) 359 if (port->ieee1284.mode != IEEE1284_MODE_COMPAT)
360 parport_ieee1284_terminate (port); 360 parport_ieee1284_terminate (port);
361 361
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index 23e50f4a27c5..067ad517c1f5 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -48,7 +48,6 @@
48#include <linux/parport.h> 48#include <linux/parport.h>
49#include <linux/parport_pc.h> 49#include <linux/parport_pc.h>
50 50
51#include <pcmcia/cs.h>
52#include <pcmcia/cistpl.h> 51#include <pcmcia/cistpl.h>
53#include <pcmcia/ds.h> 52#include <pcmcia/ds.h>
54#include <pcmcia/cisreg.h> 53#include <pcmcia/cisreg.h>
@@ -81,14 +80,6 @@ static void parport_detach(struct pcmcia_device *p_dev);
81static int parport_config(struct pcmcia_device *link); 80static int parport_config(struct pcmcia_device *link);
82static void parport_cs_release(struct pcmcia_device *); 81static void parport_cs_release(struct pcmcia_device *);
83 82
84/*======================================================================
85
86 parport_attach() creates an "instance" of the driver, allocating
87 local data structures for one device. The device is registered
88 with Card Services.
89
90======================================================================*/
91
92static int parport_probe(struct pcmcia_device *link) 83static int parport_probe(struct pcmcia_device *link)
93{ 84{
94 parport_info_t *info; 85 parport_info_t *info;
@@ -101,23 +92,11 @@ static int parport_probe(struct pcmcia_device *link)
101 link->priv = info; 92 link->priv = info;
102 info->p_dev = link; 93 info->p_dev = link;
103 94
104 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; 95 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
105 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
106 link->conf.Attributes = CONF_ENABLE_IRQ;
107 link->conf.IntType = INT_MEMORY_AND_IO;
108 96
109 return parport_config(link); 97 return parport_config(link);
110} /* parport_attach */ 98} /* parport_attach */
111 99
112/*======================================================================
113
114 This deletes a driver "instance". The device is de-registered
115 with Card Services. If it has been released, all local data
116 structures are freed. Otherwise, the structures will be freed
117 when the device is released.
118
119======================================================================*/
120
121static void parport_detach(struct pcmcia_device *link) 100static void parport_detach(struct pcmcia_device *link)
122{ 101{
123 dev_dbg(&link->dev, "parport_detach\n"); 102 dev_dbg(&link->dev, "parport_detach\n");
@@ -127,36 +106,14 @@ static void parport_detach(struct pcmcia_device *link)
127 kfree(link->priv); 106 kfree(link->priv);
128} /* parport_detach */ 107} /* parport_detach */
129 108
130/*====================================================================== 109static int parport_config_check(struct pcmcia_device *p_dev, void *priv_data)
131
132 parport_config() is scheduled to run after a CARD_INSERTION event
133 is received, to configure the PCMCIA socket, and to make the
134 parport device available to the system.
135
136======================================================================*/
137
138static int parport_config_check(struct pcmcia_device *p_dev,
139 cistpl_cftable_entry_t *cfg,
140 cistpl_cftable_entry_t *dflt,
141 unsigned int vcc,
142 void *priv_data)
143{ 110{
144 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 111 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
145 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 112 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
146 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; 113 p_dev->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
147 if (epp_mode) 114 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
148 p_dev->conf.ConfigIndex |= FORCE_EPP_MODE; 115
149 p_dev->resource[0]->start = io->win[0].base; 116 return pcmcia_request_io(p_dev);
150 p_dev->resource[0]->end = io->win[0].len;
151 if (io->nwin == 2) {
152 p_dev->resource[1]->start = io->win[1].base;
153 p_dev->resource[1]->end = io->win[1].len;
154 }
155 if (pcmcia_request_io(p_dev) != 0)
156 return -ENODEV;
157 return 0;
158 }
159 return -ENODEV;
160} 117}
161 118
162static int parport_config(struct pcmcia_device *link) 119static int parport_config(struct pcmcia_device *link)
@@ -167,13 +124,16 @@ static int parport_config(struct pcmcia_device *link)
167 124
168 dev_dbg(&link->dev, "parport_config\n"); 125 dev_dbg(&link->dev, "parport_config\n");
169 126
127 if (epp_mode)
128 link->config_index |= FORCE_EPP_MODE;
129
170 ret = pcmcia_loop_config(link, parport_config_check, NULL); 130 ret = pcmcia_loop_config(link, parport_config_check, NULL);
171 if (ret) 131 if (ret)
172 goto failed; 132 goto failed;
173 133
174 if (!link->irq) 134 if (!link->irq)
175 goto failed; 135 goto failed;
176 ret = pcmcia_request_configuration(link, &link->conf); 136 ret = pcmcia_enable_device(link);
177 if (ret) 137 if (ret)
178 goto failed; 138 goto failed;
179 139
@@ -202,14 +162,6 @@ failed:
202 return -ENODEV; 162 return -ENODEV;
203} /* parport_config */ 163} /* parport_config */
204 164
205/*======================================================================
206
207 After a card is removed, parport_cs_release() will unregister the
208 device, and release the PCMCIA configuration. If the device is
209 still open, this will be postponed until it is closed.
210
211======================================================================*/
212
213static void parport_cs_release(struct pcmcia_device *link) 165static void parport_cs_release(struct pcmcia_device *link)
214{ 166{
215 parport_info_t *info = link->priv; 167 parport_info_t *info = link->priv;
@@ -226,7 +178,7 @@ static void parport_cs_release(struct pcmcia_device *link)
226} /* parport_cs_release */ 178} /* parport_cs_release */
227 179
228 180
229static struct pcmcia_device_id parport_ids[] = { 181static const struct pcmcia_device_id parport_ids[] = {
230 PCMCIA_DEVICE_FUNC_ID(3), 182 PCMCIA_DEVICE_FUNC_ID(3),
231 PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial+Parallel Port: SP230",0x3beb8cf2,0xdb9e58bc), 183 PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial+Parallel Port: SP230",0x3beb8cf2,0xdb9e58bc),
232 PCMCIA_DEVICE_MANF_CARD(0x0137, 0x0003), 184 PCMCIA_DEVICE_MANF_CARD(0x0137, 0x0003),
@@ -236,9 +188,7 @@ MODULE_DEVICE_TABLE(pcmcia, parport_ids);
236 188
237static struct pcmcia_driver parport_cs_driver = { 189static struct pcmcia_driver parport_cs_driver = {
238 .owner = THIS_MODULE, 190 .owner = THIS_MODULE,
239 .drv = { 191 .name = "parport_cs",
240 .name = "parport_cs",
241 },
242 .probe = parport_probe, 192 .probe = parport_probe,
243 .remove = parport_detach, 193 .remove = parport_detach,
244 .id_table = parport_ids, 194 .id_table = parport_ids,
diff --git a/drivers/parport/parport_ip32.c b/drivers/parport/parport_ip32.c
index d3d7809af8bf..0dc34f12f92e 100644
--- a/drivers/parport/parport_ip32.c
+++ b/drivers/parport/parport_ip32.c
@@ -2203,7 +2203,6 @@ static __exit void parport_ip32_unregister_port(struct parport *p)
2203static int __init parport_ip32_init(void) 2203static int __init parport_ip32_init(void)
2204{ 2204{
2205 pr_info(PPIP32 "SGI IP32 built-in parallel port driver v0.6\n"); 2205 pr_info(PPIP32 "SGI IP32 built-in parallel port driver v0.6\n");
2206 pr_debug1(PPIP32 "Compiled on %s, %s\n", __DATE__, __TIME__);
2207 this_port = parport_ip32_probe_port(); 2206 this_port = parport_ip32_probe_port();
2208 return IS_ERR(this_port) ? PTR_ERR(this_port) : 0; 2207 return IS_ERR(this_port) ? PTR_ERR(this_port) : 0;
2209} 2208}
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 0950fa40684f..f330338c2f22 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -1488,7 +1488,7 @@ static void __devinit winbond_check(int io, int key)
1488 1488
1489 outb(key, io); 1489 outb(key, io);
1490 outb(key, io); /* Write Magic Sequence to EFER, extended 1490 outb(key, io); /* Write Magic Sequence to EFER, extended
1491 funtion enable register */ 1491 function enable register */
1492 outb(0x20, io); /* Write EFIR, extended function index register */ 1492 outb(0x20, io); /* Write EFIR, extended function index register */
1493 devid = inb(io + 1); /* Read EFDR, extended function data register */ 1493 devid = inb(io + 1); /* Read EFDR, extended function data register */
1494 outb(0x21, io); 1494 outb(0x21, io);
@@ -1527,7 +1527,7 @@ static void __devinit winbond_check2(int io, int key)
1527 x_oldid = inb(io + 2); 1527 x_oldid = inb(io + 2);
1528 1528
1529 outb(key, io); /* Write Magic Byte to EFER, extended 1529 outb(key, io); /* Write Magic Byte to EFER, extended
1530 funtion enable register */ 1530 function enable register */
1531 outb(0x20, io + 2); /* Write EFIR, extended function index register */ 1531 outb(0x20, io + 2); /* Write EFIR, extended function index register */
1532 devid = inb(io + 2); /* Read EFDR, extended function data register */ 1532 devid = inb(io + 2); /* Read EFDR, extended function data register */
1533 outb(0x21, io + 1); 1533 outb(0x21, io + 1);
@@ -1569,7 +1569,7 @@ static void __devinit smsc_check(int io, int key)
1569 1569
1570 outb(key, io); 1570 outb(key, io);
1571 outb(key, io); /* Write Magic Sequence to EFER, extended 1571 outb(key, io); /* Write Magic Sequence to EFER, extended
1572 funtion enable register */ 1572 function enable register */
1573 outb(0x0d, io); /* Write EFIR, extended function index register */ 1573 outb(0x0d, io); /* Write EFIR, extended function index register */
1574 oldid = inb(io + 1); /* Read EFDR, extended function data register */ 1574 oldid = inb(io + 1); /* Read EFDR, extended function data register */
1575 outb(0x0e, io); 1575 outb(0x0e, io);
@@ -1621,7 +1621,7 @@ static void __devinit detect_and_report_it87(void)
1621 u8 origval, r; 1621 u8 origval, r;
1622 if (verbose_probing) 1622 if (verbose_probing)
1623 printk(KERN_DEBUG "IT8705 Super-IO detection, now testing port 2E ...\n"); 1623 printk(KERN_DEBUG "IT8705 Super-IO detection, now testing port 2E ...\n");
1624 if (!request_region(0x2e, 2, __func__)) 1624 if (!request_muxed_region(0x2e, 2, __func__))
1625 return; 1625 return;
1626 origval = inb(0x2e); /* Save original value */ 1626 origval = inb(0x2e); /* Save original value */
1627 outb(0x87, 0x2e); 1627 outb(0x87, 0x2e);
@@ -2550,7 +2550,6 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq,
2550 const struct parport_pc_via_data *via) 2550 const struct parport_pc_via_data *via)
2551{ 2551{
2552 short inta_addr[6] = { 0x2A0, 0x2C0, 0x220, 0x240, 0x1E0 }; 2552 short inta_addr[6] = { 0x2A0, 0x2C0, 0x220, 0x240, 0x1E0 };
2553 struct resource *base_res;
2554 u32 ite8872set; 2553 u32 ite8872set;
2555 u32 ite8872_lpt, ite8872_lpthi; 2554 u32 ite8872_lpt, ite8872_lpthi;
2556 u8 ite8872_irq, type; 2555 u8 ite8872_irq, type;
@@ -2561,8 +2560,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq,
2561 2560
2562 /* make sure which one chip */ 2561 /* make sure which one chip */
2563 for (i = 0; i < 5; i++) { 2562 for (i = 0; i < 5; i++) {
2564 base_res = request_region(inta_addr[i], 32, "it887x"); 2563 if (request_region(inta_addr[i], 32, "it887x")) {
2565 if (base_res) {
2566 int test; 2564 int test;
2567 pci_write_config_dword(pdev, 0x60, 2565 pci_write_config_dword(pdev, 0x60,
2568 0xe5000000 | inta_addr[i]); 2566 0xe5000000 | inta_addr[i]);
@@ -2571,7 +2569,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq,
2571 test = inb(inta_addr[i]); 2569 test = inb(inta_addr[i]);
2572 if (test != 0xff) 2570 if (test != 0xff)
2573 break; 2571 break;
2574 release_region(inta_addr[i], 0x8); 2572 release_region(inta_addr[i], 32);
2575 } 2573 }
2576 } 2574 }
2577 if (i >= 5) { 2575 if (i >= 5) {
@@ -2599,7 +2597,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq,
2599 printk(KERN_INFO "parport_pc: ITE8873 found (1S)\n"); 2597 printk(KERN_INFO "parport_pc: ITE8873 found (1S)\n");
2600 return 0; 2598 return 0;
2601 case 0x8: 2599 case 0x8:
2602 DPRINTK(KERN_DEBUG "parport_pc: ITE8874 found (2S)\n"); 2600 printk(KERN_INFO "parport_pc: ITE8874 found (2S)\n");
2603 return 0; 2601 return 0;
2604 default: 2602 default:
2605 printk(KERN_INFO "parport_pc: unknown ITE887x\n"); 2603 printk(KERN_INFO "parport_pc: unknown ITE887x\n");
@@ -2635,7 +2633,7 @@ static int __devinit sio_ite_8872_probe(struct pci_dev *pdev, int autoirq,
2635 /* 2633 /*
2636 * Release the resource so that parport_pc_probe_port can get it. 2634 * Release the resource so that parport_pc_probe_port can get it.
2637 */ 2635 */
2638 release_resource(base_res); 2636 release_region(inta_addr[i], 32);
2639 if (parport_pc_probe_port(ite8872_lpt, ite8872_lpthi, 2637 if (parport_pc_probe_port(ite8872_lpt, ite8872_lpthi,
2640 irq, PARPORT_DMA_NONE, &pdev->dev, 0)) { 2638 irq, PARPORT_DMA_NONE, &pdev->dev, 0)) {
2641 printk(KERN_INFO 2639 printk(KERN_INFO
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
index 55ba118f1cf1..910c5a26e347 100644
--- a/drivers/parport/parport_sunbpp.c
+++ b/drivers/parport/parport_sunbpp.c
@@ -286,7 +286,7 @@ static struct parport_operations parport_sunbpp_ops =
286 .owner = THIS_MODULE, 286 .owner = THIS_MODULE,
287}; 287};
288 288
289static int __devinit bpp_probe(struct platform_device *op, const struct of_device_id *match) 289static int __devinit bpp_probe(struct platform_device *op)
290{ 290{
291 struct parport_operations *ops; 291 struct parport_operations *ops;
292 struct bpp_regs __iomem *regs; 292 struct bpp_regs __iomem *regs;
@@ -381,7 +381,7 @@ static const struct of_device_id bpp_match[] = {
381 381
382MODULE_DEVICE_TABLE(of, bpp_match); 382MODULE_DEVICE_TABLE(of, bpp_match);
383 383
384static struct of_platform_driver bpp_sbus_driver = { 384static struct platform_driver bpp_sbus_driver = {
385 .driver = { 385 .driver = {
386 .name = "bpp", 386 .name = "bpp",
387 .owner = THIS_MODULE, 387 .owner = THIS_MODULE,
@@ -393,12 +393,12 @@ static struct of_platform_driver bpp_sbus_driver = {
393 393
394static int __init parport_sunbpp_init(void) 394static int __init parport_sunbpp_init(void)
395{ 395{
396 return of_register_platform_driver(&bpp_sbus_driver); 396 return platform_driver_register(&bpp_sbus_driver);
397} 397}
398 398
399static void __exit parport_sunbpp_exit(void) 399static void __exit parport_sunbpp_exit(void)
400{ 400{
401 of_unregister_platform_driver(&bpp_sbus_driver); 401 platform_driver_unregister(&bpp_sbus_driver);
402} 402}
403 403
404MODULE_AUTHOR("Derrick J Brashear"); 404MODULE_AUTHOR("Derrick J Brashear");
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index dffa5d4fb298..a848e02e6be3 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -306,7 +306,7 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
306 spin_lock_init(&tmp->pardevice_lock); 306 spin_lock_init(&tmp->pardevice_lock);
307 tmp->ieee1284.mode = IEEE1284_MODE_COMPAT; 307 tmp->ieee1284.mode = IEEE1284_MODE_COMPAT;
308 tmp->ieee1284.phase = IEEE1284_PH_FWD_IDLE; 308 tmp->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
309 init_MUTEX_LOCKED (&tmp->ieee1284.irq); /* actually a semaphore at 0 */ 309 sema_init(&tmp->ieee1284.irq, 0);
310 tmp->spintime = parport_default_spintime; 310 tmp->spintime = parport_default_spintime;
311 atomic_set (&tmp->ref_count, 1); 311 atomic_set (&tmp->ref_count, 1);
312 INIT_LIST_HEAD(&tmp->full_list); 312 INIT_LIST_HEAD(&tmp->full_list);
@@ -678,7 +678,7 @@ void parport_unregister_device(struct pardevice *dev)
678 678
679 /* Make sure we haven't left any pointers around in the wait 679 /* Make sure we haven't left any pointers around in the wait
680 * list. */ 680 * list. */
681 spin_lock (&port->waitlist_lock); 681 spin_lock_irq(&port->waitlist_lock);
682 if (dev->waitprev || dev->waitnext || port->waithead == dev) { 682 if (dev->waitprev || dev->waitnext || port->waithead == dev) {
683 if (dev->waitprev) 683 if (dev->waitprev)
684 dev->waitprev->waitnext = dev->waitnext; 684 dev->waitprev->waitnext = dev->waitnext;
@@ -689,7 +689,7 @@ void parport_unregister_device(struct pardevice *dev)
689 else 689 else
690 port->waittail = dev->waitprev; 690 port->waittail = dev->waitprev;
691 } 691 }
692 spin_unlock (&port->waitlist_lock); 692 spin_unlock_irq(&port->waitlist_lock);
693 693
694 kfree(dev->state); 694 kfree(dev->state);
695 kfree(dev); 695 kfree(dev);